Wix 升级版本 [英] Wix UpgradeVersion

查看:34
本文介绍了Wix 升级版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 https://www.firegiant.com/wix/tutorial/upgrades-and-modularization/checking-for-oldies/.

<?xml version='1.0' encoding='Windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
  <Product Name='Foobar 1.0.1' Manufacturer='Acme Ltd.'
      Id='027F68D8-1963-4C76-8274-7091232BB4F4'
      UpgradeCode='6768C9D3-52DF-4E7E-A8C3-F9CB9F29EA91'
      Language='1033' Codepage='1252' Version='1.0.1' >
    <Package Id='*' Keywords='Installer' Description="Acme's Foobar 1.0.1 Installer"
        Comments='Foobar is a registered trademark of Acme Ltd.' Manufacturer='Acme Ltd.'
        InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' />

    <UI Id="MyWixUI_Mondo">
      <UIRef Id="WixUI_Mondo" />
      <UIRef Id="WixUI_ErrorProgressText" />

      <DialogRef Id="UserRegistrationDlg" />

      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="UserRegistrationDlg" Order="3">LicenseAccepted = "1"</Publish>
      <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="UserRegistrationDlg">1</Publish>
    </UI>

    <Upgrade Id='10A11EA3-8A34-46A1-87D9-679C944E305C'>
      <UpgradeVersion OnlyDetect='yes' Property='SELFFOUND'
          Minimum='1.0.1' IncludeMinimum='yes'
          Maximum='1.0.1' IncludeMaximum='yes' />
      <UpgradeVersion OnlyDetect='yes' Property='NEWERFOUND'
          Minimum='1.0.1' IncludeMinimum='no' />
    </Upgrade>


    <Property Id="INSTALLDIR">
      <RegistrySearch Id='AcmeFoobarRegistry' Type='raw' Root='HKLM' Key='Software\Acme\Foobar 1.0' Name='InstallDir' />
    </Property>
    <Property Id="FILEB1EXISTS">
      <DirectorySearch Id="CheckFileDir" Path="[INSTALLDIR]" Depth="0">
        <FileSearch Id="CheckFile" Name="B1.txt" />
      </DirectorySearch>
    </Property>
    <Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />



    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
    <Property Id='DiskPrompt' Value="Acme's Foobar 1.0 Installation [1]" />

    <Directory Id='TARGETDIR' Name='SourceDir'>
      <Directory Id='ProgramFilesFolder' Name='PFiles'>
        <Directory Id='Acme' Name='Acme'>
          <Directory Id='INSTALLFOLDER' Name='Foobar 1.0'>
            <Component Id='MainExecutable' Guid='9805D06F-DF58-4FF5-A9E9-74B11C794D7A'>

              <File Id='FoobarEXE' Name='FoobarAppl10.exe' DiskId='1' Source='FoobarAppl10.exe' KeyPath='yes'>
                <Shortcut Id="startmenuFoobar10" Directory="ProgramMenuDir" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
                <Shortcut Id="desktopFoobar10" Directory="DesktopFolder" Name="Foobar 1.0" WorkingDirectory='INSTALLDIR' Icon="Foobar10.exe" IconIndex="0" Advertise="yes" />
              </File>
              <RemoveFile Id='LogFile' On='uninstall' Name='Foobar10User.log' />
            </Component>
            <Component Id='HelperLibrary' Guid='5AE6F8C7-AEC7-43A0-B4D8-1178D7FC7C3A'>
              <File Id='HelperDLL' Name='Helper.dll' DiskId='1' Source='Helper.dll' KeyPath='yes' />
            </Component>

            <Component Id='Manual' Guid='0AC1B698-822E-4B56-8D78-42DDF84D8667'>
              <File Id='Manual' Name='Manual.pdf' DiskId='1' Source='Manual.pdf' KeyPath='yes'>
                <Shortcut Id='startmenuManual' Directory='ProgramMenuDir' Name='Instruction Manual' Advertise='yes' />
              </File>
            </Component>
          </Directory>
        </Directory>
        </Directory>
      <Directory Id="ProgramMenuFolder" Name="Programs">
        <Directory Id="ProgramMenuDir" Name="Foobar 1.0">
          <Component Id="ProgramMenuDir" Guid="B36BF023-6797-476B-BAAD-4AFD5CCE7A9A">
            <RemoveFolder Id='ProgramMenuDir' On='uninstall' />
            <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' />
          </Component>
        </Directory>
      </Directory>

      <Directory Id="DesktopFolder" Name="Desktop" />
    </Directory>



    <Feature Id='Complete' Level='1'>
      <Feature Id='MainProgram' Level='1'>
        <ComponentRef Id='MainExecutable' />
        <ComponentRef Id='HelperLibrary' />
        <ComponentRef Id='ProgramMenuDir' />
      </Feature>

      <Feature Id='Documentation' Level='1'>
        <ComponentRef Id='Manual' />
        <Condition Level="0">NOT FILEB1EXISTS</Condition>
      </Feature>
    </Feature>

    <Icon Id="Foobar10.exe" SourceFile="FoobarAppl10.exe" />

    <Property Id='NOTEPAD'>Notepad.exe</Property>
    <!--<CustomAction Id='LaunchFile' Property='NOTEPAD' ExeCommand='[SourceDir]Readme.txt' Return='asyncNoWait' />



    <InstallExecuteSequence>
      <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom>
      <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
      <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
    </InstallExecuteSequence>-->
    <CustomAction Id='LaunchFile' Property='NOTEPAD' ExeCommand='[SourceDir]Readme.txt' Return='asyncNoWait' />


    <CustomAction Id='AlreadyUpdated' Error='Foobar 1.0 has already been updated to 1.0.1 or newer.' />
    <CustomAction Id='NoDowngrade' Error='A later version of [ProductName] is already installed.' />

    <InstallExecuteSequence>
      <Custom Action='AlreadyUpdated' After='FindRelatedProducts'>SELFFOUND</Custom>
      <Custom Action='NoDowngrade' After='FindRelatedProducts'>NEWERFOUND</Custom>
    </InstallExecuteSequence>




  </Product>
</Wix>

我的问题是 SELFFOUNDNEWERFOUND 从未设置为 true,因此我从未达到查看消息 AlreadyUpdated 的条件不降级

My problem is SELFFOUND and NEWERFOUND never set to true, thus I never reach the condition to see the message AlreadyUpdated or NoDowngrade

FindRelatedProduct"在详细模式下的结果:MSI (c) (C0:F8) [08:43:46:624]:采取行动:FindRelatedProducts操作 08:43:46:查找相关产品.搜索相关应用行动开始 08:43:46:FindRelatedProducts.操作结束 08:43:46:FindRelatedProducts.返回值 1.

Result of "FindRelatedProduct" in verbose mode : MSI (c) (C0:F8) [08:43:46:624]: Doing action: FindRelatedProducts Action 08:43:46: FindRelatedProducts. Searching for related applications Action start 08:43:46: FindRelatedProducts. Action ended 08:43:46: FindRelatedProducts. Return value 1.

MSI (s) (04:60) [08:43:55:263]:执行操作:FindRelatedProducts操作 08:43:55:查找相关产品.搜索相关应用行动开始 08:43:55:FindRelatedProducts.MSI (s) (04:60) [08:43:55:263]:跳过 FindRelatedProducts 操作:已在客户端完成操作结束 08:43:55:FindRelatedProducts.返回值 0.MSI (s) (04:60) [08:43:55:263]:跳过动作:AlreadyUpdated(条件为假)MSI (s) (04:60) [08:43:55:263]:跳过动作:NoDowngrade(条件为假)

MSI (s) (04:60) [08:43:55:263]: Doing action: FindRelatedProducts Action 08:43:55: FindRelatedProducts. Searching for related applications Action start 08:43:55: FindRelatedProducts. MSI (s) (04:60) [08:43:55:263]: Skipping FindRelatedProducts action: already done on client side Action ended 08:43:55: FindRelatedProducts. Return value 0. MSI (s) (04:60) [08:43:55:263]: Skipping action: AlreadyUpdated (condition is false) MSI (s) (04:60) [08:43:55:263]: Skipping action: NoDowngrade (condition is false)

推荐答案

请注意,您的 Upgrade 元素 ID 未设置为您的 UpgradeCode GUID.

Note that your Upgrade element Id is not set to your UpgradeCode GUID.

来自检查老歌:

The Id attribute of the Upgrade tag refers back to the UpgradeCode GUID of the original installation package

这篇关于Wix 升级版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆