How to set ValueData to contain quotation marks?

47 views
Skip to first unread message

Ron Swanson

unread,
Jun 10, 2025, 3:33:29 PM6/10/25
to innosetup
I'm working on a project and I am needing to make sure that the ValueData of our service has quotation marks around the file path. I am having trouble getting this to work.

Here is an example of what I have

[Run]
Filename: {sys}\sc.exe; Parameters: "CREATE ""App Name"" start=auto binPath=""{app}\App_Name.exe"" DisplayName= ""App Name"""; StatusMsg: "Creating App Name Service"; Flags: runhidden

The ValueData however ends up being C:\ProgramData\APP\AppName.exe. I want it to be "C:\ProgramData\APP\AppName.exe"

Bill Stewart

unread,
Jun 10, 2025, 5:00:55 PM6/10/25
to innosetup
IS uses "" to mean " inside a quoted string. But that might not be your actual problem?

sc.exe has a syntax oddity - you have to put a space after any '=' characters on its command line. (Look carefully at its help output.)

Bill Stewart

unread,
Jun 11, 2025, 3:39:16 PM6/11/25
to innosetup
On Tuesday, June 10, 2025 at 3:00:55 PM UTC-6 Bill Stewart wrote:

The ValueData however ends up being C:\ProgramData\APP\AppName.exe. I want it to be "C:\ProgramData\APP\AppName.exe"

...

sc.exe has a syntax oddity - you have to put a space after any '=' characters on its command line. (Look carefully at its help output.)

Another thought that occurred to me: You might also need to use \" on sc.exe's command line to mean a single " character. So in the IS string, you'd need \""

Bill Stewart

unread,
Jun 11, 2025, 5:31:55 PM6/11/25
to innosetup
On Wednesday 2025-06-11 15:30 UTC-6 Ron Swanson wrote:

> Adding the \" worked. Thanks for your help!

You are welcome, but please do not reply privately (reply to group instead).

Ron Swanson

unread,
Jun 11, 2025, 5:55:48 PM6/11/25
to innosetup
Adding the \" worked. Thanks for your help!

Reply all
Reply to author
Forward
0 new messages