From ce7d2b97d289b1f48a4558926bf716685b3452fc Mon Sep 17 00:00:00 2001 From: max Date: Sat, 26 Sep 2026 22:09:40 +0200 Subject: [PATCH] windows installer fixes --- compilation/installer_client.iss | 15 ++++++++++++++- compilation/installer_client.nsi | 1 + compilation/installer_server.iss | 15 ++++++++++++++- compilation/installer_server.nsi | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/compilation/installer_client.iss b/compilation/installer_client.iss index bc2dd5d..d531e88 100644 --- a/compilation/installer_client.iss +++ b/compilation/installer_client.iss @@ -108,7 +108,8 @@ end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); var - CustomDataDir: String; + CustomDataDir, AppDir: String; + I: Integer; begin if CurUninstallStep = usPostUninstall then begin @@ -118,5 +119,17 @@ begin DelTree(CustomDataDir, True, True, True); RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'Software\LOGAR\LOGAR-Client'); end; + + AppDir := ExpandConstant('{app}'); + if (AppDir <> '') and DirExists(AppDir) then + begin + for I := 1 to 5 do + begin + if DeleteFile(AppDir + '\nssm.exe') or not FileExists(AppDir + '\nssm.exe') then + Break; + Sleep(250); + end; + DelTree(AppDir, True, True, True); + end; end; end; diff --git a/compilation/installer_client.nsi b/compilation/installer_client.nsi index 5683dd5..cac5147 100644 --- a/compilation/installer_client.nsi +++ b/compilation/installer_client.nsi @@ -140,6 +140,7 @@ Section "Uninstall" ExecWait '"$INSTDIR\nssm.exe" stop LOGAR_Client' ExecWait '"$INSTDIR\nssm.exe" remove LOGAR_Client confirm' + Sleep 500 RMDir /r "$INSTDIR\runtime" RMDir /r "$INSTDIR\certs" Delete "$INSTDIR\client_config.json" diff --git a/compilation/installer_server.iss b/compilation/installer_server.iss index 1f57de3..088e6c1 100644 --- a/compilation/installer_server.iss +++ b/compilation/installer_server.iss @@ -84,7 +84,8 @@ end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); var - CustomDataDir: String; + CustomDataDir, AppDir: String; + I: Integer; begin if CurUninstallStep = usPostUninstall then begin @@ -94,5 +95,17 @@ begin DelTree(CustomDataDir, True, True, True); RegDeleteKeyIncludingSubkeys(HKEY_LOCAL_MACHINE, 'Software\LOGAR\LOGAR-Server'); end; + + AppDir := ExpandConstant('{app}'); + if (AppDir <> '') and DirExists(AppDir) then + begin + for I := 1 to 5 do + begin + if DeleteFile(AppDir + '\nssm.exe') or not FileExists(AppDir + '\nssm.exe') then + Break; + Sleep(250); + end; + DelTree(AppDir, True, True, True); + end; end; end; diff --git a/compilation/installer_server.nsi b/compilation/installer_server.nsi index 24042bc..24ef49c 100644 --- a/compilation/installer_server.nsi +++ b/compilation/installer_server.nsi @@ -90,6 +90,7 @@ Section "Uninstall" ExecWait '"$INSTDIR\nssm.exe" stop LOGAR_Server' ExecWait '"$INSTDIR\nssm.exe" remove LOGAR_Server confirm' + Sleep 500 RMDir /r "$INSTDIR\runtime" RMDir /r "$INSTDIR\certs" Delete "$INSTDIR\server_config.json"