MSI installer change default install location.
Using windows 11 (Even though windows 10 and 11 say they will run everything previous versions do, which, technically they can, that does not mean they will allow you to install it unless you upgrade from a previous version of windows that had it isntalled previously due to microsoft lack of support and security etc).
So, my dilemma, Windows 11 will not run some installers claiming the installers have been superceeded, but you can install them using the msiexec command.
As I use the PC for work and personal family things i'd like to keep the apps and games played by the kids seperate.
So, for example, for me, msiexec /i "installer.msi" /qb will install to the default folder in program files (x86), which is fine for apps, but, for games and other non work related software I like to keep them seperate.
I.e. c:\program files (x86)\games\ for kids games and c:\program files (x86)\Nonworkapps\ (These are also the default restore locations for all my app settings backups which saves me re installing for days)
Using msiexec /i "installer.msi" INSTALLDIR="c:\program files (x86)\games\" /qb and msiexec /i "installer.msi" TARGETDIR="c:\program files (x86)\games\" /qb just extracts the program files to the games folder (sometimes, sometimes it just defaults to installing to program files again).
What switches do I need to make the installer default location to c:\program files (x86)\games\ then create the end folder so it resembles c:\program files\games\gamename (not c:\program files\games\program company\gamename). Having to type and match the app name folder with backups will be a phenominal pain in the butt
I have tried Progdir and applicationfolder
Any help greatly appreciated
Answers (1)
These are all the options that MsiExec.exe provide the user
msiexec /Option <Required Parameter> [Optional Parameter]
Install Options
</package | /i> <Product.msi>
Installs or configures a product
/a <Product.msi>
Administrative install - Installs a product on the network
/j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]
Advertises a product - m to all users, u to current user
</uninstall | /x> <Product.msi | ProductCode>
Uninstalls the product
Display Options
/quiet
Quiet mode, no user interaction
/passive
Unattended mode - progress bar only
/q[n|b|r|f]
Sets user interface level
n - No UI
b - Basic UI
r - Reduced UI
f - Full UI (default)
/help
Help information
Restart Options
/norestart
Do not restart after the installation is complete
/promptrestart
Prompts the user for restart if necessary
/forcerestart
Always restart the computer after installation
Logging Options
/l[i|w|e|a|r|u|c|m|o|p|v|x|+|!|*] <LogFile>
i - Status messages
w - Nonfatal warnings
e - All error messages
a - Start-up of actions
r - Action-specific records
u - User requests
c - Initial UI parameters
m - Out-of-memory or fatal exit information
o - Out-of-disk-space messages
p - Terminal properties
v - Verbose output
x - Extra debugging information
+ - Append to existing log file
! - Flush each line to the log
* - Log all information, except for v and x options
/log <LogFile>
Equivalent of /l* <LogFile>
Update Options
/update <Update1.msp>[;Update2.msp]
Applies update(s)
/uninstall <PatchCodeGuid>[;Update2.msp] /package <Product.msi | ProductCode>
Remove update(s) for a product
Repair Options
/f[p|e|c|m|s|o|d|a|u|v] <Product.msi | ProductCode>
Repairs a product
p - only if file is missing
o - if file is missing or an older version is installed (default)
e - if file is missing or an equal or older version is installed
d - if file is missing or a different version is installed
c - if file is missing or checksum does not match the calculated value
a - forces all files to be reinstalled
u - all required user-specific registry entries (default)
m - all required computer-specific registry entries (default)
s - all existing shortcuts (default)
v - runs from source and recaches local package
Setting Public Properties
[PROPERTY=PropertyValue]
I cannot see in that list any option that provides the user the opportunity to define which directory the application is installed in, so my only thought would be to create a directory for the application, copy the installation files into that directory and run the installation to see if it installs in the directory, other than that, you may be looking for "Hens' Teeth".