首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WiX捆绑包的主升级包类型无效

WiX捆绑包的主升级包类型无效
EN

Stack Overflow用户
提问于 2014-10-30 18:07:22
回答 1查看 487关注 0票数 0

我已经用WiX 3.8制作了一个boostrapper应用程序,用户可以在三种不同的设置类型(工作站、客户端和服务器)之间进行选择。安装、修复和卸载在bootstrapper-engine-method Plan和适当的LaunchAction (安装、修复、卸载)中运行良好。

现在我想实现want majorupgrade method。在UI-project (用于安装的图面)中,我添加了一个新方法,其中包含以下行:

代码语言:javascript
复制
    Plan(LaunchAction.UpdateReplace);

我安装了一个较旧版本的安装程序,然后启动了一个较新版本的安装程序(当然还有更高的版本号)。较新的安装程序会检测较旧的安装程序,并通知用户有较旧的安装程序,用户可以单击按钮进行升级。这就是使用LaunchAction.UpdateReplace调用计划方法的关键所在。但是升级失败了,我得到了以下日志:

代码语言:javascript
复制
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

在包本身中,我将product-id设置为星号,因此它在构建时总是创建一个新的GUID。正如你在这里看到的:

代码语言:javascript
复制
<?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)的设置:

代码语言:javascript
复制
<?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,他们想要卸载应用程序。

任何帮助都将不胜感激。提前感谢!

EN

回答 1

Stack Overflow用户

发布于 2014-10-31 08:00:29

正确的操作是Install而不是UpdateReplace。当您的捆绑包识别到有新版本的捆绑包可用,并希望退出并让新版本运行时,称为UpdateReplace。日志中的错误是因为您的自定义引导程序应用程序没有通知引擎新版本在哪里。

听起来你遇到了this issue,它已经在3.9版本中修复了。或者,或者您的自定义BA没有正确处理静默卸载。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26650144

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档