mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 14:53:01 +02:00
use EXEDIR to check if uninstaller is in temp
This commit is contained in:
parent
24903ad161
commit
24ef51c40b
1 changed files with 1 additions and 51 deletions
|
@ -928,54 +928,6 @@ Function HandlePostInstallOptions
|
||||||
|
|
||||||
FunctionEnd
|
FunctionEnd
|
||||||
|
|
||||||
; StrContains
|
|
||||||
; This function does a case sensitive searches for an occurrence of a substring in a string.
|
|
||||||
; It returns the substring if it is found.
|
|
||||||
; Otherwise it returns null("").
|
|
||||||
; Written by kenglish_hi
|
|
||||||
; Adapted from StrReplace written by dandaman32
|
|
||||||
|
|
||||||
Var STR_HAYSTACK
|
|
||||||
Var STR_NEEDLE
|
|
||||||
Var STR_CONTAINS_VAR_1
|
|
||||||
Var STR_CONTAINS_VAR_2
|
|
||||||
Var STR_CONTAINS_VAR_3
|
|
||||||
Var STR_CONTAINS_VAR_4
|
|
||||||
Var STR_RETURN_VAR
|
|
||||||
|
|
||||||
Function StrContains
|
|
||||||
Exch $STR_NEEDLE
|
|
||||||
Exch 1
|
|
||||||
Exch $STR_HAYSTACK
|
|
||||||
; Uncomment to debug
|
|
||||||
;MessageBox MB_OK 'STR_NEEDLE = $STR_NEEDLE STR_HAYSTACK = $STR_HAYSTACK '
|
|
||||||
StrCpy $STR_RETURN_VAR ""
|
|
||||||
StrCpy $STR_CONTAINS_VAR_1 -1
|
|
||||||
StrLen $STR_CONTAINS_VAR_2 $STR_NEEDLE
|
|
||||||
StrLen $STR_CONTAINS_VAR_4 $STR_HAYSTACK
|
|
||||||
loop:
|
|
||||||
IntOp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_1 + 1
|
|
||||||
StrCpy $STR_CONTAINS_VAR_3 $STR_HAYSTACK $STR_CONTAINS_VAR_2 $STR_CONTAINS_VAR_1
|
|
||||||
StrCmp $STR_CONTAINS_VAR_3 $STR_NEEDLE found
|
|
||||||
StrCmp $STR_CONTAINS_VAR_1 $STR_CONTAINS_VAR_4 done
|
|
||||||
Goto loop
|
|
||||||
found:
|
|
||||||
StrCpy $STR_RETURN_VAR $STR_NEEDLE
|
|
||||||
Goto done
|
|
||||||
done:
|
|
||||||
Pop $STR_NEEDLE ;Prevent "invalid opcode" errors and keep the
|
|
||||||
Exch $STR_RETURN_VAR
|
|
||||||
FunctionEnd
|
|
||||||
|
|
||||||
!macro _StrContainsConstructor OUT NEEDLE HAYSTACK
|
|
||||||
Push `${HAYSTACK}`
|
|
||||||
Push `${NEEDLE}`
|
|
||||||
Call StrContains
|
|
||||||
Pop `${OUT}`
|
|
||||||
!macroend
|
|
||||||
|
|
||||||
!define StrContains '!insertmacro "_StrContainsConstructor"'
|
|
||||||
|
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
; determine admin versus local install
|
; determine admin versus local install
|
||||||
Function un.onInit
|
Function un.onInit
|
||||||
|
@ -984,9 +936,7 @@ Function un.onInit
|
||||||
; If the $EXEPATH does not contain the $TEMP dir, this instance is not the copied one
|
; If the $EXEPATH does not contain the $TEMP dir, this instance is not the copied one
|
||||||
; so we move it to the $TEMP dir and then execute the copied uninstaller.
|
; so we move it to the $TEMP dir and then execute the copied uninstaller.
|
||||||
|
|
||||||
${StrContains} $0 $TEMP $EXEPATH
|
${If} $EXEDIR != $TEMP
|
||||||
|
|
||||||
${If} $0 == "notfound"
|
|
||||||
CopyFiles /SILENT $EXEPATH $TEMP\Uninstall.exe
|
CopyFiles /SILENT $EXEPATH $TEMP\Uninstall.exe
|
||||||
ExecWait '"$Temp\Uninstall.exe" _?=$INSTDIR' $0
|
ExecWait '"$Temp\Uninstall.exe" _?=$INSTDIR' $0
|
||||||
SetErrorLevel $0
|
SetErrorLevel $0
|
||||||
|
|
Loading…
Reference in a new issue