Skip to content

Commit beb94b9

Browse files
baasith6cursoragent
andcommitted
Fix Jenkins installer: find Inno Setup ISCC under user profiles.
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a10e886 commit beb94b9

5 files changed

Lines changed: 31 additions & 13 deletions

File tree

Jenkinsfile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pipeline {
1313
environment {
1414
VM_APP_DIR = '/opt/onevo/app'
1515
ONEVO_PYTHON = 'C:\\Users\\Abdul Baasith\\AppData\\Local\\Python\\bin\\python.exe'
16+
ONEVO_ISCC = 'C:\\Users\\Abdul Baasith\\AppData\\Local\\Programs\\Inno Setup 6\\ISCC.exe'
1617
}
1718

1819
stages {
@@ -57,14 +58,15 @@ pipeline {
5758
keyFileVariable: 'SSH_KEY',
5859
usernameVariable: 'SSH_USER'
5960
)]) {
60-
bat """
61+
bat '''
6162
powershell -ExecutionPolicy Bypass -File scripts/deploy-vm.ps1 ^
62-
-VmHost ${params.VM_HOST} ^
63-
-VmUser ${params.VM_USER} ^
64-
-BackendUrl ${params.BACKEND_URL} ^
63+
-VmHost ''' + params.VM_HOST + ''' ^
64+
-VmUser ''' + params.VM_USER + ''' ^
65+
-BackendUrl ''' + params.BACKEND_URL + ''' ^
6566
-PythonPath "%ONEVO_PYTHON%" ^
66-
-SshKeyPath "${env.SSH_KEY}"${extra}
67-
"""
67+
-IsccPath "%ONEVO_ISCC%" ^
68+
-SshKeyPath "%SSH_KEY%"''' + extra + '''
69+
'''
6870
}
6971
}
7072
}

connector/installer/build.ps1

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ param(
33
[Parameter(Mandatory = $true)]
44
[string]$BackendUrl,
55
[string]$PythonPath = "",
6+
[string]$IsccPath = "",
67
[switch]$AllowHttp
78
)
89

@@ -24,17 +25,28 @@ function Assert-BackendUrl([string]$Url, [bool]$AllowHttp) {
2425
throw "Production requires HTTPS (or http://localhost / http://127.0.0.1 for local builds). Got: $Url. Use -AllowHttp for MVP pilot without TLS."
2526
}
2627

27-
function Find-ISCC {
28+
function Find-ISCC([string]$ExplicitPath) {
2829
$candidates = @(
30+
$ExplicitPath,
31+
$env:ONEVO_ISCC,
2932
"${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe",
3033
"${env:ProgramFiles}\Inno Setup 6\ISCC.exe",
3134
"$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe",
3235
(Get-Command ISCC -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Source)
33-
) | Where-Object { $_ -and (Test-Path $_) }
34-
if (-not $candidates) {
35-
throw "Inno Setup 6 (ISCC.exe) was not found. Install from https://jrsoftware.org/isdl.php"
36+
)
37+
$userRoots = Get-ChildItem 'C:\Users' -Directory -ErrorAction SilentlyContinue |
38+
Where-Object { $_.Name -notin @('Public', 'Default', 'Default User', 'All Users') }
39+
foreach ($user in $userRoots) {
40+
$candidates += @(
41+
(Join-Path $user.FullName 'AppData\Local\Programs\Inno Setup 6\ISCC.exe'),
42+
(Join-Path $user.FullName 'AppData\Local\Programs\Inno Setup 6\Compil32.exe')
43+
)
3644
}
37-
return ($candidates | Select-Object -First 1)
45+
$found = $candidates | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1
46+
if (-not $found) {
47+
throw "Inno Setup 6 (ISCC.exe) was not found. Install from https://jrsoftware.org/isdl.php or set ONEVO_ISCC."
48+
}
49+
return $found
3850
}
3951

4052
function Find-Python([string]$ExplicitPath) {
@@ -115,7 +127,7 @@ if (-not (Test-Path $pyinstallerOut)) {
115127
}
116128
Write-Host "==> Built $pyinstallerOut"
117129

118-
$iscc = Find-ISCC
130+
$iscc = Find-ISCC $IsccPath
119131
Write-Host "==> Inno Setup: $iscc"
120132
& $iscc $IssFile
121133
if ($LASTEXITCODE -ne 0) { throw "Inno Setup failed (exit $LASTEXITCODE)" }

docs/JENKINS_DEPLOY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ powershell -ExecutionPolicy Bypass -File scripts/deploy-vm.ps1 -SkipInstaller
9191
| SSH permission denied | Re-check `onevo-vm-ssh-key` credential; deploy script copies the key with strict ACLs for OpenSSH on Windows |
9292
| GPU compose error | Keep `USE_GPU=false` on CPU VM |
9393
| Missing `ffmpeg.exe` | First build auto-downloads to `%ProgramData%\onevo\installer-tools\`; or run `scripts/ensure-installer-tools.ps1` once |
94-
| Installer build fails | Install Inno Setup 6 + PyInstaller; run `scripts/build-installer.ps1` manually once |
94+
| Installer build fails | Install **Inno Setup 6** (user or Program Files); set `ONEVO_ISCC` in Jenkinsfile if needed |
9595
| Backend unhealthy after deploy | SSH to VM: `cd /opt/onevo/app && docker compose logs backend --tail 50` |
9696

9797
## Related

scripts/build-installer.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ param(
33
[Parameter(Mandatory = $true)]
44
[string]$BackendUrl,
55
[string]$PythonPath = "",
6+
[string]$IsccPath = "",
67
[switch]$AllowHttp
78
)
89

@@ -17,6 +18,7 @@ if (-not (Test-Path $buildScript)) {
1718
Write-Host "Building ONEVO connector installer for $BackendUrl ..."
1819
$buildArgs = @{ BackendUrl = $BackendUrl }
1920
if ($PythonPath) { $buildArgs.PythonPath = $PythonPath }
21+
if ($IsccPath) { $buildArgs.IsccPath = $IsccPath }
2022
if ($AllowHttp) { $buildArgs.AllowHttp = $true }
2123
& $buildScript @buildArgs
2224

scripts/deploy-vm.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ param(
66
[string]$BackendUrl = "http://20.193.69.220:8081",
77
[string]$SshKeyPath = "",
88
[string]$PythonPath = "",
9+
[string]$IsccPath = "",
910
[switch]$SkipInstaller,
1011
[switch]$SkipBuild,
1112
[switch]$UseGpu
@@ -84,6 +85,7 @@ if (-not $SkipInstaller) {
8485
Write-Host "==> Building Windows installer..."
8586
$installerArgs = @{ BackendUrl = $BackendUrl; AllowHttp = $true }
8687
if ($PythonPath) { $installerArgs.PythonPath = $PythonPath }
88+
if ($IsccPath) { $installerArgs.IsccPath = $IsccPath }
8789
& (Join-Path $root "scripts\build-installer.ps1") @installerArgs
8890
$installerExe = Get-ChildItem (Join-Path $root "connector\dist\ONEVO-Connector-Setup-*.exe") |
8991
Sort-Object LastWriteTime -Descending | Select-Object -First 1

0 commit comments

Comments
 (0)