From 0c91034a9d5f5465658ac01b508ea7e2dce27f66 Mon Sep 17 00:00:00 2001 From: rgdevment Date: Wed, 14 Oct 2026 08:54:17 -0300 Subject: [PATCH] fix(installer): an upgrade run by hand keeps starting with the session instead of uninstalling it first --- .github/workflows/bundle.yml | 2 ++ app/src-tauri/installer.nsi | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index 76e561cd..bf7969ce 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -126,6 +126,8 @@ jobs: "keep the binaries out of the data folder" want '!define MAINBINARYNAME "cp-gui"' \ "keep cp-gui.exe, the program the startup entry and the shortcuts already point at" + want '${OrIf} $R0 <> 0 StrCpy $R1 "$R1 /UPDATE"' \ + "tell the old uninstaller it is an update, so an upgrade run by hand keeps the startup entry" want '!define HOMENAME "CopyPaste"' \ "keep the folders, keys and startup entry it has always had under CopyPaste" want '_is1" "UninstallString"' \ diff --git a/app/src-tauri/installer.nsi b/app/src-tauri/installer.nsi index c219b17d..6be9ac0e 100644 --- a/app/src-tauri/installer.nsi +++ b/app/src-tauri/installer.nsi @@ -356,7 +356,10 @@ Function PageLeaveReinstall ${Else} ReadRegStr $4 SHCTX "${MANUPRODUCTKEY}" "" ReadRegStr $R1 SHCTX "${UNINSTKEY}" "UninstallString" - ${IfThen} $UpdateMode = 1 ${|} StrCpy $R1 "$R1 /UPDATE" ${|} ; append /UPDATE + ${If} $UpdateMode = 1 + ${OrIf} $R0 <> 0 + StrCpy $R1 "$R1 /UPDATE" + ${EndIf} ${IfThen} $PassiveMode = 1 ${|} StrCpy $R1 "$R1 /P" ${|} ; append /P StrCpy $R1 "$R1 _?=$4" ; append uninstall directory ExecWait '$R1' $0