How can I call an installer class on 开发者_Python百科a button click event which read from the registry and also write a value in the registry in C#?
This cannot be done with a single custom action. You should have 2 separate custom actions:
- one which is executed on button click and reads information from registry
- another one which writes information in registry during install
The second action needs Administrator privileges and should run as deferred with no impersonation in InstallExecuteSequence.
Assuming you want to set installer properties based on what is read from registry, using an Installer Class is not really an option. I recommend using a DLL custom action which gets a handle to the installer session. You can find a tutorial here: http://www.codeproject.com/KB/install/msicustomaction.aspx
精彩评论