- build_windows_oneclick.bat / build_windows_installer_oneclick.bat : wrappers - scripts/build_windows_oneclick.ps1 / build_windows_installer_only.ps1 / install_inno_setup_build_dep.ps1 - build_signing.example.ps1 : exemple protocole signing (sans secret) - docs/build-windows-oneclick.md : documentation du build Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
62 lines
2.0 KiB
PowerShell
62 lines
2.0 KiB
PowerShell
param(
|
|
[string]$AppVersion = (Get-Date -Format "yyyy.MM.dd.HHmm")
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
function Resolve-InnoCompiler {
|
|
$command = Get-Command ISCC.exe -ErrorAction SilentlyContinue
|
|
if ($command) {
|
|
return $command.Source
|
|
}
|
|
|
|
$candidates = @()
|
|
if (${env:ProgramFiles(x86)}) {
|
|
$candidates += (Join-Path ${env:ProgramFiles(x86)} "Inno Setup 6\ISCC.exe")
|
|
}
|
|
if ($env:ProgramFiles) {
|
|
$candidates += (Join-Path $env:ProgramFiles "Inno Setup 6\ISCC.exe")
|
|
}
|
|
if ($env:LOCALAPPDATA) {
|
|
$candidates += (Join-Path $env:LOCALAPPDATA "Programs\Inno Setup 6\ISCC.exe")
|
|
$candidates += (Join-Path $env:LOCALAPPDATA "Inno Setup 6\ISCC.exe")
|
|
}
|
|
|
|
foreach ($candidate in $candidates) {
|
|
if ($candidate -and (Test-Path $candidate)) {
|
|
return $candidate
|
|
}
|
|
}
|
|
throw "ISCC.exe introuvable. Installer Inno Setup 6 puis relancer."
|
|
}
|
|
|
|
function Require-Path {
|
|
param(
|
|
[string]$PathValue,
|
|
[string]$Label
|
|
)
|
|
if (-not (Test-Path $PathValue)) {
|
|
throw "$Label introuvable: $PathValue"
|
|
}
|
|
}
|
|
|
|
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
$ProjectRoot = (Resolve-Path (Join-Path $ScriptDir "..")).Path
|
|
$InstallerScriptPath = Join-Path $ProjectRoot "installer\Anonymisation.iss"
|
|
$PackageExePath = Join-Path $ProjectRoot "release\Anonymisation-Windows\Anonymisation.exe"
|
|
$InstallerPath = Join-Path $ProjectRoot "release\Anonymisation-Setup.exe"
|
|
|
|
Require-Path -PathValue $InstallerScriptPath -Label "Script Inno Setup"
|
|
Require-Path -PathValue $PackageExePath -Label "Executable package"
|
|
|
|
$innoCompiler = Resolve-InnoCompiler
|
|
Write-Host "Inno Setup Compiler : $innoCompiler"
|
|
& $innoCompiler "/DAppVersion=$AppVersion" $InstallerScriptPath
|
|
if ($LASTEXITCODE -ne 0) {
|
|
throw "Inno Setup a echoue avec le code $LASTEXITCODE."
|
|
}
|
|
|
|
Require-Path -PathValue $InstallerPath -Label "Installateur Windows"
|
|
$installerSizeMb = [math]::Round((Get-Item $InstallerPath).Length / 1MB, 1)
|
|
Write-Host "Installateur pret : $InstallerPath ($installerSizeMb MB)"
|