开发者

I want to call an installer class on a button click in C#. Is it possible?

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜