diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index aa93bda..465faca 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "wix": { - "version": "6.0.2", + "version": "7.0.0", "commands": [ "wix" ], diff --git a/.github/workflows/dotnet-desktop.yml b/.github/workflows/dotnet-desktop.yml index 4f8ecaa..d1cc3f0 100644 --- a/.github/workflows/dotnet-desktop.yml +++ b/.github/workflows/dotnet-desktop.yml @@ -63,7 +63,7 @@ jobs: - uses: actions/cache@v5 with: path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.wixproj') }} #hash of project files restore-keys: | ${{ runner.os }}-nuget- - uses: actions/setup-dotnet@v5 @@ -123,7 +123,7 @@ jobs: - uses: actions/cache@v5 with: path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} #hash of project files + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.wixproj') }} #hash of project files restore-keys: | ${{ runner.os }}-nuget- - uses: actions/setup-dotnet@v5 @@ -140,7 +140,8 @@ jobs: name: licenses - run: | dotnet tool restore - dotnet run -c Release + dotnet run --project VdLabel.Wix.csproj -c Release + dotnet build VdLabel.Installer.wixproj -p:OutputName=VdLabel-${{ needs.build.outputs.version }} working-directory: VdLabel.Wix - uses: actions/upload-artifact@v7 with: diff --git a/.gitignore b/.gitignore index 7a180e0..f382619 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,9 @@ project.lock.json project.fragment.lock.json artifacts/ +# WixSharp の自動生成 WXS ファイル +VdLabel.Wix/generated/ + # ASP.NET Scaffolding ScaffoldingReadMe.txt diff --git a/VdLabel.Wix/Program.cs b/VdLabel.Wix/Program.cs index 6ecd0fb..17977cf 100644 --- a/VdLabel.Wix/Program.cs +++ b/VdLabel.Wix/Program.cs @@ -6,7 +6,6 @@ const string Manufacturer = "StudioFreesia"; const string App = "VdLabel"; const string ArtifactsDir = @"..\artifacts"; -const string PublishDir = @"..\publish"; const string Executable = $"{App}.exe"; var exePath = Path.Combine(Environment.CurrentDirectory, ArtifactsDir, Executable); @@ -24,7 +23,6 @@ project.RebootSupressing = RebootSupressing.Suppress; project.GUID = new("FE947636-81DB-4819-A5D9-939125903F4C"); project.Platform = Platform.x64; -project.Language = "ja-JP"; project.Version = new(version); // コントロールパネルの情報を設定 @@ -36,9 +34,7 @@ UrlUpdateInfo = "https://github.com/Freeesia/VdLabel/releases", }; -// どっちか片方しか設定できない -//project.MajorUpgrade = MajorUpgrade.Default; -project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default; +project.MajorUpgrade = MajorUpgrade.Default; project.BackgroundImage = @"..\assets\installer_back.png"; project.ValidateBackgroundImage = false; @@ -60,4 +56,7 @@ } }; -project.BuildMsi(Path.Combine(PublishDir, $"{App}-{version}.msi")); +// WXS ファイルを generated/ フォルダに生成する(MSI のビルドは VdLabel.Installer.wixproj で行う) +// generated/ は .gitignore で除外されているため、生成物がリポジトリに混入しない +project.OutDir = "generated"; +Compiler.BuildWxs(project); diff --git a/VdLabel.Wix/VdLabel.Installer.wixproj b/VdLabel.Wix/VdLabel.Installer.wixproj new file mode 100644 index 0000000..5a62cee --- /dev/null +++ b/VdLabel.Wix/VdLabel.Installer.wixproj @@ -0,0 +1,24 @@ + + + + $(MSBuildProjectDirectory)\..\publish\ + wix7 + x64 + + ja-JP + + true + + + + + + + + + + + + + + diff --git a/VdLabel.Wix/VdLabel.Wix.csproj b/VdLabel.Wix/VdLabel.Wix.csproj index 2ac7582..a799479 100644 --- a/VdLabel.Wix/VdLabel.Wix.csproj +++ b/VdLabel.Wix/VdLabel.Wix.csproj @@ -2,8 +2,8 @@ Exe - VdLavel.Wix - net472 + VdLabel.Wix + net48 latest @@ -14,7 +14,7 @@ - +