Skip to content

Commit afff376

Browse files
committed
feat: win installer using inno setup
1 parent 7475c94 commit afff376

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/main.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ jobs:
108108
- name: Run tests
109109
run: |
110110
make check-ci
111+
# - name: Install Inno Setup
112+
# run: |
113+
# choco install innosetup
114+
# - name: Compile the Installer
115+
# run: |
116+
# C:\Program Files (x86)\Inno Setup 6\ISCC.exe" "build\innosetup.iss"
111117

112118
osx-native-test:
113119
name: 🍎 OSX native test
@@ -187,12 +193,17 @@ jobs:
187193
- name: Build native windows exe for x86_64
188194
run: |
189195
make win-native RELEASE=1
196+
- name: Compile the installer
197+
run: |
198+
ISCC.exe /DMyAppVersion=${{ needs.semantic-release.outputs.new_release_version }} build\innosetup.iss
199+
mv build\Output\cjit_innosetup.exe CJIT_install.exe
190200
- name: Upload artifact windows-amd64
191201
uses: actions/upload-artifact@v4
192202
with:
193203
name: release-win-native-x86_64
194204
path: |
195205
cjit.exe
206+
CJIT_install.exe
196207
197208
osx-native-release:
198209
name: 🍎 OSX native binary release build

build/innosetup.iss

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#define MyAppName "CJIT"
2+
; #define MyAppVersion "1.0"
3+
#define MyAppPublisher "Dyne.org foundation"
4+
#define MyAppURL "https://dyne.org/docs/cjit"
5+
#define MyAppExeName "cjit.exe"
6+
#define MyAppAssocName "C Source Code"
7+
#define MyAppAssocExt ".c"
8+
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt
9+
#define MyBuildHome ".."
10+
; "C:\Users\runneradmin"
11+
[Setup]
12+
DisableStartupPrompt=yes
13+
AppId={{424647AA-C490-4CE6-85E9-A988CB6D3089}
14+
AppName={#MyAppName}
15+
AppVersion={#MyAppVersion}
16+
;AppVerName={#MyAppName} {#MyAppVersion}
17+
AppPublisher={#MyAppPublisher}
18+
AppPublisherURL={#MyAppURL}
19+
AppSupportURL={#MyAppURL}
20+
AppUpdatesURL={#MyAppURL}
21+
DefaultDirName={autopf}\{#MyAppName}
22+
UninstallDisplayIcon={app}\{#MyAppExeName}
23+
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
24+
; on anything but x64 and Windows 11 on Arm.
25+
ArchitecturesAllowed=x64compatible
26+
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
27+
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
28+
; meaning it should use the native 64-bit Program Files directory and
29+
; the 64-bit view of the registry.
30+
ArchitecturesInstallIn64BitMode=x64compatible
31+
ChangesAssociations=yes
32+
DefaultGroupName={#MyAppName}
33+
DisableProgramGroupPage=yes
34+
; LicenseFile={#MyBuildHome}\LICENSES\GPL-3.0-or-later.txt
35+
; InfoBeforeFile={#MyBuildHome}\README.md
36+
; InfoAfterFile={#MyBuildHome}\docs\cjit.1
37+
; Remove the following line to run in administrative install mode (install for all users).
38+
PrivilegesRequired=lowest
39+
PrivilegesRequiredOverridesAllowed=dialog
40+
OutputBaseFilename=cjit_innosetup
41+
SolidCompression=yes
42+
WizardStyle=modern
43+
44+
[Languages]
45+
Name: "english"; MessagesFile: "compiler:Default.isl"
46+
47+
[Files]
48+
Source: "{#MyBuildHome}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
49+
Source: "{#MyBuildHome}\README.md"; DestDir: "{app}"; Flags: ignoreversion
50+
Source: "{#MyBuildHome}\REUSE.toml"; DestDir: "{app}"; Flags: ignoreversion
51+
Source: "{#MyBuildHome}\examples\*"; DestDir: "{app}\examples"; Flags: ignoreversion recursesubdirs createallsubdirs
52+
Source: "{#MyBuildHome}\test\*"; DestDir: "{app}\test"; Flags: ignoreversion recursesubdirs createallsubdirs
53+
Source: "{#MyBuildHome}\docs\*"; DestDir: "{app}\docs"; Flags: ignoreversion recursesubdirs createallsubdirs
54+
Source: "{#MyBuildHome}\LICENSES\*"; DestDir: "{app}\licenses"; Flags: ignoreversion recursesubdirs createallsubdirs
55+
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
56+
57+
[Registry]
58+
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
59+
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
60+
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
61+
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
62+
63+
[Icons]
64+
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
65+

0 commit comments

Comments
 (0)