From 3e3a4ca2ffb13e1b41e5cb5d69ef50ad91bcd7fc Mon Sep 17 00:00:00 2001
From: Michael Suchacz <203725896+ibetitsmike@users.noreply.github.com>
Date: Thu, 29 May 2025 15:48:38 +0200
Subject: [PATCH 1/3] feat: added icon to installer's bootstrap application
---
Installer/Program.cs | 19 +++++
scripts/Publish.ps1 | 1 +
scripts/files/RtfThemeLarge.xml | 119 ++++++++++++++++++++++++++++++++
3 files changed, 139 insertions(+)
create mode 100644 scripts/files/RtfThemeLarge.xml
diff --git a/Installer/Program.cs b/Installer/Program.cs
index 10a09a7..6ba90db 100644
--- a/Installer/Program.cs
+++ b/Installer/Program.cs
@@ -119,6 +119,9 @@ public class BootstrapperOptions : SharedOptions
[Option('w', "windows-app-sdk-path", Required = true, HelpText = "Path to the Windows App Sdk package to embed")]
public string WindowsAppSdkPath { get; set; }
+ [Option('t', "theme-xml-path", Required = false, HelpText = "Path to the theme .xml file to use for the installer")]
+ public string ThemeXmlPath { get; set; }
+
public new void Validate()
{
base.Validate();
@@ -130,6 +133,8 @@ public class BootstrapperOptions : SharedOptions
if (!SystemFile.Exists(WindowsAppSdkPath))
throw new ArgumentException($"Windows App Sdk package not found at '{WindowsAppSdkPath}'",
nameof(WindowsAppSdkPath));
+ if (ThemeXmlPath != null && !SystemFile.Exists(ThemeXmlPath))
+ throw new ArgumentException($"Theme XML file not found at '{ThemeXmlPath}'", nameof(ThemeXmlPath));
}
}
@@ -415,6 +420,20 @@ private static int BuildBundle(BootstrapperOptions opts)
bundle.Application.LicensePath = opts.LicenseFile;
bundle.Application.LogoFile = opts.LogoPng;
+ if (opts.ThemeXmlPath != null)
+ {
+ bundle.Application.ThemeFile = opts.ThemeXmlPath;
+ bundle.Application.Payloads =
+ [
+ new ExePackagePayload
+ {
+ Name = "icon.ico",
+ SourceFile = opts.IconFile,
+ Compressed = true,
+ },
+ ];
+ }
+
// Set the default install folder, which will eventually be passed into
// the MSI.
bundle.Variables =
diff --git a/scripts/Publish.ps1 b/scripts/Publish.ps1
index 4390dfa..ee86980 100644
--- a/scripts/Publish.ps1
+++ b/scripts/Publish.ps1
@@ -189,6 +189,7 @@ $windowsAppSdkPath = Join-Path $scriptRoot "files\windows-app-sdk-$($arch).exe"
--icon-file "App\coder.ico" `
--msi-path $msiOutputPath `
--windows-app-sdk-path $windowsAppSdkPath `
+ --theme-xml-path "scripts\files\RtfThemeLarge.xml" `
--logo-png "scripts\files\logo.png"
if ($LASTEXITCODE -ne 0) { throw "Failed to build bootstrapper" }
diff --git a/scripts/files/RtfThemeLarge.xml b/scripts/files/RtfThemeLarge.xml
new file mode 100644
index 0000000..2ab227d
--- /dev/null
+++ b/scripts/files/RtfThemeLarge.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: