Repository navigation
Deployment Recipes
Ready-to-adapt examples for deploying the setup .exe on many machines. The reference (options, exit codes, detection rule, logs) is in the Runbook; these recipes only apply it.
Replace X.Y.Z with the release version and <sha256> with the content of the .exe.sha256 file of that release.
| Item | Value |
|---|---|
| Install command | UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe /S |
| Uninstall command | "C:\Program Files\UsdShellExtension\uninstall.exe" /S _?=C:\Program Files\UsdShellExtension |
| Run as | Administrator or SYSTEM, 64-bit |
| Success codes |
0, 3010 (soft reboot) |
| Failure codes |
1 (cancelled, interactive only), 2 (aborted or registration failed) |
| Detection |
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension, value DisplayVersion = X.Y.Z.0
|
| Install log |
C:\Windows\Temp\UsdShellExtension_setup.log when run as SYSTEM |
Keep _?=<install folder> last and unquoted in the uninstall command: without it the uninstaller returns before the uninstall is done.
tools\chocolateyInstall.ps1:
$ErrorActionPreference = 'Stop'
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'exe'
url64bit = 'https://github.com/LoopsCreativeStudio/USDShellExtension/releases/download/vX.Y.Z/UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe'
checksum64 = '<sha256>'
checksumType64 = 'sha256'
silentArgs = '/S'
validExitCodes = @(0, 3010)
}
Install-ChocolateyPackage @packageArgsFor an internal repository without internet access, put the .exe in tools\ and use Install-ChocolateyInstallPackage with file64 instead of url64bit.
tools\chocolateyUninstall.ps1:
$ErrorActionPreference = 'Stop'
# The install folder is stored by the setup in its Uninstall key.
$uninstallKey = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension'
$installLocation = (Get-ItemProperty -Path $uninstallKey -ErrorAction SilentlyContinue).InstallLocation
if (-not $installLocation -or -not (Test-Path (Join-Path $installLocation 'uninstall.exe'))) {
Write-Warning 'USD Shell Extension is not installed, nothing to uninstall.'
return
}
$packageArgs = @{
packageName = $env:ChocolateyPackageName
fileType = 'exe'
file = Join-Path $installLocation 'uninstall.exe'
# _?= must be last and unquoted, even with spaces in the path.
silentArgs = "/S _?=$installLocation"
validExitCodes = @(0, 3010)
}
Uninstall-ChocolateyPackage @packageArgs-
Put the setup
.exealone in a folder and package it with the Microsoft Win32 Content Prep Tool:IntuneWinAppUtil.exe -c C:\Pkg\UsdShellExtension -s UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe -o C:\Pkg\Out
-
Program
- Install command:
UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe /S - Uninstall command:
"C:\Program Files\UsdShellExtension\uninstall.exe" /S _?=C:\Program Files\UsdShellExtension - Install behavior: System
- Device restart behavior: Determine behavior based on return codes
- Return codes: keep
0Success and3010Soft reboot; add2Failed.
- Install command:
-
Requirements: 64-bit, Windows 10 or later.
-
Detection rule: Registry
- Key path:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension - Value name:
DisplayVersion - Detection method: Version comparison, Equals,
X.Y.Z.0 - Associated with a 32-bit app on 64-bit clients: No
Alternative: File,
C:\Program Files\UsdShellExtension\UsdPreviewLocalServer.exe, Version, Greater than or equal toX.Y.Z. - Key path:
For an update, create a new app version and set it to supersede the previous one, or simply assign the new version: the setup uninstalls the previous one itself.
- Create an application, deployment type Script Installer, content folder holding the setup
.exe. - Installation program:
UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe /S - Uninstall program:
"C:\Program Files\UsdShellExtension\uninstall.exe" /S _?=C:\Program Files\UsdShellExtension - Detection method: Registry, hive
HKEY_LOCAL_MACHINE, keySOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension, valueDisplayVersion, data type Version, EqualsX.Y.Z.0. Check This registry key is associated with a 64-bit application. - User experience: Install for system, Whether or not a user is logged on.
- Return codes:
3010is a Soft Reboot by default; add2as Failure.
The setup runs as SYSTEM before any user logs on, so Explorer restarts are invisible. Put the setup on a share readable by Domain Computers, then use this startup script:
@echo off
rem Install or update the USD Shell Extension only when the version differs.
set VERSION=X.Y.Z.0
set SETUP=\\server\share\UsdShellExtension\UsdShellExtension-vX.Y.Z-u25.08-p3.12-setup.exe
for /f "tokens=3" %%V in ('reg query "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension" /v DisplayVersion 2^>nul ^| find "DisplayVersion"') do set INSTALLED=%%V
if "%INSTALLED%"=="%VERSION%" exit /b 0
"%SETUP%" /S
exit /b %ERRORLEVEL%On a target machine:
Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UsdShellExtension' |
Select-Object DisplayVersion, InstallLocation, QuietUninstallString
Get-Content "$env:windir\Temp\UsdShellExtension_setup.log" -Tail 20The log is UTF-16; Get-Content reads it as is.
Wiki
Docs (repository)
Links