【问题标题】:Does running a wix installer on a client machine require installing the wix framework on that machine?在客户端机器上运行 wix 安装程序是否需要在该机器上安装 wix 框架?
【发布时间】:2017-02-06 08:52:28
【问题描述】:

我已经为我的桌面应用程序创建了一个 wix 安装程序。我已经添加了一些自定义操作。安装程序在我的开发机器上运行良好,但自定义操作没有在客户端机器上被调用。所以,我应该安装 wix 框架在客户端计算机上以使自定义操作起作用?或者我是否必须在计算机上安装 Windows 安装程序? 请注意,在客户端机器上安装后,应用程序确实显示在添加或删除程序中。只是没有调用自定义操作。我使用的是 wix 3.10.3.3007。 自定义动作项目基于.net framework 4.5,其配置文件内容如下:

<?xml version="1.0" encoding="utf-8" ?> <configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">

        <!--
          Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that
          the custom action should run on. If no versions are specified, the chosen version of the runtime
          will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against.

          WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility
          problems with future versions of the .NET Framework runtime. It is highly recommended that you specify
          only the version(s) of the .NET Framework runtime that you have tested against.

          Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0.

          In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies 
          by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true".

          For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx
        -->

        <supportedRuntime version="v4.0" />
        <supportedRuntime version="v2.0.50727"/>

    </startup>

    <!--
      Add additional configuration settings here. For more information on application config files,
      see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx
    -->

</configuration>

另外,这里是调用 Product.wxs 文件中自定义操作的代码:

  <CustomAction Id="UninstallSetPro"   Execute="immediate" Property="SectionName"  Value="Uninstall" />
    <CustomAction Id="InstallSetPro" Execute="immediate" Property="SectionName" Value="Install" />
    <CustomAction Id="Install" Return="check"  Execute="immediate"  BinaryKey="CustomAction_OutlookPlugin"  DllEntry="RegistryInstall"   />
    <CustomAction Id="Uninstall" Return="check"  Execute="immediate"  BinaryKey="CustomAction_OutlookPlugin"  DllEntry="RegistryInstall"   />
    <CustomAction Id="CopyOrderingFile" Return="check"  Execute="immediate"  BinaryKey="CustomAction_OutlookPlugin"  DllEntry="CopyOrderingFile"  />
    <CustomAction Id="ModifyConfigFile" Return="check"  Execute="immediate"  BinaryKey="CustomAction_OutlookPlugin"  DllEntry="modifyConfigFile"  />
    <CustomAction Id="AddInstallationParamToConfigFile" Return="check"  Execute="immediate"  BinaryKey="CustomAction_OutlookPlugin"  DllEntry="AddInstallationParametersToConfigFile"  />
    <InstallExecuteSequence>
      <Custom Action="InstallSetPro" After="WriteRegistryValues" >$ProductFiles&gt;2</Custom>
      <Custom Action="Install" After="InstallSetPro">$ProductFiles&gt;2</Custom>
      <Custom Action="CopyOrderingFile"  After="InstallFinalize">NOT Installed</Custom>
      <Custom Action="ModifyConfigFile"  After="InstallFinalize">NOT Installed</Custom>
      <Custom Action="AddInstallationParamToConfigFile"  After="ModifyConfigFile">NOT Installed</Custom>
      <Custom Action="UninstallSetPro" After="MsiUnpublishAssemblies" > $ProductFiles=2</Custom>
      <Custom Action="Uninstall" After="UninstallSetPro">$ProductFiles=2</Custom>
    </InstallExecuteSequence>

EDIT-另外,我注意到的另一件事是当我运行时

Setup.exe -l LogFile.txt

我的机器上的日志命令,我可以看到安装程序 UI,但在客户端计算机上没有显示安装程序 UI。它以静默方式安装它。


编辑 2 - 我已经看到了日志文件,它们显示调用了自定义操作并且它们返回了 1。但是自定义操作中的代码没有执行,因为我在那里添加了代码以在控件到达第一行时写入日志文件自定义操作函数。这是安装程序日志的摘录,其中显示调用了自定义操作:

操作于 10:27:49 结束:WriteRegistryValues。返回值 1. MSI (s) (8C:2C) [10:27:49:161]:执行操作:InstallSetPro MSI (s) (8C:2C) [10:27:49:161]:注:1:2205 2:3:ActionText 动作 10:27:49: 安装SetPro。行动开始 10:27:49:InstallSetPro。 MSI (s) (8C:2C) [10:27:49:161]:属性更改:添加 SectionName 属性。它的 值为“安装”。操作于 10:27:49 结束:InstallSetPro。返回值 1. MSI (s) (8C:2C) [10:27:49:161]:执行操作:安装 MSI (s) (8C:2C) [10:27:49:161]:注意:1: 2205 2 : 3: ActionText 动作 10:27:49:安装。行动开始 10:27:49:安装。 MSI (s) (8C:C4) [10:27:49:208]:调用远程自定义操作。动态链接库: C:\Windows\Installer\MSI77C0.tmp,入口点:RegistryInstall MSI (s) (8C:C0) [10:27:49:317]:生成随机 cookie。 MSI (s) (8C:C0) [10:27:49:348]:使用 PID 5356 (0x14EC) 创建了自定义操作服务器。 MSI (s) (8C:34) [10:27:49:458]:作为服务运行。微星 (s) (8C:34) [10:27:49:458]:您好,我是您的 32 位模拟自定义操作 服务器。 SFXCA:将自定义操作提取到临时目录: C:\Windows\Installer\MSI77C0.tmp-\ SFXCA:绑定到 CLR 版本 v4.0.30319 调用自定义操作 Installer_CustomActions!Installer_CustomActions.CustomActions.RegistryInstall 操作于 10:27:50 结束:安装。返回值 1。

可能是我在自定义操作项目中引用的用于写入日志的 dll 导致了问题吗?

【问题讨论】:

    标签: c# wix .net-4.5 custom-action


    【解决方案1】:

    不,您不需要安装 WiX 即可运行 CA。

    我假设您的 setup.exe 是一个烧录引导程序,它正在执行 UI 并告诉您的主 MSI 静默运行。

    我还注意到,这些自定义操作都设置为在即时执行上下文中运行。这可能是一个不正确的设计。我会读:

    http://www.installsite.org/pages/en/isnews/200108/

    Custom Action in C# used via WiX fails with error 1154

    我的猜测是您的条件没有评估您的思维方式,并且自定义操作没有运行。要么,要么他们失败并吞下错误。您需要阅读您的日志文件以了解更多信息。

    【讨论】:

      【解决方案2】:

      问题在于注册表项。自定义操作无法读取注册表,因此无法正确安装。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-10-08
        • 1970-01-01
        • 1970-01-01
        • 2012-12-10
        • 1970-01-01
        • 1970-01-01
        • 2020-02-04
        • 1970-01-01
        相关资源
        最近更新 更多