[Wix] 安装时建Services, 用户, 虚拟目录....
2004-10-17 18:48
274 查看
If you have had a look at the documentation you’ve probably noticed a few elements like “ServiceInstall”, “User” and “WebVirtualDir”. What these elements all have in common is that if you add them to a wix document they will compile and link with out any problem, but they will not do anything at all on installation. If you take a closer at the msi produced using the reason they do nothing becomes clear, for example the User elements generates a table called user in the Msi and if you read the windows installer documentation you will quickly see there is no User table defined.
But why go to all the bother of putting these elements into the wix schema if they don’t do anything? They are there because they are designed to work with the wix custom action dlls, that is “scasched.dll” and “scaexec.dll”. The idea behind these is that common task such as creating users, installing services and virtual directories have been given there own set of wix commands even though they are not natively supported natively by the windows installer. I think this is a really good idea, but there is a down side, which I’ll cover towards then end of this post.
To make these elements work correctly you have to follow a number of steps that I have not seen documented anywhere. First of you need include the dll from the wix\ca in you’re install script, this is done with the following wix syntax (paths make of course vary depending on you’re install):
Next you need to try out the wix code to call into the correct custom action for the kind of elements you’re adding. Again I’ve not see this documented anywhere, but you can find what you need to know form the “scasched.cpp” file in the fix source. If you were trying to add a user then you would need the following CustomAction tag to call into the write bit of code.
You also need to specific when the custom action should be called; here is an easy to do this.
In all there are 6 custom action entry points listed in the source file “scasched.cpp”, these are: ConfigureIIs
ConfigureSql
ConfigurePerfmonInstall
ConfigurePerfmonUninstall
ConfigureSmb
ConfigureUsers
It is not entry clear which elements in wix these map, although they all probably map to sets of elements that will not work with out calling into code in the custom action dlls. It is important to note that these are sets of elements not individual elements. Some are fairly obvious; for example instal using any element prefixed with web needs to call into the ConfigureIIs custom action and ConfigureUsers action has three elements that will not work with out it, these are User, Group and GroupRef. However it’s odd that these is both ConfigurePerfmonInstall and ConfigurePerfmonUninstall where as the others just have one action. Also there appears to be a customaction missing as the element ServiceArgument, ServiceConfig, ServiceControl, ServiceDependency, ServiceInstall have no equivalent in the window install documentation, yet there is no customaction for them. I’m going to try and work out exactly what maps to what and list in a later blog entry.
As I have menationed there is a down side to these none native elements. They don’t work very well. I’ve being trying to use them to install a user and it just isn’t working. I’ve put together this short sample that should install a local user, but it does not, it breaks with some very obscure errors. Create a log of the msi action clear show that the entires from the user table are being used, but don’t really reveal why it fails. Here is an excerpt log of the msi:
Action start 18:08:33: ConfigureUsers.
MSI (s) (F4:F0): Creating MSIHANDLE (33) of type 790542 for thread 2544
Action start 18:08:33: CreateUserRollback.
Action ended 18:08:33: CreateUserRollback. Return value 0.
ConfigureUsers: Error 0x8007065a: Failed MsiDoAction on deferred action
ConfigureUsers: Error 0x8007065a: failed to schedule RemoveUser
ConfigureUsers: Error 0x8007065a: failed to add/remove User actions
Action ended 18:08:33: ConfigureUsers. Return value 3.
Can any one explain this error? Answers on a post card ...
posted on Monday, September 06, 2004 7:42 PM
But why go to all the bother of putting these elements into the wix schema if they don’t do anything? They are there because they are designed to work with the wix custom action dlls, that is “scasched.dll” and “scaexec.dll”. The idea behind these is that common task such as creating users, installing services and virtual directories have been given there own set of wix commands even though they are not natively supported natively by the windows installer. I think this is a really good idea, but there is a down side, which I’ll cover towards then end of this post.
To make these elements work correctly you have to follow a number of steps that I have not seen documented anywhere. First of you need include the dll from the wix\ca in you’re install script, this is done with the following wix syntax (paths make of course vary depending on you’re install):
Next you need to try out the wix code to call into the correct custom action for the kind of elements you’re adding. Again I’ve not see this documented anywhere, but you can find what you need to know form the “scasched.cpp” file in the fix source. If you were trying to add a user then you would need the following CustomAction tag to call into the write bit of code.
You also need to specific when the custom action should be called; here is an easy to do this.
In all there are 6 custom action entry points listed in the source file “scasched.cpp”, these are: ConfigureIIs
ConfigureSql
ConfigurePerfmonInstall
ConfigurePerfmonUninstall
ConfigureSmb
ConfigureUsers
It is not entry clear which elements in wix these map, although they all probably map to sets of elements that will not work with out calling into code in the custom action dlls. It is important to note that these are sets of elements not individual elements. Some are fairly obvious; for example instal using any element prefixed with web needs to call into the ConfigureIIs custom action and ConfigureUsers action has three elements that will not work with out it, these are User, Group and GroupRef. However it’s odd that these is both ConfigurePerfmonInstall and ConfigurePerfmonUninstall where as the others just have one action. Also there appears to be a customaction missing as the element ServiceArgument, ServiceConfig, ServiceControl, ServiceDependency, ServiceInstall have no equivalent in the window install documentation, yet there is no customaction for them. I’m going to try and work out exactly what maps to what and list in a later blog entry.
As I have menationed there is a down side to these none native elements. They don’t work very well. I’ve being trying to use them to install a user and it just isn’t working. I’ve put together this short sample that should install a local user, but it does not, it breaks with some very obscure errors. Create a log of the msi action clear show that the entires from the user table are being used, but don’t really reveal why it fails. Here is an excerpt log of the msi:
Action start 18:08:33: ConfigureUsers.
MSI (s) (F4:F0): Creating MSIHANDLE (33) of type 790542 for thread 2544
Action start 18:08:33: CreateUserRollback.
Action ended 18:08:33: CreateUserRollback. Return value 0.
ConfigureUsers: Error 0x8007065a: Failed MsiDoAction on deferred action
ConfigureUsers: Error 0x8007065a: failed to schedule RemoveUser
ConfigureUsers: Error 0x8007065a: failed to add/remove User actions
Action ended 18:08:33: ConfigureUsers. Return value 3.
Can any one explain this error? Answers on a post card ...
posted on Monday, September 06, 2004 7:42 PM
相关文章推荐
- Centos 安装vsftp 虚拟用户,单独访问目录
- [Wix] 有IIS虚拟目录的程序安装(XP or Win2003)
- JavaWeb学习之tomcat安装与运行、tomcat的目录结构、配置tomcat的管理用户、web项目目录、虚拟目录、虚拟主机(1)
- Linux 配置Apache服务器 上 (安装,虚拟目录)
- Nginx安装、默认虚拟主机 、Nginx用户认证、Nginx域名重定向
- RHEL 5 vsftpd 下简单设置多个虚拟用户使用一个目录
- Vsftpd安装、系统用户及虚拟用户配置详解
- 关于JavaWeb(一)——web介绍,tomcat与安装及其常见问题,虚拟目录及其配置虚拟主机
- vsftpd安装,配置虚拟用户脚本
- CentOS安装vsftpd并限制用户访问自己目录
- CentOS 下vsftp 安装--虚拟用户
- AIX下安装proFTPD-支持虚拟用户和SFTP
- Nginx介绍、Nginx安装、默认虚拟主机、用户认证、nginx中PHP解析
- vsftp虚拟用户安装配置
- vsftpd安装及虚拟用户认证
- 【转】win2003系统下apache、php、mysql安装以及虚拟主机和目录权限设置
- 安装vsftp 虚拟用户设置全解
- centos7编译安装apache后添加用户认证和配置虚拟主机
- vsftpd下设置多个虚拟用户使用同一个目录
- Nginx安装与配置:默认虚拟主机、用户认证和域名重定向