diff --git a/windows/README.md b/windows/README.md index c4cfdc5..4cadb3c 100644 --- a/windows/README.md +++ b/windows/README.md @@ -182,6 +182,8 @@ winget install ` The Store product ID `9PLM9XGG6VKS` is the ChatGPT Windows app managed here. ChatGPT Classic (`9NT1R1C2HH7J`) is intentionally not installed. +WinGet's `APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE` result is treated as +success because it means the installed ChatGPT version is already current. 7-Zip is intentionally installed with its normal Windows installer through WinGet rather than as a portable Scoop package, because the normal installer diff --git a/windows/applications/chatgpt/apply.ps1 b/windows/applications/chatgpt/apply.ps1 index a985a52..b329a94 100644 --- a/windows/applications/chatgpt/apply.ps1 +++ b/windows/applications/chatgpt/apply.ps1 @@ -8,6 +8,9 @@ winget install ` --silent ` --disable-interactivity -if ($LASTEXITCODE -ne 0) { - throw "Failed to install or update ChatGPT." +$exitCode = $LASTEXITCODE +$updateNotApplicable = -1978335189 # 0x8A15002B + +if ($exitCode -notin @(0, $updateNotApplicable)) { + throw "Failed to install or update ChatGPT (WinGet exit code $exitCode)." }