How to pass parameter through "Run-->Parameters" in Inno Setup?
Asked Answered
G

2

7

I worked with passing command line parameters through Command prompt. (/d<name>=<value>). It's work.

Later I found "parameters" option in "Run" menu of "Inno Setup 5". I tried but failed to pass. My Attempts

"/dWish=Hello"

/dWish=Hello

"Wish=Hello"

Wish="Hello"

Wish="Hello"

Wish=Hello

And access like {#Wish}. But compilation filed with error undeclared identifier "Wish"

This is for option enter image description here

Gynoecium answered 29/1, 2015 at 13:17 Comment(7)
They are passed to the built setup, not to the compiler.Garotte
I'm sorry, I found Compile option on Build. There is no Build Setup.Gynoecium
I tried with this iscc "/dName=Demo" "Installation_Script.iss". It's working. Now i want pass Name=Demo through Inno Setup UI. Means Run==> Parameters section. With out using Command PromptGynoecium
You cannot. The Inno Setup IDE run (F9) first builds the script (if necessary) and then runs the built setup passing those parameters. Those IDE run parameters are not passed to the compiler. But you may try e.g. Inno Script Studio which might have some IDE options to set parameters passed to the compiler.Garotte
Neither Inno Script Studio or InnoIDE support passing command line parameters to the compiler either, at least in the versions of those I have available.Otolaryngology
Yes @Garotte @KenWhite. I too test with Inno Script Studio. Same issue. I'll manage by using Command prompt. But only only doubt is What is the use of "Run==>parameter" will use?Gynoecium
That's for setup command line parameters.Garotte
R
5

Settings configured via Run -> Parameters are used to pass instructions to the installer being executed after compilation, not the build compiler (ISCC). Options that may be set are available in the InnoSetup help under Setup Command Line Parameters.

To pass parameters to the compiler itself, run the compiler from the command-line, and use the /D switch. So to set variable VAR to value val, use:

iscc "/dVAR=val" "MyInstallerScript.iss"

The ISCC.exe program is located in:

%programfiles%\Inno Setup 5\ISCC.exe

Rennold answered 23/2, 2017 at 17:33 Comment(0)
S
0

I use the /d but it will not work and without any wrong.iscc "/DMyAppVersion=2.0" "D:\2.iss"

Streeter answered 16/4 at 11:35 Comment(1)
Ok I got it. I need remove #MyAppVersion in the script.Streeter

© 2022 - 2024 — McMap. All rights reserved.