I have a WIX installer script and I want to be able to let the user of the resultant MSI file to be able to set the default language, product key and user information during that command line ca开发者_开发问答ll.
How do I use the command line parameter in my XML file so that its written to the registry?
You can pass property values as a command line parameters to msiexec. If I remember correctly, those should be public properties (names all uppercased). For instance:
msiexec /i myproduct.msi LANG=en PRODUCTKEY=mycompany USER=admin
In WiX code, you can reference those as usual properties, just like if you define them in the code. Note that you should handle the situation when a property value is not passed or passed data is not what you expect. You can either terminate the installation and ask user to provide appropriate data, or live with default values.
In order to write those property values to registry, use the usual approach with RegistryKey/RegistryValue elements.
精彩评论