From 04a88225c319c5584eaa82c4e92df431b60777fa Mon Sep 17 00:00:00 2001 From: IhateTrains Date: Sat, 14 Sep 2024 19:16:29 +0100 Subject: [PATCH] Windows: install the required .NET runtime during the installation process instead of including the runtime twice in the release (#2184) #minor --- .github/workflows/create_release.yml | 1 + .gitmodules | 4 ++++ ImperatorToCK3.iss | 15 +++++++++++++++ .../Properties/PublishProfiles/win-x64.pubxml | 3 +-- InnoDependencyInstaller | 1 + 5 files changed, 22 insertions(+), 2 deletions(-) create mode 160000 InnoDependencyInstaller diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index d0dc1ca02..7d487e49e 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -77,6 +77,7 @@ jobs: with: fronter_dir: 'Fronter.NET' release_dir: 'Publish' + self_contained: ${{ matrix.build != 'win-x64' }} # InnoSetup takes care of installing the .NET runtime on Windows. build_updater: ${{ matrix.build != 'win-x64' }} # Windows release uses InnoSetup instead. env: BACKBLAZE_KEY_ID: ${{ secrets.BACKBLAZE_KEY_ID }} diff --git a/.gitmodules b/.gitmodules index 4617256ce..d90effa83 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,7 @@ path = Fronter.NET url = https://github.com/ParadoxGameConverters/Fronter.NET +[submodule "InnoDependencyInstaller"] + path = InnoDependencyInstaller + url = https://github.com/IhateTrains/InnoDependencyInstaller.git + branch = NET-9 diff --git a/ImperatorToCK3.iss b/ImperatorToCK3.iss index 283239b26..d5625fe6a 100644 --- a/ImperatorToCK3.iss +++ b/ImperatorToCK3.iss @@ -1,6 +1,11 @@ ; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define public Dependency_Path_NetCoreCheck "InnoDependencyInstaller\dependencies\" + +#include "InnoDependencyInstaller\CodeDependencies.iss" + #define MyAppName "ImperatorToCK3 Converter" #define MyAppPublisher "Paradox Game Converters Group" #define MyAppURL "https://paradoxgameconverters.com/" @@ -28,6 +33,8 @@ Compression=lzma SolidCompression=yes WizardStyle=modern +ArchitecturesInstallIn64BitMode=x64 + [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" @@ -45,3 +52,11 @@ Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\ConverterFrontend.exe"; Ic [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent runascurrentuser +[Code] +function InitializeSetup: Boolean; +begin + // Install .NET 9 runtime if it is not already installed. + Dependency_AddDotNet90; + + Result := True; +end; \ No newline at end of file diff --git a/ImperatorToCK3/Properties/PublishProfiles/win-x64.pubxml b/ImperatorToCK3/Properties/PublishProfiles/win-x64.pubxml index 2316253b3..5ac217b02 100644 --- a/ImperatorToCK3/Properties/PublishProfiles/win-x64.pubxml +++ b/ImperatorToCK3/Properties/PublishProfiles/win-x64.pubxml @@ -10,11 +10,10 @@ https://go.microsoft.com/fwlink/?LinkID=208121. FileSystem net9.0 win-x64 - true + false true false True - true true \ No newline at end of file diff --git a/InnoDependencyInstaller b/InnoDependencyInstaller new file mode 160000 index 000000000..b2bcb5ebe --- /dev/null +++ b/InnoDependencyInstaller @@ -0,0 +1 @@ +Subproject commit b2bcb5ebe8e0c92dad7d53fcb6ee716f993bf2f9