开发者

using CustomActionAttribute in System.Configuration.Install.Installer classes

Can I use CustomActionAttribute in classes that inherit from System.Configuration.Install.开发者_运维百科Installer? I want my class library to support both WiX and Visual Studio setup project.


I don't see any immediate reason why you couldn't do this. One obstacle is that Wix managed CA functions must be declared public static, so you would probably need to refactor most of your logic into functions that could be called by both your Install/Uninstall functions as well as your Wix CAs functions.

If you were to do this I would recommend creating the project from the Votive Managed Custom Action template in Visual Studio and then manually adding a Installer Class to the project. You can then define static functions in the installer class that can be exposed as CAs using the CustomAction attribute.


The reasons for not doing it are: you can't have methods with same names in your custom actions assembly custom action method calls in WiX And the DTF methods and VS setup project methods are different in signature. Also, as I've understood, VS setup project CAs don't use Session object, unlike DTF CAs.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜