WiX拡張機能のバージョン互換性問題を修正してインストーラービルドを修正する#198
Conversation
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/95c2d3ad-f5f8-49c9-84e7-a1f686ef8a80 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
|
@copilot WiX を dotnet tool で使うときの整理結論
何をどこに書けるか1. WiX 本体のバージョン
{
"version": 1,
"isRoot": true,
"tools": {
"wix": {
"version": "6.0.2",
"commands": ["wix"],
"rollForward": false
}
}
}2. WiX 拡張のバージョン
<Project Sdk="WixToolset.Sdk/6.0.2">
<ItemGroup>
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.2" />
<PackageReference Include="WixToolset.UI.wixext" Version="6.0.2" />
</ItemGroup>
</Project>おすすめ構成ローカル開発・CI 共通
実行コマンドはこれで足りる。 dotnet tool restore
dotnet build Installer.wixproj今の3行コマンドの位置づけdotnet tool restore
dotnet wix extension add -g WixToolset.Util.wixext/6.0.2
dotnet wix extension add -g WixToolset.UI.wixext/6.0.2これは CLI 直叩き前提なら妥当。 ただし、毎回拡張追加を前提にするより、
使い分けA.
|
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/c743b634-a05f-4cd1-b68c-a0db83f7dd1d Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
... 2913b71 で
これにより |
|
@copilot
|
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/f7fe7368-2bfb-4473-a230-c7d1a8eb2597 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
|
@copilot |
|
|
@copilot |
…s.Forms 参照を削除 Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/bc7d8969-4700-4345-820e-9506556f7d11 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
d4464d4 で修正しました。
|
|
@copilot 手元では以下のエラーになっている。 |
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/b129b47b-3930-4302-9b0b-1b8e8c194134 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
... c3ce1a6 で修正しました。
NU1701 警告( |
|
@copilot |
…検証エラーを修正 Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/b4cc288b-a6ba-4ae5-918c-eb64f2bbda0d Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
|
@copilot |
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/a24152a5-067b-4b53-b324-0cb926019c11 Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
|
@copilot |
Agent-Logs-Url: https://github.com/Freeesia/VdLabel/sessions/ffc37bcf-46e4-4a61-a9ea-96970089cd2a Co-authored-by: Freeesia <9002657+Freeesia@users.noreply.github.com>
WixSharp がデフォルトで WiX 拡張機能の v7.0.0-rc.2 をインストールしようとするが、WiX v6 は
wixext6フォルダ構造を期待しており非互換のためビルドが失敗していた。また、VdLabel.Wix.csprojがnet472(.NET Framework)をターゲットにしており、WixSharp_wix4が現代の .NET を必要とするため実行時エラーが発生していた。変更内容
VdLabel.Wix/VdLabel.Installer.wixproj(新規作成): WiX 拡張機能のバージョンをPackageReferenceで管理する.wixprojファイルを作成。WixToolset.Sdk/6.0.2を使用し、拡張機能を宣言VdLabel.Wix/VdLabel.Wix.csproj:TargetFrameworkをnet472からnet8.0-windowsに変更。WixSharp_wix4.binが内部でSystem.Drawing.Common(画像検証等)を使用するため-windowsサフィックスが必要。不要なSystem.Windows.Formsの明示的参照も削除VdLabel.Wix/AssemblyInfo.cs(新規作成):[assembly: InternalsVisibleTo("VdLabel.Wix.aot")]を追加。AfterInstallのラムダが生成する匿名型を WixSharp の AOT ハンドラー検証が通過できるようにするVdLabel.Wix/Program.cs:PreferredVersion設定を削除。Compiler.BuildWxs(project)でWXS生成のみを担当するように変更(プロジェクト名"VdLabel"からデフォルトでVdLabel.wxsが生成される)dotnet-desktop.yml):wix extension addコマンドを削除し、dotnet run --project VdLabel.Wix.csproj(WXS 生成)+dotnet build VdLabel.Installer.wixproj(MSI ビルド)の 2 ステップに変更これにより
dotnet-tools.json(WiX 本体)+VdLabel.Installer.wixproj(拡張機能)の構成になりました。VdLabel.wxsはビルド時に生成されるファイルのため、リポジトリには含まれません。