Passing config file to MSI as argument and using it with custom actions with Silent Installation

I created a Basic MSI Project to create an installer for my project in Installshield 2014 and it works fine. I also created a custom action to execute my exe file when installing the application.

Then I create Silent Installer using (/ s) command line argument. I want to pass a Config file to my MSI setup and one of my exe ex Action files needs this config file to set up a basic project setup.

eg

Installer.msi / s "c: \ project \ config.txt"

How do I pass this config file parameter to my exe as a command line argument? I have also searched on google and existing questions. I couldn't do it. Until now, I haven't had any way of doing this. Please help me to do this.

Thanks in advance.

+3


source to share


2 answers


You can pass values โ€‹โ€‹to MSI on the command line. This is one way of passing values โ€‹โ€‹directly to your MSI, another way is using transform to modify the MSI, See this answer: Using custom msiexec.exe command line or using transform files .

As far as I know, there is no limit to how many values โ€‹โ€‹you can pass on the command line:

msiexec.exe /I "C:\Install.msi" /QN /L*V "C:\msilog.log" STARTAPP=1 FIREWALLRULE="Long string here"



A short description of the command line above:

/L*V "C:\msilog.log"= verbose logging
/QN = run completely silently
STARTAPP="1" = Your property indicating the app should be started after install 
FIREWALLRULE="Long string here" = Your firewall rule to apply via a custom action

      

+2


source


Yes, Glytzhkof is right. According to your question, you can "invent" your own property, for example. CONFIGFILE and pass something like CONFIGFILE = "C: \ myconfig.ini" on the command line or something similar. If the path is always the same (in SOURCEDIR for example), you can escape the whole path and add it to your code, but don't rely on the source for the patch (.msp), for example.

I'm not sure if I understand what you mean exactly with the "silent installer". You can call each msi setting with the "/ qn" (or "/ quiet") parameter silently. The "/ s" option is not specific to MSIs, but is more commonly used for setup.exe (bootstrappers) or InstallShield script files. You can of course combine a bootloader with a callable MSI.



For example, with the built-in setup.exe InstallShield it might be something like:

setup.exe /s /v "/qn CONFIGFILE=myconfig.ini"

      

0


source







All Articles