0
votes

I am writing a C# custom action for my wix installer, which will have to set the installation directory.

I've found this question where the asker ends up using SetProperty but that won't work for me because my custom action will read the value from a config file then set it.

Edit: To add some more information, I have a bootstrapper that will call a bunch of MSIs. The bootstrapper will pass a parameter to each MSI, containing a path to an XML config file. The MSI will have a custom action that will read this XML file, and read the install path from it. The MSI is being called with UI suppressed.

How can I accomplish this?

1
Do you want to change it before the UI so that it shows as the default in the dialog presented to the user, and the user can still change it? Or are you suppressing the UI and just installing to some fixed location?PhilDW
@PhilDW I added some more info that answers your questions.user145400
I think it would be easier for the bootstrapper to read that Xml file and get the install folders then pass it to each MSI on the command line equivalent of msiexec /I <file> INSTALLFOLDER=<that directory>. If the property is INSTALLFOLDER, the directory property for the main application directory. If you did it your way, in each MSI you'd get the value from the Xml file (custom action code) and set the INSTALLFOLDER property to that value.PhilDW

1 Answers

0
votes

PhilDW is right, I can simply pass it in command line and that will set the install directory. No need to use a custom action for this at all.