Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install MSI with msiexec into specific directory

I want to install an MSI file with msiexec into a specific directory. I am using:

msiexec /i "msi path" INSTALLDIR="C:\myfolder" /qb 

Using "INSTALLDIR" is not working properly because the MSI is installed into the default path and not into the specified path.

like image 306
Cataldo Avatar asked Jan 12 '12 18:01

Cataldo


People also ask

How do I change my MSI installation directory?

When ThinApp installs the MSI package for individual users, the default MSI installation directory is %AppData%\<inventory_name> (VMware ThinApp). You can override the default installation directory by using an INSTALLDIR property in the msiexec command.

Can you install an exe with msiexec?

MsiExec.exe is the executable program of the Windows Installer used to interpret installation packages and install products on target systems. After you build your release, you can install your Windows Installer package (. msi) from the command line.

How do I create an MSI file from a folder?

In order to create MSI package from your project, navigate to the Package -> MSI tab, update Application Details like name, publisher, version and click Build MSI. Click Go to…, located next to the MSI file name field, to open the package containing folder in Windows Explorer.


2 Answers

Use TARGETDIR instead of INSTALLDIR. Note that the quote marks for TARGETDIR property are only around the path in the case of spaces.

msiexec /i "msi path" TARGETDIR="C:\myfolder" /qb

like image 131
Ciprian Avatar answered Sep 21 '22 10:09

Ciprian


InstallShield 12

INSTALLDIR represents the main product installation directory for a regular Windows Installer–based (or InstallScript MSI) installation, such as the end user launching Setup.exe or your .msi database.

TARGETDIR represents the installation directory for an InstallScript installation, or for an administrative Windows Installer based installation (when the user runs Setup.exe or MsiExec.exe with the /a command-line switch).

In an InstallScript MSI project, the InstallScript variable MSI_TARGETDIR stores the target of an administrative installation.

Source: INSTALLDIR vs. TARGETDIR

like image 40
David Schwartz Avatar answered Sep 17 '22 10:09

David Schwartz