Uwe Stöhr wrote:
> Hello Angus,
>
> I received a report that the installer doesn't find an installed GPL
> ghostscript. We currently check only for AFPL ghostscript.
>
> Patch attached, please apply.
Ok, done. However, it looks to me like some refactoring would make like
nicer. Could you try out the attached patch (against current CVS/your
patched version) which simply moves the EnumRegKey stuff into a separate
function.
I'm not near a Windows box today or I would do it myself.
> regards Uwe
--
Angus
? lyx_installer.diff
Index: lyx_installer.nsi
===================================================================
RCS file:
/usr/local/lyx/cvsroot/lyx-devel/development/Win32/packaging/installer/lyx_installer.nsi,v
retrieving revision 1.1.2.19
diff -u -p -r1.1.2.19 lyx_installer.nsi
--- lyx_installer.nsi 17 Jun 2005 08:52:01 -0000 1.1.2.19
+++ lyx_installer.nsi 17 Jun 2005 08:54:14 -0000
@@ -513,7 +513,7 @@ FunctionEnd
;--------------------------------
-Function SearchGhostscript
+Function SearchGhostscriptRegKey
; Find which version of ghostscript, if any, is installed.
EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
${if} $1 == ""
@@ -530,6 +530,13 @@ Function SearchGhostscript
StrCpy $0 ""
${endif}
+ Push $0
+FunctionEnd
+
+Function SearchGhostscript
+ Call SearchGhostscriptRegKey
+ Pop $0
+
${SearchRegistry} \
$GhostscriptPath \
"$0" \
@@ -542,21 +549,8 @@ Function DownloadGhostscript
StrCpy $DoNotRequireGhostscript "1"
StrCpy $DownloadGhostscript "0"
- ; Find which version of ghostscript, if any, is installed.
- EnumRegKey $1 HKLM "Software\AFPL Ghostscript" 0
- ${if} $1 == ""
- EnumRegKey $1 HKLM "Software\GPL Ghostscript" 0
- StrCpy $2 "True"
- ${endif}
- ${if} $1 != ""
- ${if} $2 == "True"
- StrCpy $0 "Software\GPL Ghostscript\$1"
- ${else}
- StrCpy $0 "Software\AFPL Ghostscript\$1"
- ${endif}
- ${else}
- StrCpy $0 ""
- ${endif}
+ Call SearchGhostscriptRegKey
+ Pop $0
${DownloadEnter} \
$GhostscriptPath \