Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Pass Command Line Arguments to MSI Installer

Now my team working in a project using Windows Application(C#). We use MSI Installer for creating installation.

I didn't know how to pass command line parameters from MSI file & Setup.exe file.

for example

setup.msi username=demo password=pass

setup.exe username=demo password=pass

Please suggest a good example/reference

like image 824
amexn Avatar asked Aug 20 '10 05:08

amexn


People also ask

How do I pass MSI parameters to exe?

Use the /v option to pass command-line options and values of public properties through to Msiexec.exe. Note: If you pass the /v parameter at the command prompt when launching Setup.exe, any parameters that are specified for the CmdLine keyname in Setup.

Can I run MSI from command line?

As a single use solution, you can run the . msi as an administrator from the Windows command prompt. Open elevated Command Prompt. To do so, type "CMD" in Start menu or Start screen search box, and then simultaneously press Ctrl+Shift+Enter keys.

How do I customize an MSI installer?

Similar to Orca, to edit your MSI package, right-click it and select “Open with Advanced Installer”. Once the MSI database has loaded in Advanced Installer, you will notice a left menu pane where you will find all the options you need to directly edit your MSI.


2 Answers

This Code Project article has a pretty good example of doing this.

like image 77
Dave Barker Avatar answered Oct 24 '22 06:10

Dave Barker


You've got the right idea, but for the parameters to be available during the execute sequence, you'll need to pass public properties rather than private ones. Names of public properties are all uppercase.

For example, this would work:

msiexec /i setup.msi USERNAME=yourUserName PASSWORD=yourPassword
like image 33
Ed. Avatar answered Oct 24 '22 06:10

Ed.