If you are using the .Net Installer class, follow these steps:
Connect the data to your custom action using CustomActionData, for example: If your property is called MYPROP: /MyVar=[MYPROP]
Now you can access the data from your installer class:
protected override void OnAfterInstall(IDictionary savedState) {
string myVar = Context.Parameters["MyVar"];
RegistryKey key = Registry.LocalMachine;
using (key = key.CreateSubKey(@"SOFTWARE\MyCompany\MyApp")) {
key.SetValue("MyVar", myvar);
key.Close();
}
}
source
share