From dd92b21173fecf026a684b24836685473f0d8158 Mon Sep 17 00:00:00 2001 From: indigo-san Date: Sat, 30 Dec 2023 23:33:49 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Windows=E7=94=A8=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=A9=E3=83=BC=E3=82=92=E4=BD=9C=E6=88=90?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=83=93=E3=83=AB=E3=83=89=E3=82=BF=E3=82=B9?= =?UTF-8?q?=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .nuke/build.schema.json | 2 ++ nukebuild/Build.cs | 15 +++++++++ nukebuild/beutl-setup.iss | 67 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 84 insertions(+) create mode 100644 nukebuild/beutl-setup.iss diff --git a/.nuke/build.schema.json b/.nuke/build.schema.json index 3b2c5ad7f..049050be3 100644 --- a/.nuke/build.schema.json +++ b/.nuke/build.schema.json @@ -112,6 +112,7 @@ "items": { "type": "string", "enum": [ + "BuildInstaller", "Clean", "Compile", "Publish", @@ -130,6 +131,7 @@ "items": { "type": "string", "enum": [ + "BuildInstaller", "Clean", "Compile", "Publish", diff --git a/nukebuild/Build.cs b/nukebuild/Build.cs index 20418ea61..ccd6da586 100644 --- a/nukebuild/Build.cs +++ b/nukebuild/Build.cs @@ -6,9 +6,11 @@ using System.Text; using System.Xml.Linq; +using static Nuke.Common.Tools.InnoSetup.InnoSetupTasks; using Nuke.Common.Tools.NerdbankGitVersioning; using Serilog; +using Nuke.Common.Tools.InnoSetup; partial class Build : NukeBuild { @@ -154,6 +156,19 @@ partial class Build : NukeBuild mainOutput.CompressTo(ArtifactsDirectory / fileName.ToString()); }); + Target BuildInstaller => _ => _ + .DependsOn(Publish) + .Executes(() => + { + InnoSetup(c => c + .SetKeyValueDefinition("MyAppVersion", NerdbankVersioning.AssemblyFileVersion) + .SetKeyValueDefinition("MyOutputDir", ArtifactsDirectory) + .SetKeyValueDefinition("MyLicenseFile", RootDirectory / "LICENSE") + .SetKeyValueDefinition("MySetupIconFile", RootDirectory / "assets/logos/logo.ico") + .SetKeyValueDefinition("MySource", OutputDirectory / "Beutl") + .SetScriptFile(RootDirectory / "nukebuild/beutl-setup.iss")); + }); + bool IsSupportedRid(DotNetRuntimeIdentifier rid) { return rid == DotNetRuntimeIdentifier.linux_x64 diff --git a/nukebuild/beutl-setup.iss b/nukebuild/beutl-setup.iss new file mode 100644 index 000000000..c108d769e --- /dev/null +++ b/nukebuild/beutl-setup.iss @@ -0,0 +1,67 @@ +; Script generated by the Inno Setup Script Wizard. +; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! + +#define MyAppName "Beutl" +; #define MyAppVersion "1.0.0" +; #define MyOutputDir D:\Source\b-editor\beutl-builds\inno-output +; #define MyLicenseFile D:\Source\b-editor\beutl\LICENSE +; #define MySetupIconFile :\Source\b-editor\beutl\src\Beutl\Assets\logo.ico +; #define MySource D:\Source\b-editor\beutl-builds\beutl-win-x64-main-1.0.0-preview.3 +#define MyAppPublisher "b-editor" +#define MyAppURL "https://beutl.beditor.net" +#define MyAppExeName "Beutl.exe" +#define MyAppAssocName MyAppName + " Project File" +#define MyAppAssocExt ".bep" +#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt + +[Setup] +; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications. +; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) +AppId={{5312CE8C-3104-4305-B72F-56D652FA76F6} +AppName={#MyAppName} +AppVersion={#MyAppVersion} +;AppVerName={#MyAppName} {#MyAppVersion} +AppPublisher={#MyAppPublisher} +AppPublisherURL={#MyAppURL} +AppSupportURL={#MyAppURL} +AppUpdatesURL={#MyAppURL} +DefaultDirName={autopf}\{#MyAppName} +ChangesAssociations=yes +DisableProgramGroupPage=yes +LicenseFile={#MyLicenseFile} +; Uncomment the following line to run in non administrative install mode (install for current user only.) +;PrivilegesRequired=lowest +PrivilegesRequiredOverridesAllowed=dialog +OutputDir={#MyOutputDir} +OutputBaseFilename=beutl-setup +SetupIconFile={#MySetupIconFile} +Compression=lzma +SolidCompression=yes +WizardStyle=modern + +[Languages] +Name: "english"; MessagesFile: "compiler:Default.isl" +Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl" + +[Tasks] +Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked + +[Files] +Source: "{#MySource}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion +Source: "{#MySource}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs +; NOTE: Don't use "Flags: ignoreversion" on any shared system files + +[Registry] +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0" +Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1""" +Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: ".myp"; ValueData: "" + +[Icons] +Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" +Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon + +[Run] +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent + From b60719bade0ae8b467d99949d4df7795f51faeb9 Mon Sep 17 00:00:00 2001 From: indigo-san Date: Sun, 31 Dec 2023 00:05:53 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=E3=83=AA=E3=83=AA=E3=83=BC=E3=82=B9?= =?UTF-8?q?=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD=E3=83=BC=E3=81=A7?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E3=82=B9=E3=83=88=E3=83=BC=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=82=92=E4=BD=9C=E6=88=90=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 37 ++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9612c1e5..953753989 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,6 +52,41 @@ jobs: name: beutl-${{matrix.rid}}-${{needs.determine-version.outputs.semVer}} path: ./artifacts/*.zip + build-windows-installer: + needs: [determine-version, build-executable] + runs-on: windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + global-json-file: global.json + + - uses: actions/download-artifact@v3 + with: + name: beutl-win_x64-${{needs.determine-version.outputs.semVer}} + path: artifacts + + - name: Extract zip + run: | + mkdir output/Beutl + cd output/Beutl + 7z x ../../artifacts/beutl-win-x64-${{needs.determine-version.outputs.semVer}}.zip + + - name: Build installer + run: ./build.cmd BuildInstaller --skip Publish + + - name: Save installer + uses: actions/upload-artifact@v3 + with: + name: beutl-setup + path: ./artifacts/beutl-setup.exe + build-nuget: needs: [determine-version] runs-on: windows-latest @@ -90,7 +125,7 @@ jobs: - uses: ncipollo/release-action@v1 id: create_release with: - artifacts: "artifacts/**/*.zip,artifacts/**/*.nupkg" + artifacts: "artifacts/**/*.zip,artifacts/**/*.nupkg,artifacts/beutl-setup.exe" draft: true makeLatest: true generateReleaseNotes: true