summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'psi/nsisinst.nsi')
-rw-r--r--psi/nsisinst.nsi34
1 files changed, 29 insertions, 5 deletions
diff --git a/psi/nsisinst.nsi b/psi/nsisinst.nsi
index 404747b5..3c141da3 100644
--- a/psi/nsisinst.nsi
+++ b/psi/nsisinst.nsi
@@ -1,4 +1,4 @@
-; Copyright (C) 2001-2021 Artifex Software, Inc.
+; Copyright (C) 2001-2022 Artifex Software, Inc.
; All Rights Reserved.
;
; This software is provided AS-IS with no warranty, either express or
@@ -43,6 +43,8 @@ SetCompressor /SOLID /FINAL lzma
XPStyle on
CRCCheck on
+Var RebootRequired
+
; the following is from: http://nsis.sourceforge.net/StrRep
!define StrRep "!insertmacro StrRep"
!macro StrRep output string old new
@@ -141,7 +143,7 @@ FunctionEnd
!define MUI_FINISHPAGE_RUN_TEXT "Generate cidfmap for Windows CJK TrueType fonts"
!define MUI_FINISHPAGE_RUN_FUNCTION CJKGen
; !define MUI_FINISHPAGE_RUN_NOTCHECKED
-!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\Readme.htm"
+; !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\doc\Readme.htm"
; MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_LINK "Visit the Ghostscript web site"
!define MUI_FINISHPAGE_LINK_LOCATION http://www.ghostscript.com/
@@ -159,7 +161,6 @@ Page custom OldVersionsPageCreate
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
@@ -174,6 +175,13 @@ Function OldVersionsPageCreate
FunctionEnd
+Function RedistInstCreate
+ ExecWait '"$INSTDIR\${VCREDIST}" /norestart /install /quiet' $0
+ ${If} $0 == 3010
+ StrCpy $RebootRequired "yes"
+ ${EndIf}
+FunctionEnd
+
!searchparse /ignorecase /noerrors "${TARGET}" w WINTYPE
!echo "Building ${WINTYPE}-bit installer"
@@ -230,6 +238,8 @@ File /oname=bin\gsdll${WINTYPE}.lib .\bin\gsdll${WINTYPE}.lib
File /oname=bin\gswin${WINTYPE}.exe .\bin\gswin${WINTYPE}.exe
File /oname=bin\gswin${WINTYPE}c.exe .\bin\gswin${WINTYPE}c.exe
+File /oname=${VCREDIST} .\${VCREDIST}
+
!if "${WINTYPE}" == "64"
SetRegView 64
!endif
@@ -254,6 +264,9 @@ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GPL Ghos
; write out uninstaller
WriteUninstaller "$INSTDIR\uninstgs.exe"
+
+Call RedistInstCreate
+
SectionEnd ; end of default section
Function .onInstSuccess
@@ -261,10 +274,19 @@ Function .onInstSuccess
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\Ghostscript"
CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript ${VERSION}.LNK" "$INSTDIR\bin\gswin${WINTYPE}.exe" '"-I$INSTDIR\lib;$INSTDIR\..\fonts"'
- CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK" "$INSTDIR\doc\Readme.htm"
+; CreateShortCut "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK" "$INSTDIR\doc\Readme.htm"
CreateShortCut "$SMPROGRAMS\Ghostscript\Uninstall Ghostscript ${VERSION}.LNK" "$INSTDIR\uninstgs.exe"
FunctionEnd
+Function .onGUIEnd
+ StrCmp $RebootRequired "yes" doit
+ Goto done
+ doit:
+ MessageBox MB_YESNO|MB_ICONQUESTION "Do you wish to reboot the system?" IDNO +2
+ Reboot
+ done:
+FunctionEnd
+
Function CJKGen
${StrRep} $0 "$FONTS" "\" "/"
${StrRep} $1 "$INSTDIR\lib\cidfmap" "\" "/"
@@ -273,6 +295,7 @@ Function CJKGen
FunctionEnd
Function .onInit
+ StrCpy $RebootRequired "no"
!if "${WINTYPE}" == "64"
SetRegView 64
${IfNot} ${RunningX64}
@@ -301,7 +324,7 @@ Section Uninstall
; add delete commands to delete whatever files/registry keys/etc you installed here.
SetShellVarContext all
Delete "$SMPROGRAMS\Ghostscript\Ghostscript ${VERSION}.LNK"
-Delete "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK"
+; Delete "$SMPROGRAMS\Ghostscript\Ghostscript Readme ${VERSION}.LNK"
Delete "$SMPROGRAMS\Ghostscript\Uninstall Ghostscript ${VERSION}.LNK"
RMDir "$SMPROGRAMS\Ghostscript"
Delete "$INSTDIR\uninstgs.exe"
@@ -320,6 +343,7 @@ Delete "$INSTDIR\bin\gsdll${WINTYPE}.dll"
Delete "$INSTDIR\bin\gsdll${WINTYPE}.lib"
Delete "$INSTDIR\bin\gswin${WINTYPE}.exe"
Delete "$INSTDIR\bin\gswin${WINTYPE}c.exe"
+Delete "$INSTDIR\${VCREDIST}"
RMDir "$INSTDIR\bin"
RMDir "$INSTDIR"
!if "${WINTYPE}" == "64"