Install msi with msiexec in a Specific Directory

只愿长相守 提交于 2019-11-26 22:42:55

问题


I want to install a msi with msiexec in a specific directory. I'm using:

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

It is not working with the "INSTALLDIR", because the msi is installing in the default path and not in my specific path.


回答1:


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




回答2:


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.




回答3:


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

Only this variant worked well.




回答4:


Use INSTALLLOCATION. When you have problems, use the /lv log.txt to dump verbose logs. The logs would tell you if there is a property change that would override your own options. If you already installed the product, then a second run might just update it without changing the install location. You will have to uninstall first (use the /x option).




回答5:


Actually, both INSTALLPATH/TARGETDIR are correct. It depends on how MSI processes this.

I create a MSG using wixToolSet. In WXS file, there is "Directory" Node, which root dir maybe like the following:

<Directory Id="**TARGETDIR**" Name="SourceDir">;

As you can see: Id is which you should use.




回答6:


This should work:

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



回答7:


In my case all of them did not work and finally it was

msiexec /i "msinamebla.msi" INSTALLFOLDER="C:\test\" /qb

I checked the log.txt as described by ezzadeen and found "INSTALLFOLDER" in there.




回答8:


for my msi, I had to set DEFAULTPATHC="D:\myfolder" because later in the installation process, both INSTALLDIR and TARGETDIR were reset to reflect the value in DEFAULTPATHC




回答9:


This one worked for me too

msiexec /i "msi path" INSTALLDIR="D:\myfolder" /q

I had tried two other iterations and both installed in the default C:\Program Files

INSTALLDIR="D:\myfolder" /q got it installed on the other drive.




回答10:


Use APPLICATIONFOLDER="path" for latest msiexec




回答11:


If you've used Advanced Installer to build your .msi you will want to use APPDIR=



来源:https://stackoverflow.com/questions/8839978/install-msi-with-msiexec-in-a-specific-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!