Skip to content
This repository was archived by the owner on May 5, 2026. It is now read-only.

Commit 513cb84

Browse files
Refine build workflow and installer script
Streamlined the GitHub Actions workflow by cleaning up comments, improving version extraction, and correcting LICENSE file handling. Updated the Inno Setup installer script to simplify output paths, improve task descriptions, add an option to register as a Windows service, and clean up file and registry sections for clarity and maintainability.
1 parent f0673f0 commit 513cb84

2 files changed

Lines changed: 26 additions & 47 deletions

File tree

.github/workflows/Build-Intrudex-Client.yaml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- name: 📥 Install MinGW
2424
run: choco install mingw -y
2525

26-
# Install Inno Setup
2726
- name: 📥 Install Inno Setup
2827
run: choco install innosetup -y
2928

@@ -40,38 +39,35 @@ jobs:
4039
gcc --version
4140
g++ --version
4241
42+
- name: 📋 Prepare Installer Directory
43+
run: |
44+
Remove-Item -Recurse -Force Intrudex-Client\build -ErrorAction SilentlyContinue
45+
New-Item -ItemType Directory -Force -Path Intrudex-Client\build
46+
Copy-Item -Recurse -Force Intrudex-Client\Build-Files\* Intrudex-Client\build\
47+
4348
- name: 🏗️ Configure & Build Project
4449
run: |
4550
cmake -S Intrudex-Client -B Intrudex-Client\Build-Files -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
4651
cmake --build Intrudex-Client\Build-Files -- -j4
4752
48-
# Extract version from version.rc
4953
- name: 🏷️ Extract Version from version.rc
5054
id: get_version
5155
shell: pwsh
5256
run: |
5357
$rcFile = "Intrudex-Client/version.rc"
54-
if (!(Test-Path $rcFile)) { $rcFile = "Intrudex-Client/version.rc" }
5558
$versionLine = Select-String -Path $rcFile -Pattern 'FILEVERSION\s+([0-9, ]+)' | Select-Object -First 1
5659
if ($versionLine) {
5760
$ver = $versionLine.Matches[0].Groups[1].Value -replace '[ ,]+', '.'
5861
$ver = $ver.Trim('.')
5962
echo "VERSION=$ver" >> $env:GITHUB_ENV
6063
} else {
61-
echo "VERSION=unknown" >> $env:GITHUB_ENV
64+
echo "VERSION=0.0.1" >> $env:GITHUB_ENV
6265
}
6366
64-
- name: 📋 Prepare Installer Directory
65-
run: |
66-
Remove-Item -Recurse -Force Intrudex-Client\build -ErrorAction SilentlyContinue
67-
New-Item -ItemType Directory -Force -Path Intrudex-Client\build
68-
Copy-Item -Recurse -Force Intrudex-Client\Build-Files\* Intrudex-Client\build\
69-
70-
# Ensure LICENSE is present for the installer
71-
- name: 📄 Copy LICENSE for Installer
72-
run: Copy-Item LICENSE Intrudex-Client-installer.iss -Destination Intrudex
67+
- name: 📄 Copy LICENSE to Build Folder
68+
run: Copy-Item LICENSE Intrudex-Client\build\
7369

74-
- name: 🛠 Build Installer
70+
- name: 🛠 Build Installer using Inno Setup
7571
shell: pwsh
7672
run: |
7773
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "Intrudex-Client-installer.iss"
@@ -144,4 +140,4 @@ jobs:
144140
145141
files: |
146142
intrudex-client-build.zip
147-
Intrudex-Client-Setup.exe
143+
Intrudex-Client-Setup.exe

Intrudex-Client-installer.iss

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,32 @@
1-
; Script generated by the Inno Setup Script Wizard.
2-
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3-
41
#define MyAppName "Intrudex-Client"
52
#define MyAppVersion "1.0.0"
63
#define MyAppPublisher "ToolsHive, Inc."
74
#define MyAppURL "https://github.com/ToolsHive/Intrudex/"
85
#define MyAppExeName "Intrudex_Client.exe"
9-
#define MyAppAssocName MyAppName + ""
6+
#define MyAppServiceName "IntrudexClientService"
7+
#define MyAppAssocName MyAppName
108
#define MyAppAssocExt ".myp"
119
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt
1210

1311
[Setup]
14-
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
15-
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
16-
AppId={{F599BB8F-FF0F-4965-B2C3-D46682D7DBF5}
12+
AppId={{F599BB8F-FF0F-4965-B2C3-D46682D7DBF5}}
1713
AppName={#MyAppName}
1814
AppVersion={#MyAppVersion}
19-
;AppVerName={#MyAppName} {#MyAppVersion}
2015
AppPublisher={#MyAppPublisher}
2116
AppPublisherURL={#MyAppURL}
2217
AppSupportURL={#MyAppURL}
2318
AppUpdatesURL={#MyAppURL}
2419
DefaultDirName={autopf}\{#MyAppName}
2520
UninstallDisplayIcon={app}\{#MyAppExeName}
26-
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
27-
; on anything but x64 and Windows 11 on Arm.
2821
ArchitecturesAllowed=x64compatible
29-
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
30-
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
31-
; meaning it should use the native 64-bit Program Files directory and
32-
; the 64-bit view of the registry.
3322
ArchitecturesInstallIn64BitMode=x64compatible
3423
ChangesAssociations=yes
3524
DefaultGroupName={#MyAppName}
3625
AllowNoIcons=yes
37-
LicenseFile=Intrudex\LICENSE
38-
; Uncomment the following line to run in non administrative install mode (install for current user only).
39-
;PrivilegesRequired=lowest
26+
LicenseFile=LICENSE
4027
PrivilegesRequiredOverridesAllowed=dialog
41-
OutputDir=C:\Users\armog\OneDrive\Desktop\Intrudex-Client
42-
OutputBaseFilename=Intrudex-Client-Setup
28+
OutputDir=.
29+
OutputBaseFilename=Intrudex-Client-Setup-v{#MyAppVersion}
4330
SolidCompression=yes
4431
WizardStyle=modern
4532

@@ -48,29 +35,21 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
4835

4936
[Tasks]
5037
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
51-
Name: autostart; Description: "Start Intrudex Client with Windows"; GroupDescription: "Startup options:"; Flags: unchecked
38+
Name: "autostart"; Description: "Start Intrudex Client after installation"; GroupDescription: "Startup options:"; Flags: unchecked
39+
Name: "registerservice"; Description: "Register Intrudex Client as a Windows Service (requires admin)"; GroupDescription: "Service Options:"; Flags: unchecked
5240

5341
[Files]
54-
; Main EXE
55-
Source: "Intrudex-Client\build\Intrudex_Client.exe"; DestDir: "{app}"; Flags: ignoreversion
56-
57-
; All folders and files under build (preserve structure)
42+
Source: "Intrudex-Client\build\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
5843
Source: "Intrudex-Client\build\config\*"; DestDir: "{app}\config"; Flags: ignoreversion recursesubdirs createallsubdirs
5944
Source: "Intrudex-Client\build\assets\*"; DestDir: "{app}\assets"; Flags: ignoreversion recursesubdirs createallsubdirs
60-
61-
; All DLLs at the root of build
6245
Source: "Intrudex-Client\build\*.dll"; DestDir: "{app}"; Flags: ignoreversion
6346

6447
[Registry]
6548
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
6649
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
6750
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
6851
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
69-
; Optional: Write uninstall path
70-
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Uninstall\Intrudex_Client"; ValueType: string; ValueName: "UninstallString"; ValueData: """{uninstallexe}"""
71-
; Auto-start only if selected in [Tasks]
72-
Root: HKCU; Subkey: "Software\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "IntrudexClient"; ValueData: """{app}\intrudex-client.exe"""; Tasks: autostart
73-
52+
Root: HKLM; Subkey: "Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}"; ValueType: string; ValueName: "UninstallString"; ValueData: """{uninstallexe}"""
7453

7554
[Icons]
7655
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
@@ -79,5 +58,9 @@ Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
7958
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
8059

8160
[Run]
82-
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
61+
; Start the app if selected
62+
Filename: "{app}\{#MyAppExeName}"; Description: "Launch Intrudex Client now"; Flags: nowait postinstall skipifsilent; Tasks: autostart
8363

64+
; Register the EXE as a system service (if selected)
65+
; Assumes the EXE can run as a service and doesn't terminate immediately
66+
Filename: "sc.exe"; Parameters: "create {#MyAppServiceName} binPath= ""{app}\{#MyAppExeName}"" DisplayName= ""Intrudex Client Service"" start= auto"; StatusMsg: "Registering as system service..."; Flags: runhidden runascurrentuser; Tasks: registerservice

0 commit comments

Comments
 (0)