!include LogicLib.nsh
!include FileFunc.nsh
!include StrFunc.nsh
-!insertmacro GetParameters
-!insertmacro GetParent
${StrStr}
# Configuration from installer
Push "$LyXFolder\aiksaurus"
Call SetEnvironmentVariable
- # Location of Ghostscript
+ # Location of Ghostscript (for ImageMagick)
Push LYX_GHOSTSCRIPT_EXE
- Push "$LyXFolder\ghostscript\bin\gswin32c.exe"
+ Push "$LyXFolder\ghostscript\gswin32c.exe"
Call SetEnvironmentVariable
Push LYX_GHOSTSCRIPT_DLL
- Push "$LyXFolder\ghostscript\bin\gsdll32.dll"
+ Push "$LyXFolder\ghostscript\gsdll32.dll"
Call SetEnvironmentVariable
- Push LYX_GHOSTSCRIPT_FONTS
- Push "$LyXFolder\ghostscript\fonts"
- Call SetEnvironmentVariable
-
- # Ghostscript resources
- Push GS_DLL
- Push "$LyXFolder\ghostscript\bin\gsdll32.dll"
- Call SetEnvironmentVariable
- Push GS_LIB
- Push "$LyXFolder\ghostscript\lib;$LyXFolder\ghostscript\fonts;$LyXFolder\ghostscript\Resource"
- Call SetEnvironmentVariable
-
+
SectionEnd
Section -Launch
Function InitInterface
#Command line parameters
- Call GetParameters
- Pop $Parameters
+ ${GetParameters} $Parameters
#Check for debug mode
${StrStr} $R0 $Parameters "-dbg"
# CTAN and SourceForge select a mirror automatically
!define DOWNLOAD_LATEX "http://www.ctan.org/get/systems/win32/miktex/setup/${SETUPFILE_LATEX}"
-!define DOWNLOADALT_LATEX "http://www.ctan.org/get/systems/win32/miktex/setup/${SETUPFILE_LATEX}"
-
!define DOWNLOAD_IMAGEMAGICK "http://downloads.sourceforge.net/imagemagick/${SETUPFILE_IMAGEMAGICK}"
-!define DOWNLOADALT_IMAGEMAGICK "http://downloads.sourceforge.net/imagemagick/${SETUPFILE_IMAGEMAGICK}"
-
!define DOWNLOAD_GHOSTSCRIPT "http://downloads.sourceforge.net/imagemagick/${SETUPFILE_GHOSTSCRIPT}"
-!define DOWNLOADALT_GHOSTSCRIPT "http://downloads.sourceforge.net/imagemagick/${SETUPFILE_GHOSTSCRIPT}"
-
!define DOWNLOAD_ASPELLDICTS "ftp://ftp.lyx.org/pub/lyx/contrib/aspell6-windows"
-!define DOWNLOADALT_ASPELLDICTS "http://www.lyx.org/~bpeng/aspell6-windows"
#--------------------------------
# Locations of setup files for components (for bundled setup)
!include LogicLib.nsh
!include FileFunc.nsh
-# Functions from FileFunc.nsh
-!insertmacro GetParameters
-!insertmacro GetFileName
-!insertmacro GetParent
-
#--------------------------------
# Settings
Var OriginalDir
Var PDFFile
+Var ViewerFileName
Var Viewer
Var ChangeNotification
# Check whether the file will be opened with Adobe Reader or Adobe Acrobat
!insertmacro SystemCall "shell32::FindExecutable(t '$OriginalFile', t '', t .s)"
- Call GetFileName
- Pop $Viewer
+ Pop $ViewerFileName
+ ${GetFileName} $ViewerFileName $Viewer
${If} $Viewer == ""
MessageBox MB_OK|MB_ICONEXCLAMATION "No PDF viewer is installed. \