开发者

How do I take a command line parameter and add it to the registry using wix installer?

开发者 https://www.devze.com 2023-03-27 04:29 出处:网络
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开发者

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消