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
56 changes: 55 additions & 1 deletion installer/windows/DisplayXRBundleInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
; LEIA_EXE filename of staged leia plug-in installer
; MCP_EXE filename of staged mcp tools installer
; GAUSS_EXE filename of staged gaussian splat demo installer
; MODELVIEWER_EXE filename of staged 3D model viewer demo installer
; BUNDLE_STAGE absolute path to dir containing the staged .exe files + LICENSE
; OUTPUT_DIR absolute path for OutFile

Expand All @@ -40,6 +41,9 @@
!ifndef GAUSS_EXE
!error "GAUSS_EXE not defined"
!endif
!ifndef MODELVIEWER_EXE
!error "MODELVIEWER_EXE not defined"
!endif
; Bare (no leading 'v') target versions for the version-compare gate (#346),
; passed by build-bundle.bat alongside the *_EXE filenames.
!ifndef RUNTIME_VER
Expand All @@ -57,6 +61,9 @@
!ifndef GAUSS_VER
!error "GAUSS_VER not defined"
!endif
!ifndef MODELVIEWER_VER
!error "MODELVIEWER_VER not defined"
!endif
!ifndef BUNDLE_STAGE
!error "BUNDLE_STAGE not defined"
!endif
Expand Down Expand Up @@ -110,6 +117,7 @@ Var G_ShellInstalled
Var G_LeiaInstalled
Var G_McpInstalled
Var G_GaussInstalled
Var G_ModelViewerInstalled
Var G_LeiaProbeHit ; 1 iff SR Platform DLLs found on disk

; Installed DisplayVersion per child (from its ARP key), read in .onInit
Expand All @@ -119,6 +127,7 @@ Var G_ShellVer
Var G_LeiaVer
Var G_McpVer
Var G_GaussVer
Var G_ModelViewerVer

; Where we cache a copy of the bundle .exe so ARP Modify can re-run it.
!define BUNDLE_CACHE_DIR "$APPDATA\DisplayXR\BundleInstaller"
Expand Down Expand Up @@ -289,6 +298,31 @@ SectionGroup /e "Demos & samples" SecGrpDemos
${EndIf}
${EndIf}
SectionEnd

Section "3D Model Viewer" SecModelViewer
SetOutPath "$INSTDIR"
${If} ${SectionIsSelected} ${SecModelViewer}
${If} $G_ModelViewerInstalled == 0
DetailPrint "Installing 3D Model Viewer..."
File "${BUNDLE_STAGE}\${MODELVIEWER_EXE}"
ClearErrors
ExecWait '"$INSTDIR\${MODELVIEWER_EXE}" /S' $0
${If} $0 != 0
MessageBox MB_OK|MB_ICONSTOP "3D Model Viewer installer exited with code $0. Aborting bundle."
Abort
${EndIf}
Delete "$INSTDIR\${MODELVIEWER_EXE}"
${Else}
!insertmacro UpgradeOrSkip $G_ModelViewerVer "${MODELVIEWER_VER}" "${MODELVIEWER_EXE}" "3D Model Viewer"
${EndIf}
${ElseIf} $G_ModelViewerInstalled == 1
DetailPrint "Removing 3D Model Viewer..."
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayXRModelViewer" "UninstallString"
${If} $1 != ""
ExecWait '$1 /S' $0
${EndIf}
${EndIf}
SectionEnd
SectionGroupEnd

;--------------------------------
Expand Down Expand Up @@ -371,12 +405,14 @@ Function .onInit
StrCpy $G_LeiaInstalled 0
StrCpy $G_McpInstalled 0
StrCpy $G_GaussInstalled 0
StrCpy $G_ModelViewerInstalled 0
StrCpy $G_LeiaProbeHit 0
StrCpy $G_RuntimeVer ""
StrCpy $G_ShellVer ""
StrCpy $G_LeiaVer ""
StrCpy $G_McpVer ""
StrCpy $G_GaussVer ""
StrCpy $G_ModelViewerVer ""

; Runtime is RO so its checkbox state can't be unset; still record
; install state to skip a redundant /S re-run.
Expand Down Expand Up @@ -410,6 +446,14 @@ Function .onInit
!insertmacro SelectSection ${SecGauss}
${EndIf}

; Model viewer demo — default-checked. Pre-checked when already installed.
ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayXRModelViewer" "UninstallString"
${If} $0 != ""
StrCpy $G_ModelViewerInstalled 1
ReadRegStr $G_ModelViewerVer HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayXRModelViewer" "DisplayVersion"
!insertmacro SelectSection ${SecModelViewer}
${EndIf}

; Leia — probe SR Platform install path before deciding default.
; The SR Platform installer puts core DLLs under one of these dirs
; (current "LeiaSR" branding + legacy "Simulated Reality" branding,
Expand Down Expand Up @@ -447,13 +491,15 @@ LangString DESC_SecShell ${LANG_ENGLISH} "Spatial workspace + window manager f
LangString DESC_SecMcp ${LANG_ENGLISH} "Claude / AI control adapter for DisplayXR. Required for the displayxr-mcp Tools experience."
LangString DESC_SecLeia ${LANG_ENGLISH} "Display processor for Leia SR 3D monitors. Auto-selected when SR Platform is detected."
LangString DESC_SecGauss ${LANG_ENGLISH} "Sample 3D scene viewer (Gaussian splatting renderer). Standalone DisplayXR app."
LangString DESC_SecModelViewer ${LANG_ENGLISH} "glTF 2.0 PBR model viewer (.glb/.gltf). Standalone DisplayXR app."

!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecRuntime} $(DESC_SecRuntime)
!insertmacro MUI_DESCRIPTION_TEXT ${SecShell} $(DESC_SecShell)
!insertmacro MUI_DESCRIPTION_TEXT ${SecMcp} $(DESC_SecMcp)
!insertmacro MUI_DESCRIPTION_TEXT ${SecLeia} $(DESC_SecLeia)
!insertmacro MUI_DESCRIPTION_TEXT ${SecGauss} $(DESC_SecGauss)
!insertmacro MUI_DESCRIPTION_TEXT ${SecModelViewer} $(DESC_SecModelViewer)
!insertmacro MUI_FUNCTION_DESCRIPTION_END


Expand All @@ -462,7 +508,7 @@ LangString DESC_SecGauss ${LANG_ENGLISH} "Sample 3D scene viewer (Gaussian spl
;--------------------------------
;
; Walk each child's UninstallString in reverse install order
; (Gauss → MCP → Leia → Shell → Runtime). Runtime last so its
; (ModelViewer → Gauss → MCP → Leia → Shell → Runtime). Runtime last so its
; DeleteRegKey /ifempty Software\DisplayXR cleanup catches any orphan
; subkeys (per PR DisplayXR/displayxr-runtime#291 fix #4). The chain
; gracefully skips any child whose ARP key is absent — covers
Expand All @@ -471,6 +517,14 @@ LangString DESC_SecGauss ${LANG_ENGLISH} "Sample 3D scene viewer (Gaussian spl
Section "Uninstall"
Var /GLOBAL ChildUninstall

; -- 3D Model Viewer --
ClearErrors
ReadRegStr $ChildUninstall HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayXRModelViewer" "UninstallString"
${If} $ChildUninstall != ""
DetailPrint "Uninstalling 3D Model Viewer..."
ExecWait '$ChildUninstall /S' $0
${EndIf}

; -- Gaussian Splat viewer --
ClearErrors
ReadRegStr $ChildUninstall HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DisplayXRGaussianSplat" "UninstallString"
Expand Down
13 changes: 13 additions & 0 deletions scripts/build-bundle.bat
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ set "COMPONENT_EXE_mcp_tools=DisplayXRMCPSetup-*.exe"
set "COMPONENT_REPO_gauss_demo=DisplayXR/displayxr-demo-gaussiansplat"
set "COMPONENT_EXE_gauss_demo=DisplayXRGaussianSplatSetup-*.exe"

set "COMPONENT_REPO_modelviewer_demo=DisplayXR/displayxr-demo-modelviewer"
set "COMPONENT_EXE_modelviewer_demo=DisplayXRModelViewerSetup-*.exe"

:: --- Read pins from versions.json ---
:: Per PR DisplayXR/displayxr-runtime#291 fix #1: use function-call form
:: for ConvertFrom-Json, NOT a pipe inside `for /f`. cmd's re-quoting of
Expand All @@ -106,12 +109,14 @@ call :read_pin shell SHELL_TAG
call :read_pin leia_plugin LEIA_TAG
call :read_pin mcp_tools MCP_TAG
call :read_pin gauss_demo GAUSS_TAG
call :read_pin modelviewer_demo MODELVIEWER_TAG

if "%RUNTIME_TAG%"=="" ( echo ERROR: versions.json missing 'runtime' pin & exit /b 1 )
if "%SHELL_TAG%"=="" ( echo ERROR: versions.json missing 'shell' pin & exit /b 1 )
if "%LEIA_TAG%"=="" ( echo ERROR: versions.json missing 'leia_plugin' pin & exit /b 1 )
if "%MCP_TAG%"=="" ( echo ERROR: versions.json missing 'mcp_tools' pin & exit /b 1 )
if "%GAUSS_TAG%"=="" ( echo ERROR: versions.json missing 'gauss_demo' pin & exit /b 1 )
if "%MODELVIEWER_TAG%"=="" ( echo ERROR: versions.json missing 'modelviewer_demo' pin & exit /b 1 )

:: --- Bare versions for the NSI version-compare gate (#346) ---
:: Strip the leading 'v' from each pin so it matches the 3-part DisplayVersion
Expand All @@ -123,11 +128,13 @@ set "SHELL_VER=%SHELL_TAG%"
set "LEIA_VER=%LEIA_TAG%"
set "MCP_VER=%MCP_TAG%"
set "GAUSS_VER=%GAUSS_TAG%"
set "MODELVIEWER_VER=%MODELVIEWER_TAG%"
if /i "%RUNTIME_VER:~0,1%"=="v" set "RUNTIME_VER=%RUNTIME_VER:~1%"
if /i "%SHELL_VER:~0,1%"=="v" set "SHELL_VER=%SHELL_VER:~1%"
if /i "%LEIA_VER:~0,1%"=="v" set "LEIA_VER=%LEIA_VER:~1%"
if /i "%MCP_VER:~0,1%"=="v" set "MCP_VER=%MCP_VER:~1%"
if /i "%GAUSS_VER:~0,1%"=="v" set "GAUSS_VER=%GAUSS_VER:~1%"
if /i "%MODELVIEWER_VER:~0,1%"=="v" set "MODELVIEWER_VER=%MODELVIEWER_VER:~1%"

echo ==^> DisplayXR bundle build
echo bundle: v%BUNDLE_VERSION%
Expand All @@ -136,20 +143,23 @@ echo shell: %SHELL_TAG%
echo leia_plugin: %LEIA_TAG%
echo mcp_tools: %MCP_TAG%
echo gauss_demo: %GAUSS_TAG%
echo modelviewer: %MODELVIEWER_TAG%

:: --- Download each component's installer into _stage\<name>\ ---
call :download_component runtime %RUNTIME_TAG% || exit /b 1
call :download_component shell %SHELL_TAG% || exit /b 1
call :download_component leia_plugin %LEIA_TAG% || exit /b 1
call :download_component mcp_tools %MCP_TAG% || exit /b 1
call :download_component gauss_demo %GAUSS_TAG% || exit /b 1
call :download_component modelviewer_demo %MODELVIEWER_TAG% || exit /b 1

:: --- Capture the actual downloaded filenames (globs may match different builds) ---
call :find_exe runtime RUNTIME_EXE_FILE || exit /b 1
call :find_exe shell SHELL_EXE_FILE || exit /b 1
call :find_exe leia_plugin LEIA_EXE_FILE || exit /b 1
call :find_exe mcp_tools MCP_EXE_FILE || exit /b 1
call :find_exe gauss_demo GAUSS_EXE_FILE || exit /b 1
call :find_exe modelviewer_demo MODELVIEWER_EXE_FILE || exit /b 1

:: Copy all .exe files into _stage\bundle\ where NSIS expects them.
set "BUNDLE_STAGE=%STAGE%\bundle"
Expand All @@ -159,6 +169,7 @@ copy /Y "%STAGE%\shell\%SHELL_EXE_FILE%" "%BUNDLE_STAGE%\" >nul || ex
copy /Y "%STAGE%\leia_plugin\%LEIA_EXE_FILE%" "%BUNDLE_STAGE%\" >nul || exit /b 1
copy /Y "%STAGE%\mcp_tools\%MCP_EXE_FILE%" "%BUNDLE_STAGE%\" >nul || exit /b 1
copy /Y "%STAGE%\gauss_demo\%GAUSS_EXE_FILE%" "%BUNDLE_STAGE%\" >nul || exit /b 1
copy /Y "%STAGE%\modelviewer_demo\%MODELVIEWER_EXE_FILE%" "%BUNDLE_STAGE%\" >nul || exit /b 1
copy /Y "%REPO_ROOT%\LICENSE" "%BUNDLE_STAGE%\" >nul || exit /b 1

:: --- Invoke makensis ---
Expand All @@ -175,11 +186,13 @@ makensis ^
"/DLEIA_EXE=%LEIA_EXE_FILE%" ^
"/DMCP_EXE=%MCP_EXE_FILE%" ^
"/DGAUSS_EXE=%GAUSS_EXE_FILE%" ^
"/DMODELVIEWER_EXE=%MODELVIEWER_EXE_FILE%" ^
"/DRUNTIME_VER=%RUNTIME_VER%" ^
"/DSHELL_VER=%SHELL_VER%" ^
"/DLEIA_VER=%LEIA_VER%" ^
"/DMCP_VER=%MCP_VER%" ^
"/DGAUSS_VER=%GAUSS_VER%" ^
"/DMODELVIEWER_VER=%MODELVIEWER_VER%" ^
"/DBUNDLE_STAGE=%BUNDLE_STAGE%" ^
"/DOUTPUT_DIR=%OUT_DIR%" ^
"%REPO_ROOT%\installer\windows\DisplayXRBundleInstaller.nsi"
Expand Down
1 change: 1 addition & 0 deletions scripts/build-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ process_component mcp_tools "$MCP_TAG"
# only one with a macOS .pkg today (displayxr-demo-gaussiansplat v1.4.0).
# Activation also requires runtime's components.sh to carry a gauss_demo
# entry — graceful skip otherwise.
# modelviewer_demo is Windows-only (no macOS .pkg yet) — intentionally not bundled on macOS.
process_component gauss_demo "$GAUSS_TAG"

if [[ -z "$CHOICE_LINES" ]]; then
Expand Down
3 changes: 2 additions & 1 deletion versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"shell": "v1.5.0",
"leia_plugin": "v1.2.0",
"mcp_tools": "v0.3.4",
"gauss_demo": "v1.4.4"
"gauss_demo": "v1.4.4",
"modelviewer_demo": "v0.1.0"
}
Loading