Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass command line variables into WiXx based Windows Installer MSI

I am building an MSI installer with WiX and I am using the WixUI_Advanced. The definition of my ApplicationFolder looks like this, following the advice in another SO answer (WiX tricks and tips).

  <Directory Id="TARGETDIR" Name="SourceDir">
     <Directory Id="$(var.PlatformProgramFilesFolder)">
        <Directory Id="APPLICATIONFOLDER" Name="$(var.InstallName)">

I now want to give the user the option to do a silent install and pass the ApplicationFolder name on the path, either relative to the appropriate program files folder or absolute.

I know that I can pass public property values on the command-line of msiexec, but how do I use that as value for ApplicationFolder and how do I set this up for absolute vs relative paths.

like image 820
Jeroen Huinink Avatar asked Jun 10 '11 10:06

Jeroen Huinink


People also ask

Which command is valid for installing an MSI from command prompt?

Use the command msiexec to run the MSI file. The Windows Installer dialog displays. It contains a full list of the options you can use for your installation.

Which command line is used to trigger the repair of an MSI?

Msiexec.exe Command Line.


1 Answers

You just define the property on the command line when running msiexec:

msiexec /i product.msi APPLICATIONFOLDER="C:\Program Files\Company\Product\"

The files will be installed into "C:\Program Files\Company\Product" directory.

I'd advice using absolute path here. A relative path may lead to unexpected results.

like image 169
Alexey Ivanov Avatar answered Oct 22 '22 03:10

Alexey Ivanov