[英]wix 3.8 silent install - ui level 2
我想創建一個只安裝靜默的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的一個功能“工具”如下所示:
我看到兩個版本(版本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.0.0)來自Microsoft的一個功能“工具”(windows.microsoft) .com / zh-CN / 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腳本這樣的東西。 WiX不是命令式編程語言,它是一種聲明性語言。
您的主要升級失敗,因為FindRelatedProducts上的條件評估為false,這意味着它永遠不會檢測到先前MSI的ProductCode並將其作為升級的一部分刪除。
如果您真的只想要靜默安裝,為什么不從安裝程序中省略UI? 就個人而言,我不知道你為什么要這樣做而且它沒有遵循既定的最佳實踐。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.