Installshield Exe Command Line Arguments

Active6 years, 5 months ago

So in the above script, the LaunchAppAndWait function is used to execute powershell.exe and the path to your.ps1 file, along with any command line arguments are used as well. So in your powershell script file, you can use something like this to get the NOTE: Inside your powershell script, you can use. Specifying Command-Line Parameters for an InstallShield Prerequisite. InstallShield 2012 Spring. The Application to Run tab of the InstallShield Prerequisite Editor lets you specify command-line parameters that you want to be used when the InstallShield prerequisite is launched on the target system. Command-Line Arguments for InstallAnywhere Installers. Sets the installer interface mode: silent/console/gui. C: myinstall.exe -i silent. Sh./install.bin -i console-f. Sets the location of a response file (installer.properties file) for the installer to use. (See Silent Installers and Response Files.).

I am creating a setup using InstallShield(Limited Edition) in VS2012. Firstly I created a setup file. I have some more things to do so I created a project and added its exe as a new custom action After Initialization(Before First Dialog).

Now I want to run this setup from command line and pass parameter(s) to it. I tried using %1 to take first parameter entered by command line but it is not working. Please tell how to pass parameters using command line and use it in exe file.

Christopher Painter
49.2k6 gold badges53 silver badges90 bronze badges

Installshield Command Line Parameters

quitprogquitprog
2321 gold badge7 silver badges22 bronze badges

1 Answer

Unless I'm missing something, InstallShield Limited Edition doesn't support this.

From a Windows Installer perspective, what you are referring to is called a Secure Custom Public Property. (See: SecureCustomProperties property )

Consider the commandline:

msiexec /i foo.msi SERVERNAME=MyServer

Installshield Exe Command Line Arguments

The fact that SERVERNAME is capitalized makes it public. The fact that it's listed in the SecureCustomProperties property would make it Secure. Only secure public properties work when UAC is taken into consideration. If the process is already elevated then it doesn't have to be secure but it really should be.

From the custom action side you'd used [SERVERNAME] to reference the value of the SERVERNAME property.

Then of course you'd likely want to customize the UI experience for when someone just runs the MSI but InstallShield limited edition doesn't support this.

I can think of ways of making it to work using WiX merge modules and/or applying transforms to the built MSI but all of this requires advanced MSI knowledge and it's generally easier to just upgrade to Professional.

Christopher PainterInstallshield Exe Command Line ArgumentsChristopher Painter
49.2k6 gold badges53 silver badges90 bronze badges

Not the answer you're looking for? Browse other questions tagged visual-studio-2012installationinstallshield-le or ask your own question.

Active3 years, 6 months ago

I am using and InstallShield installer setup.exe file to silently install my app. Now I want to invoke setup.exe with some command line arguments. And that arguments should be available in a EXE custom action that I have created to be executed at success. How can I pass the data all over from command line while invoking the setup file and use it inside my exe. The exe is a console app written in C#.

ShahzadShahzad
1,4891 gold badge8 silver badges19 bronze badges

1 Answer

I understand this is an MSI-based project, and I assume the .exe custom action is deferred execution.

What you should do is this:

Installshield Setup Parameters

  1. In your installer, define some custom MSI properties which you need for the .exe (e.g. ServerName, ServerPort)
  2. Create a custom action of type 'Set a property'. The Property Name should be the name of your custom action which runs the exe (e.g. RunMyExe). The Property Value should be a concatenated list of your custom properties e.g. [ServerName];[ServerPort]. Make this custom action run after InstallInitialize.
  3. In your .exe custom action (RunMyExe), pass [CustomActionData] as the Command Line to your exe program
  4. Have your exe program get the command line, and split it in order to get the data it needs
  5. Invoke the setup.exe while setting those custom properties you defined in step 1, e.g. setup.exe /v'ServerName=test-srv ServerPort=67000'

What happens is that, on a deferred custom action you can't use exernal properties (such as those supplied from the command line), you can only access internal ones such as CustomActionData. The trick here is that, if a property with the action's name exists (RunMyExe in the example above), the internal CustomActionData property get its value from it.

yossiz74yossiz74
7251 gold badge7 silver badges14 bronze badges

Installshield Setup Command Line Switches

Not the answer you're looking for? Browse other questions tagged windows-installercommand-line-argumentsinstallshieldcustom-actioninstallshield-le or ask your own question.