简体   繁体   English

wix 3.8 silent install - ui level 2

[英]wix 3.8 silent install - ui level 2

I want to create a WIX Installer (3.8) that only installs silently. 我想创建一个只安装静默的WIX安装程序(3.8)。

I'm using the Wix file attached to demonstrate my issue. 我正在使用附加的Wix文件来演示我的问题。

At
UILevel=2 UILevel = 2

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

I'm setting the UI level to 2 According to: msdn.microsoft.com/en-us/library/aa372096%28v=vs.85%29.aspx then it's: " INSTALLUILEVEL_NONE 2 Completely silent installation. " 我将UI级别设置为2根据:msdn.microsoft.com/en-us/library/aa372096%28v=vs.85%29.aspx然后它是:“INSTALLUILEVEL_NONE 2完全静默安装。”

So far so good. 到现在为止还挺好。 I can install the "product" which is nothing but an empty directory. 我可以安装“产品”,它只是一个空目录。 When I set the product's version to: Version="1.1.0.0" and want to do a major upgrade everything also works fine. 当我将产品的版本设置为:Version =“1.1.0.0”并且想要进行重大升级时,一切都运行正常。 When I look at the program an feature "tool" from Microsoft as shown here: 当我查看程序时,Microsoft的一个功能“工具”如下所示:

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

I see both versions (version 1.0.0.0 and 1.1.0.0) which is not what I expected the Wix installer should do. 我看到两个版本(版本1.0.0.0和1.1.0.0),这不是我预期的Wix安装程序应该做的。

When I remove 当我删除

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

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

from the Wix script, install Version 1.0.0.0 and later after changing the wix script to 1.1.0.0 and major upgrading again, I only see 1 version (1.1.0.0) at the program an feature "tool" from Microsoft ( windows.microsoft.com/en-us/windows/uninstall-change-program#uninstall-change-program=windows-7 ) which is what I expect the windows installer should do. 从Wix脚本开始,在将wix脚本更改为1.1.0.0并再次进行主要升级之后安装版本1.0.0.0及更高版本,我只在程序中看到一个版本(1.1.0.0)来自Microsoft的一个功能“工具”(windows.microsoft) .com / zh-CN / windows / uninstall-change-program#uninstall-change-program = windows-7)这是我期望Windows安装程序应该做的。

So my question would be: What is missing or wrong at the script ( that the program an feature "tool" from Microsoft shows 2 Versions after a major upgrade ) Wix script: 所以我的问题是:脚本中缺少什么或者错误(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>

First, there's no such thing as WiX script. 首先,没有WiX脚本这样的东西。 WiX is not a imperative programming language, it's a declarative language. WiX不是命令式编程语言,它是一种声明性语言。

Your major upgrade is failing because the condition on FindRelatedProducts is evaluating to false which means it can never detect the ProductCode of the previous MSI and remove it as part of the upgrade. 您的主要升级失败,因为FindRelatedProducts上的条件评估为false,这意味着它永远不会检测到先前MSI的ProductCode并将其作为升级的一部分删除。

If you really want a silent install only, why not just omit a UI from the installer? 如果您真的只想要静默安装,为什么不从安装程序中省略UI? Personally I have no idea why you are trying to do this and it doesn't follow established best practices. 就个人而言,我不知道你为什么要这样做而且它没有遵循既定的最佳实践。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM