Skip to content
Snippets Groups Projects
Unverified Commit ec758d12 authored by Kali Kaneko's avatar Kali Kaneko
Browse files

[pkg] fix upgrade from 0.20.1

parent c8cadd8b
No related branches found
No related tags found
No related merge requests found
...@@ -56,39 +56,40 @@ RequestExecutionLevel admin ...@@ -56,39 +56,40 @@ RequestExecutionLevel admin
Section "InstallFiles" Section "InstallFiles"
; first we try to delete the helper (it can be the old one or a previous version of the new one) ; first we try to delete the helper (it can be the old one or a previous version of the new one)
DetailPrint "Trying to uninstall any older helper..."
ClearErrors
Delete 'C:\Program Files\$applicationName\bitmask_helper.exe'
DetailPrint "Trying to uninstall new helper..." DetailPrint "Trying to uninstall new helper..."
ClearErrors IfFileExists $INSTDIR\helper.exe 0 +4
ExecWait '"$INSTDIR\helper.exe" stop' ExecWait '"$INSTDIR\helper.exe" stop'
ExecWait '"$INSTDIR\helper.exe" remove' ExecWait '"$INSTDIR\helper.exe" remove'
ClearErrors
Delete 'C:\Program Files\$applicationName\helper.exe' Delete 'C:\Program Files\$applicationName\helper.exe'
;IfErrors 0 noErrorHelper
; uninstalling old nssm helper - could fail if it isn't there, or if nssm is not there... ; uninstalling old nssm helper - could fail if it isn't there, or if nssm is not there...
ClearErrors ClearErrors
DetailPrint "Trying to uninstall an old style helper..." DetailPrint "Trying to uninstall an old style helper..."
IfFileExists $INSTDIR\bitmask_helper.exe 0 +8
ExecWait '"$INSTDIR\nssm.exe" stop $applicationNameLower-helper' ExecWait '"$INSTDIR\nssm.exe" stop $applicationNameLower-helper'
ExecWait '"$INSTDIR\nssm.exe" remove $applicationNameLower-helper confirm' ExecWait '"$INSTDIR\nssm.exe" remove $applicationNameLower-helper confirm'
;IfErrors 0 noErrorHelper ClearErrors
DetailPrint "Failed to stop nssm-style helper, maybe it was not there" Sleep 1000
Delete 'C:\Program Files\$applicationName\bitmask_helper.exe'
IfErrors 0 +2
DetailPrint "Failed to delete nssm-style helper, maybe it was not there"
; let's try to stop it in case it's the new style helper -- we need to do it to be able to overwrite it. ; let's try to stop it in case it's the new style helper -- we need to do it to be able to overwrite it.
; we don't care about errors because if we're upgrading from 0.20.1 this will not work. ; we don't care about errors because if we're upgrading from 0.20.1 this will not work.
ClearErrors ClearErrors
DetailPrint "Trying to uninstall a new style helper..." DetailPrint "Trying to uninstall a new style helper..."
ExecWait '"$INSTDIR\bitmask_helper.exe" stop' IfFileExists $INSTDIR\bitmask_helper.exe 0 +4
;IfErrors 0 noErrorHelper Exec '"$INSTDIR\bitmask_helper.exe" stop'
DetailPrint "Failed to stop new-style helper, maybe it was not there" IfErrors 0 noErrorHelper
DetailPrint "old-style bitmask_helper.exe not present"
;noErrorHelper: GoTo +2
DetailPrint "cannot stop old-style bitmask_helper.exe"
noErrorHelper:
; now we try to delete the systray, locked by the app - just to know if another instance of FoobarVPN is running. ; now we try to delete the systray, locked by the app - just to know if another instance of FoobarVPN is running.
ClearErrors ClearErrors
DetailPrint "Checking for a running systray..." DetailPrint "Checking for a running systray..."
Delete 'C:\Program Files\$applicationName\bitmask-vpn.exe' Delete 'C:\Program Files\$applicationName\bitmask-vpn.exe'
IfErrors 0 noDelError IfErrors 0 noDelError
......
...@@ -31,7 +31,7 @@ login: ...@@ -31,7 +31,7 @@ login:
package_win: clean_win package_win_stage_1 sign_win_uninstaller_in_host package_win_stage_2 sign_win_installer_in_host package_win: clean_win package_win_stage_1 sign_win_uninstaller_in_host package_win_stage_2 sign_win_installer_in_host
clean_win: clean_win:
@rm ../deploy/*.exe @rm -f ../deploy/*.exe
package_win_stage_1: package_win_stage_1:
docker run \ docker run \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment