[Wix] 添加自定义Action
2004-10-17 18:32
232 查看
原文:http://strangelights.com/blog/archive/2004/09/27/176.aspx
An msi is really a relational database made up of a number of tables. When an installation runs the windows installer parses the msi and then queries tables to see what actions it must perform. Msdn has a complete list of tables that the windows installer uses and it’s very worth while checking it out because it will give you a good idea of what you’re install is going to do and why.
If you use certain wix elements you may notice they create tables that are not listed in the msdn documentation. This is not because they are undocumented tables, it is because the msi format allows you to define custom tables and these custom tables will be ignored by the installer service.
So why bother putting in these tables if the installer is going to ignore them? This is because the number of things that the installer server can do is somewhat limited; there are quite a few tasks, such as installing virtual directories, file shares or users, that it is very difficult to do with out resorting custom actions. While custom actions are a necessary evil, they are also annoying because they do not fit well into the nice declarative programming model of the installer server and make it very easy to create installs that do not roll back correctly. So wix has come up with a mechanism that allows it to extend the things that installer can do by creating these new tables and providing a set of generic custom actions which queries these tables and install certain items based on the result of the query. This is a fantastic thing in my opinion, because suddenly loads of new installation task become available by a declarative mechanism. Also these mechanism will be tried and test by wix users, so are probably much safer that opening VS.NET and hacking out a few C# based custom actions.
The unfortunate thing is these custom action based tables are still largely undocumented, so it quite possible to user a wix element in an install without releasing that you need to include a custom action definition. And so it will do not do anything. And so you will bash you head against the monitor trying to find out why it does nothing.
Wix comes with two files, ‘ca\sca.wixlib’ and ‘ca\wixca.wixlib’, which will add the necessary custom action definitions for you. There is currently no documentation to tell you which elements to require you to include a custom action file in you’re build, this why I have prepared the following list of elements that need custom actions definitions. I’ve also listed the name of the method you need to call in the dll that will process the tables produced by the elements listed.
Elements that require ‘ca\sca.wixlib’ and the dlls ‘scaexec.dll’ and ‘scasched.dll’:
IIs related elements – ‘ConfigureIIs’ custom action:
Certificate
MIME
WebAddress
WebApplication
WebApplicationExtension
WebAppPool
WebDir
WebDirProperties
WebError
WebFilter
WebProperty
WebServiceExtension
WebSite
WebVirtualDir
Sql related elements – ‘ConfigureSql’ custom action:
SqlDatabase
SqlFileSpec
SqlLogFileSpec
SqlScript
SqlString
Performance counter related elements – ‘ConfigurePerfmonInstall’ and ‘ConfigurePerfmonUninstall’ custom actions:
PerfCounter
File share related elements – ‘ConfigureSmb’ custom actions:
FileShare
Permission (When child of FileShare)
User related elements – ‘ConfigureUsers’ custom action:
User
Group
GroupRef
Elements that require ‘ca\wixca.wixlib’ and the dll ‘wixca.dll’:
Service related elements – ‘CaSchedServiceConfig’ and ‘CaExecServiceConfig’ custom action:
ServiceArgument[/b]
ServiceConfig
ServiceControl
ServiceDependency
ServiceInstall
Permission (When child of ServiceInstall)
I hopefully this has given you a good idea when you need to included custom action configuration and when you don’t. I’m going to creating some more detailed examples of how to use these elements soon.
posted on Monday, September 27, 2004 12:44 PM
An msi is really a relational database made up of a number of tables. When an installation runs the windows installer parses the msi and then queries tables to see what actions it must perform. Msdn has a complete list of tables that the windows installer uses and it’s very worth while checking it out because it will give you a good idea of what you’re install is going to do and why.
If you use certain wix elements you may notice they create tables that are not listed in the msdn documentation. This is not because they are undocumented tables, it is because the msi format allows you to define custom tables and these custom tables will be ignored by the installer service.
So why bother putting in these tables if the installer is going to ignore them? This is because the number of things that the installer server can do is somewhat limited; there are quite a few tasks, such as installing virtual directories, file shares or users, that it is very difficult to do with out resorting custom actions. While custom actions are a necessary evil, they are also annoying because they do not fit well into the nice declarative programming model of the installer server and make it very easy to create installs that do not roll back correctly. So wix has come up with a mechanism that allows it to extend the things that installer can do by creating these new tables and providing a set of generic custom actions which queries these tables and install certain items based on the result of the query. This is a fantastic thing in my opinion, because suddenly loads of new installation task become available by a declarative mechanism. Also these mechanism will be tried and test by wix users, so are probably much safer that opening VS.NET and hacking out a few C# based custom actions.
The unfortunate thing is these custom action based tables are still largely undocumented, so it quite possible to user a wix element in an install without releasing that you need to include a custom action definition. And so it will do not do anything. And so you will bash you head against the monitor trying to find out why it does nothing.
Wix comes with two files, ‘ca\sca.wixlib’ and ‘ca\wixca.wixlib’, which will add the necessary custom action definitions for you. There is currently no documentation to tell you which elements to require you to include a custom action file in you’re build, this why I have prepared the following list of elements that need custom actions definitions. I’ve also listed the name of the method you need to call in the dll that will process the tables produced by the elements listed.
Elements that require ‘ca\sca.wixlib’ and the dlls ‘scaexec.dll’ and ‘scasched.dll’:
IIs related elements – ‘ConfigureIIs’ custom action:
Certificate
MIME
WebAddress
WebApplication
WebApplicationExtension
WebAppPool
WebDir
WebDirProperties
WebError
WebFilter
WebProperty
WebServiceExtension
WebSite
WebVirtualDir
Sql related elements – ‘ConfigureSql’ custom action:
SqlDatabase
SqlFileSpec
SqlLogFileSpec
SqlScript
SqlString
Performance counter related elements – ‘ConfigurePerfmonInstall’ and ‘ConfigurePerfmonUninstall’ custom actions:
PerfCounter
File share related elements – ‘ConfigureSmb’ custom actions:
FileShare
Permission (When child of FileShare)
User related elements – ‘ConfigureUsers’ custom action:
User
Group
GroupRef
Elements that require ‘ca\wixca.wixlib’ and the dll ‘wixca.dll’:
Service related elements – ‘CaSchedServiceConfig’ and ‘CaExecServiceConfig’ custom action:
ServiceArgument[/b]
ServiceConfig
ServiceControl
ServiceDependency
ServiceInstall
Permission (When child of ServiceInstall)
I hopefully this has given you a good idea when you need to included custom action configuration and when you don’t. I’m going to creating some more detailed examples of how to use these elements soon.
posted on Monday, September 27, 2004 12:44 PM
相关文章推荐
- 低版本系统兼容的ActionBar(四)添加Tab+添加自定义的Tab视图+Fragment
- iOS alertController之actionsheet样式添加控件(类似自定义actionsheet)
- ECSHOP自定义action添加
- Openvswitch原理与代码分析(4): 修改Openvswitch代码添加自定义action
- VC3自定义标签,给ajax.Action和Html.ActionLink加上支持图片链接的功能,添加了htmlAttributes
- android actionbar自定义View并添加点击事件
- nc 自定义Action 添加拓展按钮的方法
- 给GMF应用程序添加自定义Action
- Openvswitch原理与代码分析(8): 修改Openvswitch代码添加自定义action
- 在Jquery validation里验证通过后,自定义提交不同的action路径,适合一个窗口既可以作为添加对话框也可以作为编辑对话框
- Openvswitch原理与代码分析(8): 修改Openvswitch代码添加自定义action
- Android中自定义ImageView添加文字说明详解
- 自定义点击方法target-action
- 微信公众号自定义菜单中添加emoji表情
- Android 动态添加自定义式样的按钮
- QML——添加自定义模块
- zabbix添加自定义item、触发器、图形,并执行远端命令
- ecshop 添加自定义动态库项目详解
- QT中如何在QListWidget中添加自定义的 tiem
- Yii2框架 model方法下setAttributes用法(自定义model 添加方法)