2016-07-06 2 views
0

私のアプリケーションのアップグレードを許可しようとしています。ユーザーが1.0.0をインストールした場合、次にバージョンをリリースするときに1.1.0を与えることができ、それをインストールすることができます。 Overwriting | removing | replacing the first versionバージョンをコントロールパネルでアンインストールするか、プログラムを変更するだけでインストールしてください。アプリケーションのアップグレードを許可する

私の問題は、次のとおりです。私は同じ製品ID *を(代わりに$(var.ProductId)」を使用して)設定されていない場合

私はこの製品の別のバージョンがすでにインストールされている

を取得します。このバージョンは続行できません のインストール...

が、私はそれが*、それは新しいバージョンをインストールするために等しいと私は2つのバージョンがインストールされている設定した場合。

私はこれをテストするために単純なwixアプリケーションを作成しました。

<?xml version="1.0" encoding="UTF-8"?> 
<?define ProductVersion="!(bind.FileVersion.MyAssemblyDll)"?> 
<?define UpgradeCode="f4d7f199-28f6-45d5-ad99-7c62938274be"?> 
<?define ProductId="{6408D956-40DA-4AEE-883E-5425F1562004}"?> 
<?define Version="1.2.0"?> 

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="$(var.ProductId)" Name="UpgradeTest" Language="1033" Version="$(var.Version)" Manufacturer="xxx" UpgradeCode="$(var.UpgradeCode)"> 
     <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 

    <!-- prevents down gradeing --> 
    <!-- one upgrade installes new version first then removes the old one. --> 
     <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallExecute"/> 
     <MediaTemplate EmbedCab="yes"/> 

     <Feature Id="ProductFeature" Title="UpgradeTest" Level="1"> 
      <ComponentGroupRef Id="ProductComponents" /> 
     </Feature> 
    </Product> 

    <Fragment> 
     <Directory Id="TARGETDIR" Name="SourceDir"> 
      <Directory Id="ProgramFilesFolder"> 
       <Directory Id="INSTALLFOLDER" Name="UpgradeTest" /> 
      </Directory> 
     </Directory> 
    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
      <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
      <Component Id="ProductComponent"> 
     <File Id="Product.wxs" Source="Product.wxs" KeyPath="yes" /> 
      </Component> 
     </ComponentGroup> 
    </Fragment> 
</Wix> 

私はこれが今、私は任意の助けをいただければ幸いにまでさかのぼる2008年にすべてのチュートリアルを使い果たしてしまった数日間仕事に取得しようとしてきました。

更新:バッド

<MajorUpgrade AllowDowngrades="no" DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="no" /> 

:コントロールパネルの2つのバージョンの結果。

アップデート2:悪い

<Upgrade Id ="$(var.ProductUpgradeCode)"> 
    <UpgradeVersion Minimum="$(var.ProductFullVersion)" OnlyDetect="yes" Property="NEWERVERSIONDETECTED"/> 
    <UpgradeVersion Maximum="$(var.ProductFullVersion)" IncludeMaximum="no" Property="OLDERVERSIONBEINGUPGRADED"/> 
</Upgrade> 


<InstallExecuteSequence> 
    <RemoveExistingProducts After="InstallValidate"/> 
</InstallExecuteSequence> 

<Condition Message="A newer version of [ProductName] is already installed. If you are sure you want to downgrade, remove the existing installation via Programs and Features.">Not NEWERVERSIONDETECTED</Condition> 

:コントロールパネルの2つのバージョンの結果。

答えて

1

私はそれがUpgradeCodeのGUIDを使用しますが*で、製品のIdを残しているやった方法。 次に、再インストールのプロパティをamusに設定して、必要な方法で製品を再インストールします。

それは一種のは、Microsoftのドキュメントhereを参照してくださいが、しかし、注意することができamusについては、この

<Product Id="*" 
     Name="YourProductName" 
     Language="1033" 
     Version="YourProductVersion" 
     Manufacturer="YourCompany" 
     UpgradeCode="{SOME-GUID}"> 

<SetProperty Id="REINSTALLMODE" Value="amus" After="FindRelatedProducts">Installed AND REMOVE&lt;&gt;"ALL"</SetProperty> 

のようになります。 aの値を使用すると、インストールされているものが新しいバージョンであっても、アプリケーションを再インストールします。しかし、あなたはあなたのインストーラに必要な文字を理解するでしょう。

+0

動作しませんでした。それは私が前に見たことがないインストールを完了するためにPCを再起動するように私に尋ねた。しかし、私はまだちょうど最新のものではなく、マシンにインストールされた2つのバージョンで終わった。 – DaImTo

0

なし(デフォルト)に設定すると、Wix website

からこの

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." AllowSameVersionUpgrades="yes" Schedule="afterInstallExecute"/> 

にご<MajorUpgrade>要素を変更し、同じバージョンの製品をインストールしてみて、コード(しかし、異なる製品をアップグレードコード)は、2つの製品としてMSIによって許可され、処理されます。yesに設定すると、WiXはmsidbUpgradeAttributesVersionMaxInclusive属性を設定します。この属性は、メジャーアップグレードと同じバージョンの製品を扱うようにMSIに指示します。

2つのインストールが無関係であるように扱われます。私はこれが奇妙な行動だと思うが、それはマイクロソフトを責める。

+0

あなたは私のアプリケーションの1つのバージョンだけが最新のものをインストールしたいと思っている部分を誤解していると思います。これは、1.0.0.0と1.2.0.0がインストールされた2つのバージョンをインストールしています。私は、私のアプリケーションの1つのバージョンがインストールされているだけです。 – DaImTo

関連する問題