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
4052function Find-Python ([string ]$ExplicitPath ) {
@@ -115,7 +127,7 @@ if (-not (Test-Path $pyinstallerOut)) {
115127}
116128Write-Host " ==> Built $pyinstallerOut "
117129
118- $iscc = Find-ISCC
130+ $iscc = Find-ISCC $IsccPath
119131Write-Host " ==> Inno Setup: $iscc "
120132& $iscc $IssFile
121133if ($LASTEXITCODE -ne 0 ) { throw " Inno Setup failed (exit $LASTEXITCODE )" }
0 commit comments