私は、独自の WiX インストーラーを持つ関連アプリケーションのスイートに取り組んでいます。ご想像のとおり、これらのインストーラーには多くの重複があり、私はそれについて何かをしようとしています。この目的のために、いくつかの.wxsファイルを含む WiX ライブラリ プロジェクトを作成し、これらのファイルにできるだけ多くのコードを押し込もうとしました.wxs。これまでのところ、これはほとんど問題なく機能しています。.wxsただし、要素に移動できないように見えることが 1 つありUpgradeます。
これは私のアップグレードコードです:
<Upgrade Id="MY-UPGRADE-CODE-GUID">
<!-- If an older version is found replace it -->
<UpgradeVersion OnlyDetect="no" Property="OLDERFOUND"
Maximum="$(var.ProductVersion)" IncludeMaximum="no"/>
<!-- If the same version is found do nothing (OnlyDetect) -->
<UpgradeVersion OnlyDetect="yes" Property="SELFFOUND"
Minimum="$(var.ProductVersion)" IncludeMinimum="yes"
Maximum="$(var.ProductVersion)" IncludeMaximum="yes"/>
<!-- If a newer version is found do nothing (OnlyDetect) -->
<UpgradeVersion OnlyDetect="yes" Property="NEWERFOUND"
Minimum="$(var.ProductVersion)" IncludeMinimum="no"/>
</Upgrade>
<CustomAction Id="AlreadyUpdated" Error="This version of !(wix.Param.Upgrade.ProductName) is already installed. You will have to uninstall it manually before this installer can continue."/>
<CustomAction Id="NoDowngrade" Error="A newer version of !(wix.Param.Upgrade.ProductName) is already installed. You will have to uninstall that version manually before this installer can continue."/>
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize"/>
<!-- If the same version is found execute AlreadyUpdated -->
<Custom Action="AlreadyUpdated" After="FindRelatedProducts">SELFFOUND</Custom>
<!-- If a newer version is found execute NoDowngrade -->
<Custom Action="NoDowngrade" After="FindRelatedProducts">NEWERFOUND</Custom>
</InstallExecuteSequence>
にはUpgrade/@Id、 と同じ値を使用しProduct/@UpgradeCodeます。(それが必要なのか、それとも良い習慣なのかはわかりません。)いつかそれを入れたいと思っていWixVariableますが、今のところ、文字通りのGUIDで機能させようとしています。
CustomActions と theは既にファイル内InstallExecuteSequenceの aFragmentに移動してい.wxsます。ProductName を含むように を定義したWixVariableので、各アプリのインストーラーに独自の名前を表示させることができます。これはまさに私が望んで期待どおりに機能します。
ただし、Upgrade要素をに移動するとFragment(アプリのProduct.wxsファイルにあるか、ライブラリ ファイルの 1 つにあるかは.wxs関係ありません。発生する:FragmentInstallExecuteSequence
- 最初に古いバージョンのインストーラーを実行し、次に新しいインストーラーを
Upgrade別の に移動するFragmentと、同一Product/@Versionの ,Product@/UpgradeCode, とUpgrade/@Id, 同じ製品が 2 回インストールされてしまいます。 - 新しいインストーラーを 2 回インストールすると、2 回目はインストールされませんが (これが私の望みです)、エラー メッセージも表示されません。
MajorUpgrade1)同じバージョンが再度インストールされたときにエラーメッセージを表示したくないようであり、さらに重要なことに、2)内部では許可されていないという事実がなければ、すべてを a に置き換えますFragmentなんらかの理由で、私はまだ重複に悩まされています(以前よりもはるかに少ないですが).
では、現在の機能を失うことなくUpgrade要素をライブラリに移動するにはどうすればよいでしょうか? .wxs私は何を間違っていますか?