Inno Setup parameter with quotes in [Run] section

前端 未结 2 1206
执念已碎
执念已碎 2021-01-01 11:36

I use [Run] section to modify the merit value of some codecs with commandmerit.exe that supports command-line.

So the syntax is:

         


        
相关标签:
2条回答
  • 2021-01-01 12:06

    I can see two different things in your problem.

    First, is the { having a special meaning in inno setup, because it is the start of a constant. So, you have to escape the { by doubling it, e.g. {{. There is no need to escape the closing bracket because it is treated as the end of a constant only if it is a start for that constant.

    Second, is that you're trying to pass " as part of the string, but that seems unnecessary in this case, since the purpose of the " character in the command line parameters is to allow the use of blank spaces inside a single parameter, but none of your parameters have spaces.

    All that said, you must try writing your command like this:

    [run]
    Filename: "{app}\Commandmerit.exe"; Parameters: {{F8FC6C1F-DE81-41A8-90FF-0316FDD439FD} 0x10000000; WorkingDir: "{app}"
    
    0 讨论(0)
  • 2021-01-01 12:31

    To add quotes to a parameter, you must double up each quote, and then put quotes around the entire value.

    Your second attempt was close but you forgot the middle ones.

    Filename: "{app}\Commandmerit.exe"; Parameters: """{F8FC6C1F-DE81-41A8-90FF-0316FDD439FD}"" ""0x10000000"""; WorkingDir: "{app}"
    
    0 讨论(0)
提交回复
热议问题