Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit f507e47

Browse files
committed
feat: add inno installer script (#734)
1 parent 8d9cf27 commit f507e47

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

cortex-js/installer.iss

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
; Inno Setup Script
2+
; Define the application name, version, and other details
3+
[Setup]
4+
AppName=Cortex
5+
AppVersion=1.0
6+
DefaultDirName={pf}\Cortex
7+
DefaultGroupName=Cortex
8+
OutputDir=.
9+
OutputBaseFilename=setup
10+
Compression=lzma
11+
SolidCompression=yes
12+
PrivilegesRequired=admin
13+
14+
; Define the languages section
15+
[Languages]
16+
Name: "english"; MessagesFile: "compiler:Default.isl"
17+
18+
; Define the files to be installed
19+
[Files]
20+
Source: "cortex.exe"; DestDir: "{app}"; Flags: ignoreversion
21+
Source: "node_modules\sqlite3\*"; DestDir: "{app}\node_modules\sqlite3"; Flags: ignoreversion recursesubdirs createallsubdirs
22+
23+
; Define the icons to be created
24+
[Icons]
25+
Name: "{group}\Cortex"; Filename: "{app}\cortex.exe"
26+
27+
; Define the run section to execute the application after installation
28+
[Run]
29+
Filename: "cmd"; Parameters: "/c setx PATH ""%PATH%;{app}"""; StatusMsg: "Updating system PATH environment variable..."; Flags: runhidden
30+
Filename: "cmd"; Parameters: "/c cortex init"; StatusMsg: "Initializing Cortex..."; Flags: runhidden waituntilterminated
31+
Filename: "{app}\cortex.exe"; Description: "{cm:LaunchProgram,Cortex}"; Flags: nowait postinstall skipifsilent
32+
33+
; Define the tasks section (optional, for additional tasks like creating desktop icons)
34+
[Tasks]
35+
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"; Flags: unchecked
36+
Name: "quicklaunchicon"; Description: "Create a &Quick Launch icon"; GroupDescription: "Additional icons:"; Flags: unchecked
37+
38+
; Define icons for the additional tasks
39+
[Icons]
40+
Name: "{commondesktop}\Cortex"; Filename: "{app}\cortex.exe"; Tasks: desktopicon
41+
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Cortex"; Filename: "{app}\cortex.exe"; Tasks: quicklaunchicon

cortex-js/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"scripts": {
1212
"dev": "nest dev",
1313
"build": "yarn build:extensions && nest build && cpx \"cpuinfo/bin/**\" dist/bin",
14-
"build:binary": "yarn build && nexe dist/src/command.js --build --python=$(which python3) -o dist/cortex",
14+
"build:binary": "yarn build && nexe dist/src/command.js --build -r './node_modules/**/*' -o dist/cortex",
1515
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
1616
"build:extensions": "run-script-os",
1717
"build:extensions:windows": "powershell -command \"$jobs = Get-ChildItem -Path './src/extensions' -Directory | ForEach-Object { Start-Job -Name ($_.Name) -ScriptBlock { param($_dir); try { Set-Location $_dir; yarn; yarn build; Write-Output 'Build successful in ' + $_dir } catch { Write-Error 'Error in ' + $_dir; throw } } -ArgumentList $_.FullName }; $jobs | Wait-Job; $jobs | ForEach-Object { Receive-Job -Job $_ -Keep } | ForEach-Object { Write-Host $_ }; $failed = $jobs | Where-Object { $_.State -ne 'Completed' -or $_.ChildJobs[0].JobStateInfo.State -ne 'Completed' }; if ($failed) { Exit 1 }\"",

0 commit comments

Comments
 (0)