mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
[desktop] Improve NSIS migration installer
This commit is contained in:
parent
0200404eac
commit
161b75e39e
1 changed files with 12 additions and 3 deletions
|
@ -6,7 +6,6 @@ var oldInstallationDir
|
||||||
var dataDir
|
var dataDir
|
||||||
|
|
||||||
!macro NSIS_HOOK_PREINSTALL
|
!macro NSIS_HOOK_PREINSTALL
|
||||||
|
|
||||||
; Abort if old service is running
|
; Abort if old service is running
|
||||||
SimpleSC::ServiceIsStopped "PortmasterCore"
|
SimpleSC::ServiceIsStopped "PortmasterCore"
|
||||||
Pop $0
|
Pop $0
|
||||||
|
@ -65,12 +64,14 @@ var dataDir
|
||||||
SimpleSC::InstallService "PortmasterCore" "Portmaster Core" "16" "2" "$INSTDIR\portmaster-core.exe --log-dir=%PROGRAMDATA%\Portmaster\logs" "" "" ""
|
SimpleSC::InstallService "PortmasterCore" "Portmaster Core" "16" "2" "$INSTDIR\portmaster-core.exe --log-dir=%PROGRAMDATA%\Portmaster\logs" "" "" ""
|
||||||
Pop $0 ; returns error code (0 on success)
|
Pop $0 ; returns error code (0 on success)
|
||||||
${If} $0 != 0
|
${If} $0 != 0
|
||||||
SimpleSC::GetErrorMessage $installErr
|
SimpleSC::GetErrorMessage $0
|
||||||
Pop $0
|
Pop $0
|
||||||
MessageBox MB_OK "Service creation failed. Error: $errorMsg"
|
MessageBox MB_OK "Service creation failed. Error: $0"
|
||||||
Abort
|
Abort
|
||||||
${EndIf}
|
${EndIf}
|
||||||
|
|
||||||
|
SimpleSC::SetServiceDescription "PortmasterCore" "Portmaster Application Firewall - Core Service"
|
||||||
|
|
||||||
StrCpy $oldInstallationDir "$COMMONPROGRAMDATA\Safing\Portmaster"
|
StrCpy $oldInstallationDir "$COMMONPROGRAMDATA\Safing\Portmaster"
|
||||||
StrCpy $dataDir "$COMMONPROGRAMDATA\Portmaster"
|
StrCpy $dataDir "$COMMONPROGRAMDATA\Portmaster"
|
||||||
|
|
||||||
|
@ -96,6 +97,14 @@ var dataDir
|
||||||
RMDir /r "$SMPROGRAMS\Portmaster"
|
RMDir /r "$SMPROGRAMS\Portmaster"
|
||||||
Delete "$SMSTARTUP\Portmaster Notifier.lnk"
|
Delete "$SMSTARTUP\Portmaster Notifier.lnk"
|
||||||
|
|
||||||
|
; Delete v1 uninstaller
|
||||||
|
Delete "$oldInstallationDir\portmaster-uninstaller.exe"
|
||||||
|
|
||||||
|
; Delete v1 user shortuct if there.
|
||||||
|
SetShellVarContext current
|
||||||
|
Delete "$AppData\Microsoft\Windows\Start Menu\Programs\Portmaster.lnk"
|
||||||
|
SetShellVarContext all
|
||||||
|
|
||||||
Finish:
|
Finish:
|
||||||
|
|
||||||
!macroend
|
!macroend
|
||||||
|
|
Loading…
Add table
Reference in a new issue