Search code examples
c#windows-installersetup-project

How do you Create Properties For Setup Project?


I have a Setup Project that needs to be run as a silent installer. The installer used to run and open up another window to set a config setting. New requirements need me to setup up that same config value in silent mode.

So moving forward, I need the MSI to send parameters to a console application that I have already creating and runs in the commit Custom Action.

update.exe /s /v"/CONFIGVALUE"

Thanks in advance!

EDIT

The value is a URL that needs to be updated in the APP.config file. This value was assigned via a winform app that can read and write to the app.config file on commit of the installer. update.exe does not already accept any values. This is an new update to it that I have been trying to figure out.


Solution

  • Working backwards, look at the Arguments property in the properties window of the custom action exe, which is where you pass parameters. You can pass Windows Installer properties in square brackets, so they will resolve at install time to the actual values. So an argument of /x=[VersionNT64] gets passed into the program as x=601 on my system.

    So if you have an MSI command line that's silent you'd pass your value on the MSI command line, something like msiexec /i /q CONFIGVALUE=whatever and then in the arguments you'd put [CONFIGVALUE] in the appropriate place.

    Make sure you set Installer class to false in the properties window of your custom action.