I have a msi which need to pass some parameters while installation, I use command line to pass the parameters like below command:
msiexec /i installer.msi ALLUSERS=1 AUTOUPGRADEENABLED=0
For users, install from command line is too complicated, so I want to build an installer which will install the msi with the parameters after double click the installer, anyone knows how to do it.

- 11
- 2
- 3
2 Answers
You could download Orca and edit/save the msi with the properties already set. Or, you could create a bat file which launches the msi with the command line properties set.

- 698
- 3
- 16
Application Launch Code: I always prefer to ask questions and set options during application launch per-user. I find that the most flexible, robust, easiest to test and good for QA people to test new versions.
Note that this works best for user-specific settings. For shared settings you often need to write to HKLM and then you need setup-elevation or run the application with admin rights.
Defaults: As stated you can default the property values to proper values in the Property table when you build your MSI. Then you might not need to set anything via command line?
It is possible to re-save a finished MSI using Orca (free MSI editor), but you are supposed to not change a finished MSI (might be signed and re-saving breaks it).
The formally approved mechanism for editing parameters is know as a transform - a mini-database of changes to main MSI database applied at installation time. See this command line and separate section below:
msiexec.exe /I "My.msi" /QN /L*V "C:\My.log" TRANSFORMS="C:\1031.mst;C:\My.mst"
Batch File: You can use a batch file to set these options at a "ready-made" command line and put the batch file next to your MSI. This is easy, just what you have already in a batch file - perhaps with silent running enabled.
A batch file can also apply a transform - as shown in the command line above.
A transform can even be merged into an existing MSI and saved as a new MSI. Not recommended, but possible.
GUI: You can use the MSI GUI to tweak the values for these properties. This requires a bit of work that is not that complicated, but very fiddly and time consuming.
Burn: You can wrap all the MSI files in a
setup.exe Burn bundle
and specify a command line to run for exe files by default and set the MSI properties for normal MSI installations.
Transform: You can have users create a transform to specify settings that are applied for installation - but that is besides the point here, unless you deliver your own, default one. Then you need to apply it via the command line or merge it into your main MSI at build time.
Further Links:
- How to make better use of MSI files
- How to tag or customize the a binary (for example of an installer)
- How to convert an MSM file into an MSI file on the command line? Doing this with the Windows Installer SDK, or COM
- Can the resulting command line be determined after running an .msi installer?
- SQL Server named instance with Visual Studio 2017 Installer project

- 39,960
- 25
- 91
- 164