【问题标题】:wix 3.8 silent install - ui level 2wix 3.8 静默安装 - ui 级别 2
【发布时间】:2015-04-17 02:19:05
【问题描述】:

我想创建一个只静默安装的 WIX 安装程序 (3.8)。

我正在使用随附的 Wix 文件来演示我的问题。


UILevel=2

<InstallExecuteSequence>      
  <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
</InstallExecuteSequence>

我将 UI 级别设置为 2 根据: msdn.microsoft.com/en-us/library/aa372096%28v=vs.85%29.aspx 然后是: " INSTALLUILEVEL_NONE 2 完全静默安装。 "

到目前为止一切顺利。我可以安装只是一个空目录的“产品”。 当我将产品的版本设置为: Version="1.1.0.0" 并想要进行重大升级时,一切都正常。 当我查看该程序时,Microsoft 提供了一个功能“工具” 如图所示:

http://windows.microsoft.com/en-us/windows/uninstall-change-program#uninstall-change-program=windows-7

我看到两个版本(版本 1.0.0.0 和 1.1.0.0),这不是我期望 Wix 安装程序应该做的。

当我删除时

<InstallUISequence>      
  <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>                   
</InstallUISequence>

<InstallExecuteSequence>      
    <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
</InstallExecuteSequence>

从 Wix 脚本,将 wix 脚本更改为 1.1.0.0 后安装 1.0.0.0 及更高版本 并再次进行重大升级, 我在程序中只看到 1 个版本 (1.1.0.0) 是 Microsoft 的功能“工具” (windows.microsoft.com/en-us/windows/uninstall-change-program#uninstall-change-program=windows-7) 这是我期望 Windows 安装程序应该做的。

所以我的问题是: 脚本中缺少或错误的内容 (该程序是 Microsoft 的功能“工具”在重大升级后显示 2 个版本) Wix 脚本:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.1.0.0" Manufacturer="asdf" UpgradeCode="BE170BF6-0C06-4A50-B81B-CDF6609FAD5A">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perUser" InstallPrivileges="limited" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize" />
    <MediaTemplate />

    <InstallUISequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>                   
    </InstallUISequence>

    <InstallExecuteSequence>      
        <FindRelatedProducts Before="LaunchConditions">UILevel=2</FindRelatedProducts>      
    </InstallExecuteSequence>       

    <Feature Id="ProductFeature" Title="SetupProject1" Level="1">
        <ComponentGroupRef Id="ProductComponents" />
    </Feature>
</Product>

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="LocalAppDataFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
    <Component Id="test" Guid="D6527568-4C76-493B-AF1F-9E973723E773"
      SharedDllRefCount="no" KeyPath="no" NeverOverwrite="no" Permanent="no" Transitive="no"
      Win64="no" Location="either">
      <CreateFolder/>
      <RemoveFolder Id="ProductComponents" On="uninstall"/>
      <RegistryValue Root="HKCU" Key="Software\MyFantasyCompany\MyApplicationName" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
    </Component>
    </ComponentGroup>
</Fragment>
</Wix>

【问题讨论】:

    标签: wix silent wix3.8 silent-installer


    【解决方案1】:

    首先,没有 WiX 脚本之类的东西。 WiX 不是一种命令式编程语言,它是一种声明性语言。

    您的主要升级失败,因为 FindRelatedProducts 上的条件评估为 false,这意味着它永远无法检测到先前 MSI 的 ProductCode 并将其作为升级的一部分删除。

    如果您真的只想要静默安装,为什么不从安装程序中省略 UI?就我个人而言,我不知道你为什么要这样做,而且它没有遵循既定的最佳实践。

    【讨论】:

    • 您好克里斯托弗,感谢您的回答。我只想部署一个 msi 包,如下所述:advancedinstaller.com/user-guide/tutorial-gpo.html 而不是“ UILevel=2UILevel=2 " 我会尝试使用这个:" " 问候 Alex B.
    • 我也有同样的要求。客户有一个带 UI 的工作 MSI。通过最少的代码更改,我想禁用/抑制/隐藏 UI。可能吗?请帮忙。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多