From f349f6a9b9a7b56a14512bab6d58b2a8fceb7f94 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Mon, 26 Feb 2018 08:41:10 -0600 Subject: [PATCH] Fix #456 & #461 (#491) * Update setup.nsi - Always display all language choices to fix #461 - Stop recursively removing installation directory as that is not a safe operation. This may leave the installation directory after uninstallation but should be empty. Fix #456. * Update requirements-windows.txt - Add pypiwin32 for cx-freeze as it was issuing a warning - Prevent version 5.1.0 of cx-freeze as it produces non-working packages for some reason. Version 5.0.2 and 6.0b1 work fine. * Update setup to delete correct files Installer will now delete the files in the installation folder along with the folder if it is empty. Bumped minimum cx-Freeze version to 5.1.1 as files are structured differently in older versions. --- requirements-windows.txt | 3 ++- setup.nsi | 21 +++++++++++++++------ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/requirements-windows.txt b/requirements-windows.txt index ebd54dc4..a433328e 100644 --- a/requirements-windows.txt +++ b/requirements-windows.txt @@ -1,2 +1,3 @@ PyQt5 >=5.4,<6.0 -cx-Freeze>=5.0.2,<6.0.0 +cx-Freeze>=5.1.1 +pypiwin32>=200 \ No newline at end of file diff --git a/setup.nsi b/setup.nsi index ce2f3d84..289b7ebd 100644 --- a/setup.nsi +++ b/setup.nsi @@ -222,12 +222,19 @@ Section "Uninstall" !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder RMDir /r "$SMPROGRAMS\$StartMenuFolder" - ; Delete the Install Directory and vendor directory (if empty) - Push $R0 - RMDir /r "$INSTDIR" ;NSIS seems to recomend against this... look into options - ${GetParent} "$INSTDIR" $R0 - RMDir $R0 - Pop $R0 + ; Remove Files & Folders in Install Folder + RMDir /r "$INSTDIR\help" + RMDir /r "$INSTDIR\imageformats" + RMDir /r "$INSTDIR\lib" + RMDir /r "$INSTDIR\locale" + RMDir /r "$INSTDIR\platforms" + Delete "$INSTDIR\dupeguru.exe" + Delete "$INSTDIR\python36.dll" + Delete "$INSTDIR\sqlite3.dll" + Delete "$INSTDIR\Uninstall.exe" + + ; Remove Install Folder if empty + RMDir "$INSTDIR" ; Remove registry keys and vendor keys (if empty) DeleteRegKey SHCTX "${BASEREGKEY}" @@ -246,6 +253,8 @@ Function .onInit SetRegView 32 !endif !insertmacro MULTIUSER_INIT + ; it appears that the languages shown may not always be filtered correctly + !define MUI_LANGDLL_ALLLANGUAGES !insertmacro MUI_LANGDLL_DISPLAY FunctionEnd