Install msi with msiexec in a Specific Directory

后端 未结 13 2345
独厮守ぢ
独厮守ぢ 2020-12-01 04:15

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 no

相关标签:
13条回答
  • I tried TARGETDIR, INSTALLLOCATION and INSTALLDIR args and still it installed in the default directory. So I viewed the log and there is this arg where it sets the Application Directory and it is being set to default.

    MSI (s) (50:94) [09:03:13:374]: Running product '{BDAFD18D-0395-4E72-B295-1EA66A7B80CF}' with elevated privileges: Product is assigned.
    MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding APPDIR property. Its value is 'E:\RMP2'.
    MSI (s) (50:94) [09:03:13:374]: PROPERTY CHANGE: Adding CURRENTDIRECTORY property. Its value is 'C:\Users\Administrator'.
    

    So I changed the command to have APPDIR instead of the args mentioned above. It worked like a charm.

    msiexec /i "path_to_msi" APPDIR="path_to_installation_dir" /q
    

    Add /lv if you want to copy the installation progress to a logfile.

    0 讨论(0)
  • 2020-12-01 04:55

    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.

    0 讨论(0)
  • 2020-12-01 04:56

    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.

    0 讨论(0)
  • 2020-12-01 05:01

    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

    0 讨论(0)
  • 2020-12-01 05:01

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

    0 讨论(0)
  • 2020-12-01 05:04

    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.

    0 讨论(0)
提交回复
热议问题