我用WiX 3.8製作了一個boostrapper應用程序,用戶可以在三種不同的設置類型(工作站,客戶端和服務器)之間進行選擇。 使用引導程序引擎方法計劃和相應的LaunchAction(安裝,修復,卸載),安裝,修復和卸載工作良好。WiX軟件包mainupgrade上的軟件包類型無效
現在我想實現mainupgrade-method。 在UI項目(表面安裝)我添加包含以下行的一個新方法:
Plan(LaunchAction.UpdateReplace);
我安裝我安裝的是舊版本,然後我開始安裝的新版本(帶當然版本號更高)。 較新的安裝程序會檢測較舊的安裝程序並通知用戶該安裝較舊,並且用戶可以單擊按鈕將其升級。 這就是要點,當計劃方法將與LaunchAction.UpdateReplace調用。 但升級失敗,我也得到了以下日誌:
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
在束本身我設置好的產品-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循環,它想卸載應用程序。
任何幫助,將不勝感激。 在此先感謝!