zoukankan      html  css  js  c++  java
  • [Wix] 安装时建Services, 用户, 虚拟目录....

    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

  • 相关阅读:
    Android控件Editext、TextView属性详解
    修改Android签名证书keystore的密码、别名alias以及别名密码
    android 中如何限制 EditText 最大输入字符数
    keytool 错误 java.io.IOException: incorrect AVA format
    Android打包常见错误之Export aborted because fatal lint errors were found
    正则表达式之判断用户注册信息是否为汉字、字母和数字
    Android Dialog 系统样式讲解及透明背景
    Android中自定义Activity和Dialog的位置大小背景和透明度等
    字体在Android View中的输出 drawText
    怎么用CIFilter给图片加上各种各样的滤镜_1
  • 原文地址:https://www.cnblogs.com/huqingyu/p/53370.html
Copyright © 2011-2022 走看看