preserve legacy portable marker during updates (#1167)
This commit is contained in:
parent
d1d3393230
commit
552ebe5378
1 changed files with 8 additions and 4 deletions
|
|
@ -587,17 +587,21 @@ Function .onInit
|
||||||
|
|
||||||
|
|
||||||
; --- PORTABLE MODE --- Auto-detect portable mode during updates.
|
; --- PORTABLE MODE --- Auto-detect portable mode during updates.
|
||||||
; If the target directory already has a valid portable marker file, preserve
|
; Preserve portable installs that use either the current magic-string marker
|
||||||
; portable mode so the Tauri updater works without needing /PORTABLE.
|
; or the legacy empty marker created by older Handy releases. Require Data/
|
||||||
; We validate the magic string to avoid false-positives from stale empty files
|
; for the legacy empty-marker case so stale scoop side-effect files do not
|
||||||
; left by scoop's NSIS extraction (dl.7z side-effect).
|
; accidentally opt an updater run into portable mode.
|
||||||
${If} $PortableMode <> 1
|
${If} $PortableMode <> 1
|
||||||
|
${AndIf} $UpdateMode = 1
|
||||||
${AndIf} ${FileExists} "$INSTDIR\portable"
|
${AndIf} ${FileExists} "$INSTDIR\portable"
|
||||||
FileOpen $1 "$INSTDIR\portable" r
|
FileOpen $1 "$INSTDIR\portable" r
|
||||||
FileRead $1 $2
|
FileRead $1 $2
|
||||||
FileClose $1
|
FileClose $1
|
||||||
${If} $2 == "Handy Portable Mode"
|
${If} $2 == "Handy Portable Mode"
|
||||||
StrCpy $PortableMode 1
|
StrCpy $PortableMode 1
|
||||||
|
${OrIf} $2 == ""
|
||||||
|
${AndIf} ${FileExists} "$INSTDIR\Data"
|
||||||
|
StrCpy $PortableMode 1
|
||||||
${EndIf}
|
${EndIf}
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue