[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1961-ge056194

[email protected] (Chris Liddell) Mon, 25 Nov 2019 12:00:43 +0000 (UTC)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  e056194328312f724089d52398e88c5a6a2fe277 (commit)
      from  e9ff39ee82680ea1719ddf99cf3809e26df0c946 (commit)

----------------------------------------------------------------------
commit e056194328312f724089d52398e88c5a6a2fe277
Author: Chris Liddell <[email protected]>
Date:   Fri Nov 22 15:31:47 2019 +0000

    Windows installer: offer to uninstall previous installations
    
    If the installer detects previous gs installations (from the registry keys), an
    additional page will appear in the installer, giving the user the option of
    uninstalling each existing installation in turn - it allows uninstall a given
    install, not uninstall it, or cancel out of uninstalling the remaining ones.

diff --git a/psi/nsisinst.nsi b/psi/nsisinst.nsi
index cc6df99..5c27255 100644
--- a/psi/nsisinst.nsi
+++ b/psi/nsisinst.nsi
@@ -128,6 +128,9 @@ CRCCheck on
 !define MUI_FINISHPAGE_LINK_LOCATION http://www.ghostscript.com/
 
 !insertmacro MUI_PAGE_WELCOME
+
+Page custom OldVersionsPageCreate
+
 !insertmacro MUI_PAGE_LICENSE "LICENSE"
 !insertmacro MUI_PAGE_DIRECTORY
 !insertmacro MUI_PAGE_INSTFILES
@@ -135,6 +138,23 @@ CRCCheck on
 
 !insertmacro MUI_LANGUAGE "English"
 
+Function OldVersionsPageCreate
+  !insertmacro MUI_HEADER_TEXT "Previous Ghostscript Installations" "Optionally run the uninstallers for previous Ghostscript installations$\nClick $\"Cancel$\" to stop uninstalling previous installs"
+
+  StrCpy $0 0
+  loop:
+    EnumRegKey $1 HKLM "Software\Artifex\GPL Ghostscript" $0
+    StrCmp $1 "" done
+    IntOp $0 $0 + 1
+    MessageBox MB_YESNOCANCEL|MB_ICONQUESTION "Uninstall Ghostscript Version $1?" IDNO loop IDCANCEL done
+    Var /GLOBAL uninstexe
+    ReadRegStr $uninstexe HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghostscript $1" "UninstallString"
+    ExecWait "$uninstexe"
+    Goto loop
+  done:
+
+FunctionEnd
+
 !searchparse /ignorecase /noerrors "${TARGET}" w WINTYPE
 !echo "Building ${WINTYPE}-bit installer"
 
@@ -239,10 +259,11 @@ Function .onInit
         Abort
     ${EndIf}
 !endif
-    System::Call 'kernel32::CreateMutexA(i 0, i 0, t "GhostscriptInstaller") i .r1 ?e'
+
+    System::Call 'kernel32::CreateMutexA(i 0, i 0, t "Ghostscript${VERSION}Installer") i .r1 ?e'
     Pop $R0
     StrCmp $R0 0 +3
-    MessageBox MB_OK "The Ghostscript installer is already running." /SD IDOK
+    MessageBox MB_OK "The Ghostscript ${VERSION} installer is already running." /SD IDOK
     Abort
 FunctionEnd
 


Summary of changes:
 psi/nsisinst.nsi | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)