Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

preserve legacy portable marker during updates (#1167)

Fero552ebe53785d
diff --git a/src-tauri/nsis/installer.nsi b/src-tauri/nsis/installer.nsi
index b8dab093..42733d0d 100644
--- a/src-tauri/nsis/installer.nsi
+++ b/src-tauri/nsis/installer.nsi
@@ -587,17 +587,21 @@ Function .onInit
; --- PORTABLE MODE --- Auto-detect portable mode during updates.
- ; If the target directory already has a valid portable marker file, preserve
- ; portable mode so the Tauri updater works without needing /PORTABLE.
- ; We validate the magic string to avoid false-positives from stale empty files
- ; left by scoop's NSIS extraction (dl.7z side-effect).
+ ; Preserve portable installs that use either the current magic-string marker
+ ; or the legacy empty marker created by older Handy releases. Require Data/
+ ; for the legacy empty-marker case so stale scoop side-effect files do not
+ ; accidentally opt an updater run into portable mode.
${If} $PortableMode <> 1
+ ${AndIf} $UpdateMode = 1
${AndIf} ${FileExists} "$INSTDIR\portable"
FileOpen $1 "$INSTDIR\portable" r
FileRead $1 $2
FileClose $1
${If} $2 == "Handy Portable Mode"
StrCpy $PortableMode 1
+ ${OrIf} $2 == ""
+ ${AndIf} ${FileExists} "$INSTDIR\Data"
+ StrCpy $PortableMode 1
${EndIf}
${EndIf}