我使用WiX 3.8制作了一个boostrapper应用程序,用户可以在三种不同的设置类型(工作站,客户端和服务器)之间进行选择。 使用bootstrapper-engine-method计划和相应的LaunchAction(安装,修复,卸载),安装,修复和卸载工作正常。
现在我想实现majorupgrade方法。 在UI项目(安装表面)中,我添加了一个包含以下行的新方法:
Plan(LaunchAction.UpdateReplace);
我安装了旧版本的设置,然后我启动了更新版本的设置(当然版本号更高)。 较新的设置会检测较旧的设置,并通知用户有较旧的安装,用户可以单击按钮进行升级。 当使用LaunchAction.UpdateReplace调用plan-method时,这就是重点。 但升级失败,我得到以下日志:
Burn v3.8.1128.0, Windows v6.3 (Build 9600: Service Pack 0), path: C:\experimente\Staffdirector\v4.81.1.0\ProsoftSetup.exe, cmdline: ''
Initializing string variable 'INSTALLFOLDER' to value '[ProgramFilesFolder]'
Setting string variable 'WixBundleLog' to value 'C:\Users\PATRIC~1.PRO\AppData\Local\Temp\Staffdirector_20141030102104.log'
Setting string variable 'WixBundleOriginalSource' to value 'C:\experimente\Staffdirector\v4.81.1.0\ProsoftSetup.exe'
Setting string variable 'WixBundleName' to value 'Staffdirector'
Loading managed bootstrapper application.
Creating BA thread to run asynchronously.
Detect begin, 9 packages
Registry key not found. Key = 'SOFTWARE\Microsoft\Microsoft Sync Framework\v2.0\Setup\SynchronizationX64'
Setting string variable 'Netfx4FullVersion' to value '4.5.51641'
Setting string variable 'Netfx4x64FullVersion' to value '4.5.51641'
Setting string variable 'SyncX86' to value '1'
Detected related bundle: {b7d055e3-3c85-477c-ab04-206e964536f8}, type: Upgrade, scope: PerMachine, version: 4.80.1.0, operation: MajorUpgrade
Condition 'Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)' evaluates to true.
Detected package: DotNetFramework_4_5_1, state: Present, cached: None
Detected package: WindowsInstaller45_WinXP_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_WinServer2003_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_WinServer2003_x64, state: Absent, cached: None
Detected package: WindowsInstaller45_Win6_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_Win6_x64, state: Absent, cached: None
Detected package: SynchronizationX64, state: Absent, cached: None
Detected package: SynchronizationX86, state: Absent, cached: None
Detected package: SetupPackage, state: Absent, cached: None
Detect complete, result: 0x0
Setting string variable 'IsWorkstationSetup' to value 'true'
Setting string variable 'INSTALLFOLDER' to value 'C:\Program Files (x86)'
Detect begin, 9 packages
Registry key not found. Key = 'SOFTWARE\Microsoft\Microsoft Sync Framework\v2.0\Setup\SynchronizationX64'
Setting string variable 'Netfx4FullVersion' to value '4.5.51641'
Setting string variable 'Netfx4x64FullVersion' to value '4.5.51641'
Setting string variable 'SyncX86' to value '1'
Detected related bundle: {b7d055e3-3c85-477c-ab04-206e964536f8}, type: Upgrade, scope: PerMachine, version: 4.80.1.0, operation: MajorUpgrade
RelatedBundleProductCode is {b7d055e3-3c85-477c-ab04-206e964536f8}
Condition 'Netfx4FullVersion AND (NOT VersionNT64 OR Netfx4x64FullVersion)' evaluates to true.
Detected package: DotNetFramework_4_5_1, state: Present, cached: None
Detected package: WindowsInstaller45_WinXP_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_WinServer2003_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_WinServer2003_x64, state: Absent, cached: None
Detected package: WindowsInstaller45_Win6_x86, state: Absent, cached: None
Detected package: WindowsInstaller45_Win6_x64, state: Absent, cached: None
Detected package: SynchronizationX64, state: Absent, cached: None
Detected package: SynchronizationX86, state: Absent, cached: None
Detected package: SetupPackage, state: Absent, cached: None
Detect complete, result: 0x0
Plan: method begins
Plan: Test UI.View == null is False
Plan: Do action UpdateReplace
Plan begin, 9 packages, action: UpdateReplace
OnPlanPackageBegin: method begins
OnPlanPackageBegin: PackageId =
Invalid package type.
Error 0x8000ffff: Failed to plan execute package.
Error 0x8000ffff: Failed to process update package.
Error 0x8000ffff: Failed to plan update.
OnPlanComplete: method begins
OnPlanComplete: CurrentInstallationState = DetectedOlder
OnPlanComplete: Installation failed
OnPlanComplete: CurrentInstallationState = Failed
Plan complete, result: 0x8000ffff
Shutting down, exit code: 0x0
Variable: INSTALLFOLDER = C:\Program Files (x86)
Variable: IsWorkstationSetup = true
Variable: Netfx4FullVersion = 4.5.51641
Variable: Netfx4x64FullVersion = 4.5.51641
Variable: SyncX86 = 1
Variable: VersionNT64 = 6.3.0.0
Variable: WixBundleAction = 7
Variable: WixBundleElevated = 0
在bundle本身中,我将product-id设置为星号,因此它在构建时始终创建一个新的GUID。 正如你在这里看到的那样:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Staffdirector"
Version="$(var.BuildVersion)"
Manufacturer="MyFirm"
UpgradeCode="DF43F081-B375-42EE-8139-0488254624E6"
IconSourceFile="Images\icon.ico">
<!-- Variables for the different setuptypes. These will be filled by the UI. -->
<?define IsWorkstationSetup = "true" ?>
<?define IsClientSetup = "false" ?>
<?define IsServerSetup = "false" ?>
<!-- Variable for the installerlocation. Can be filled by the UI. -->
<Variable Name="INSTALLFOLDER"
bal:Overridable="yes"
Type="string"
Value="[ProgramFilesFolder]"/>
<BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost" >
<Payload Name='BootstrapperCore.config'
SourceFile='..\..\..\Prosoft.Setup.Installer.UI\bin\Debug\BootstrapperCore.config' />
<Payload SourceFile='..\..\..\Prosoft.Setup.Installer.UI\bin\Debug\SetupInstallerUI.dll'/>
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.Docking.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.GridView.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.Input.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.Navigation.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Controls.RibbonView.dll' />
<Payload SourceFile='..\..\..\Prosoft.Setup.UI\bin\Debug\Telerik.Windows.Data.dll' />
</BootstrapperApplicationRef>
<Chain>
<!-- In this package the variable WixMbaPrereqPackageId is defined. -->
<PackageGroupRef Id='Ndp451Aiios' />
<PackageGroupRef Id='WindowsInstaller45' />
<!--<PackageGroupRef Id='Netfx4Full' />-->
<PackageGroupRef Id='SyncFramework' />
<?if $(var.IsServerSetup) = "true"?>
<PackageGroupRef Id='SqlServerExpress' />
<?endif?>
<!-- Workstation-Setup -->
<?if $(var.IsWorkstationSetup) = "true"?>
<MsiPackage Id='SetupPackage'
SourceFile='.\Resources\Setup.msi'
Permanent='no'
Cache='yes'
DisplayInternalUI='no'
Vital='yes'
Compressed='yes'
EnableFeatureSelection='no'
DisplayName='ProsoftSetup'>
<MsiProperty Name="INSTALLLOCATION"
Value="[INSTALLFOLDER]" />
</MsiPackage>
<?endif?>
<!-- TODO Client-Setup -->
<?if $(var.IsClientSetup) = "true"?>
<MsiPackage Id='SetupPackage'
SourceFile='.\Resources\Setup.msi'
Permanent='no'
Cache='yes'
DisplayInternalUI='no'
Vital='yes'
Compressed='yes'
EnableFeatureSelection='no'
DisplayName='ProsoftSetup'>
<MsiProperty Name="INSTALLLOCATION"
Value="[INSTALLFOLDER]" />
</MsiPackage>
<?endif?>
<!-- TODO Server-Setup -->
<?if $(var.IsServerSetup) = "true"?>
<MsiPackage Id='SetupPackage'
SourceFile='.\Resources\Setup.msi'
Permanent='no'
Cache='yes'
DisplayInternalUI='no'
Vital='yes'
Compressed='yes'`enter code here`
EnableFeatureSelection='no'
DisplayName='ProsoftSetup'>
<MsiProperty Name="INSTALLLOCATION"
Value="[INSTALLFOLDER]" />
</MsiPackage>
<?endif?>
</Chain>
</Bundle>
</Wix>
这是工作站(Product.wxs)的设置:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<?define Manufactor = "MyFirm"?>
<?define UpgradeGuid = "694926FB-81DD-4531-93BE-EE227859584C"?>
<Product Id="*"
Name="MyApplication"
Language="1031"
Version="$(var.BuildVersion)"
Manufacturer="$(var.Manufactor)"
UpgradeCode="$(var.UpgradeGuid)"
Codepage="UTF-8">
<Package InstallerVersion="405"
Compressed="yes"
InstallScope="perMachine"/>
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature"
Title="Prosoft.Setup.Msi"
Level="1" >
<ComponentGroupRef Id="SourceComponentGroup"/>
<ComponentRef Id="ApplicationShortcut"/>
</Feature>
<Property Id="ARPPRODUCTICON"
Value="Icon.exe"/>
<Icon Id="Icon.exe"
SourceFile="..\..\..\Bootstrapper\Images\icon.ico" />
</Product>
<Fragment Id="ClientFragment">
<!-- Here the variable from the bootstrapper will be setted into INSTALLDIR. -->
<Directory Id="TARGETDIR"
Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION"
Name="InstallLocation">
<Directory Id="CompanyFolder"
Name="prosoft">
<Directory Id="INSTALLDIR"
Name="staffdirector" />
</Directory>
</Directory>
</Directory>
<Directory Id="DesktopFolder"
Name="Desktop"/>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder"
Name="staffdirector">
<Component Id="ApplicationShortcut"
Guid="F8EE48A5-5264-4180-A35C-5CB7E8A0D58C">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="staffdirector"
Target="[INSTALLDIR]staffdirector.exe"
WorkingDirectory="ProgramFolder"
Icon="Icon.exe"/>
<Shortcut Id="StaffdirectorDesktopShortCut"
Directory="DesktopFolder"
Name="staffdirector"
Target="[INSTALLDIR]staffdirector.exe"
WorkingDirectory="InstallDirectory"
Description="Startet den staffdirector"
Icon="Icon.exe">
</Shortcut>
<RemoveFolder Id="INSTALLLOCATION"
On="uninstall"/>
<RegistryValue Root="HKCU"
Key="Software\Prosoft\staffdirector"
Name="installed"
Type="integer"
Value="1"
KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>
</Wix>
有谁能告诉我,出了什么问题? 请不要回答我,我将使用LauchAction.Install。 我做到了,结果是无限循环的installerwindows,它想要卸载应用程序。
任何帮助将不胜感激。 提前谢谢!
答案 0 :(得分:3)
正确的操作是Install
而非UpdateReplace
。 UpdateReplace
是您的捆绑包识别出捆绑包的新版本可用并希望退出并运行较新版本的时间。日志中的错误是因为您的自定义引导程序应用程序未通知引擎新版本的位置。
听起来你正在遇到this issue,这已在v3.9中修复。或者,或者您的自定义BA未正确处理静默卸载。