Is there anyway to install the msi at specific location through the command line.
+1
A:
Yes, typically, you can specify a TARGETDIR=(path to install to)
when you run the msiexec
installer:
msiexec /i (yourFile).msi TARGETDIR=C:\YourBin\YourApp
I've been corrected (thanks to 0xA3 for this!) - my initial mention of INSTALLDIR
is wrong - you need to use TARGETDIR
instead. That one does indeed seem to work for just about any MSI I tried it on. Windows Installer stuff isn't exactly intuitive or easy......
marc_s
2010-07-15 20:29:07
Afaik, INSTALLDIR is only defined in InstallShield .msi files. Usually the property would be named TARGETDIR (see http://social.msdn.microsoft.com/Forums/en/winformssetup/thread/1997d0ae-4b67-4453-881d-7e176c372a67)
0xA3
2010-07-15 20:32:13
@0xA3: thanks for the heads up! I have been using INSTALLDIR in WiX projects, too - but you're right: run of the mill MSI's don't seem to respond to that :-( But TARGETDIR= works like a charm!
marc_s
2010-07-15 20:35:50
I also got corrected on the same mistake here on SO some time ago ;-)
0xA3
2010-07-15 20:37:25