Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion installer/CameraOnScreen.iss
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "{#SourceDir}\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs ignoreversion
; TensorRT engine packages (.trtpkg) are already-compressed blobs — running them through the
; solid lzma2/ultra64 block burns minutes of compile time for ~0 size win. Ship them with
; nocompression. This entry MUST precede the catch-all (Inno uses the first matching rule).
Source: "{#SourceDir}\maxine\models\*"; DestDir: "{app}\maxine\models"; Flags: nocompression recursesubdirs createallsubdirs ignoreversion
; Excludes the engines from the catch-all so they aren't packed a second time (compressed).
Source: "{#SourceDir}\*"; DestDir: "{app}"; Excludes: "*.trtpkg"; Flags: recursesubdirs createallsubdirs ignoreversion
; Ship the consolidated third-party notices into the install dir (repo-root file, path
; relative to this .iss). The per-SDK NVIDIA notice texts already ride inside {#SourceDir}\maxine\.
Source: "..\THIRD-PARTY-NOTICES.md"; DestDir: "{app}"; Flags: ignoreversion
Expand Down
6 changes: 5 additions & 1 deletion native/shim/bundle/maxine-manifest.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@
# Model engines, copied from the stage's models\{vfx,ar}. Broad per-effect globs so the bundle
# ships whatever arches are staged (sm75/86/89/100) -- arch selection happens at fetch time
# (scripts/fetch-maxine-engines.ps1 -Arches). VFX -> models\vfx, AR -> models\ar.
# Green-screen MODE is hardcoded to 0 in aigs.cpp (Probe + Start) -> only the m0 engines
# (m0 + its m0_1_4_8 batch variant) ever load. Shipping m1/m2/m3 was ~73 MB/arch of dead
# weight (~290 MB across the 4 arches). Widen this glob back to 'AIGS_*' if a quality-mode
# selector is ever exposed in the UI -> shim.
VfxModelGlobs = @(
'AIGS_*.engine.trtpkg'
'AIGS_*_m0*.engine.trtpkg'
)
ArModelGlobs = @(
'gazeredir_*.engine.trtpkg'
Expand Down
36 changes: 28 additions & 8 deletions scripts/build-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,18 @@ function Assert-ShimHasEffects {
if ($isStub) { throw "deployed shim is the passthrough STUB ('not built in' present)" }
}

# One-time timing split so the next release run shows where the ~7 min goes (shim vs dotnet vs
# ISCC). Stopwatch, NOT Measure-Command — the latter swallows the child build stdout we need in CI.
$script:Timings = [ordered]@{}
function Invoke-Timed {
param([string]$Label, [scriptblock]$Block)
$sw = [System.Diagnostics.Stopwatch]::StartNew()
& $Block
$sw.Stop()
$script:Timings[$Label] = $sw.Elapsed.TotalSeconds
Write-Host ("[timing] {0}: {1:N1}s" -f $Label, $sw.Elapsed.TotalSeconds) -ForegroundColor DarkCyan
}

$isccExe = Resolve-Iscc -Explicit $IsccPath

if ($DryRun) {
Expand All @@ -79,9 +91,11 @@ if ($DryRun) {

# 1. Native shim, SDK config, LAST (deploy-the-right-shim gotcha).
if (-not $SkipShimBuild) {
$msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild $shimProj /p:Configuration=$Configuration /p:Platform=x64 /warnaserror /nologo
if ($LASTEXITCODE -ne 0) { throw "shim build failed ($LASTEXITCODE)" }
Invoke-Timed 'shim-build' {
$msbuild = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe"
& $msbuild $shimProj /p:Configuration=$Configuration /p:Platform=x64 /warnaserror /nologo
if ($LASTEXITCODE -ne 0) { throw "shim build failed ($LASTEXITCODE)" }
}
}

# 2. Build App, .NET self-contained, into the staging dir.
Expand All @@ -97,24 +111,30 @@ if (Test-Path -LiteralPath $StagingDir) {
Remove-Item -Recurse -Force -LiteralPath $StagingDir
}
New-Item -ItemType Directory -Force -Path $StagingDir | Out-Null
dotnet build $appProj -c $Configuration -r win-x64 -p:SelfContained=true -p:Platform=x64 -t:Rebuild -o $StagingDir --nologo
if ($LASTEXITCODE -ne 0) { throw "dotnet build failed ($LASTEXITCODE)" }
Invoke-Timed 'dotnet-build' {
dotnet build $appProj -c $Configuration -r win-x64 -p:SelfContained=true -p:Platform=x64 -t:Rebuild -o $StagingDir --nologo
if ($LASTEXITCODE -ne 0) { throw "dotnet build failed ($LASTEXITCODE)" }
}

# 3. Export-verify the deployed shim BEFORE packaging.
Assert-ShimHasEffects -Dll (Join-Path $StagingDir 'CameraOnScreen.Shim.dll')

# 4. Bundle the Maxine runtime into <staging>\maxine\ by pruning the pre-assembled stage.
if (-not $MaxineStage) { throw "no -MaxineStage (or `$env:COS_MAXINE_STAGE) — assemble one first with scripts/assemble-maxine-stage.ps1" }
& $bundler -OutDir $StagingDir -MaxineStage $MaxineStage
Invoke-Timed 'bundle-maxine' { & $bundler -OutDir $StagingDir -MaxineStage $MaxineStage }
if (-not (Test-Path -LiteralPath (Join-Path $StagingDir 'maxine'))) { throw "bundler did not produce maxine\ in $StagingDir" }

# 5. Compile the installer.
$stagedExe = Join-Path $StagingDir 'CameraOnScreen.App.exe'
if (-not (Test-Path -LiteralPath $stagedExe)) { throw "staging is missing CameraOnScreen.App.exe — publish incomplete; refusing to package" }
New-Item -ItemType Directory -Force -Path (Join-Path $repo 'dist') | Out-Null
& $isccExe $iss "/DSourceDir=$StagingDir" "/DAppVersion=$Version"
if ($LASTEXITCODE -ne 0) { throw "ISCC compile failed ($LASTEXITCODE)" }
Invoke-Timed 'iscc-compile' {
& $isccExe $iss "/DSourceDir=$StagingDir" "/DAppVersion=$Version"
if ($LASTEXITCODE -ne 0) { throw "ISCC compile failed ($LASTEXITCODE)" }
}

$size = (Get-Item -LiteralPath $output).Length
Write-Host ("installer -> {0}" -f $output)
Write-Host (" size : {0:N0} bytes ({1:N2} GB)" -f $size, ($size / 1GB))
Write-Host "--- timing split ---"
foreach ($k in $script:Timings.Keys) { Write-Host (" {0,-14} {1,6:N1}s" -f $k, $script:Timings[$k]) }
Loading