lyx_mirror/development/Win32/packaging/installer/components/viewer.nsh
Uwe Stöhr c8639179da - reupload LyXWinInstaller for code verification as discussed with Bo
- set missing EOL flags for official installer files

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17116 a592a061-630c-0410-9148-cb99ea01b6c8
2007-02-08 21:09:30 +00:00

61 lines
1.2 KiB
Plaintext

/*
Option to download GSView (PDF/Postscript viewer)
*/
;--------------------------------
;Sections
Section -Viewer ExternalViewer
!insertmacro ExternalComponent Viewer
SectionEnd
;--------------------------------
;Functions
Function InitSizeViewer
;Get size of viewer installer
SectionGetSize ${ExternalViewer} $SizeViewer
!ifndef SETUPTYPE_BUNDLE
;Add download size
IntOp $SizeViewer $SizeViewer + ${SIZE_DOWNLOAD_VIEWER}
!endif
FunctionEnd
;--------------------------------
;Page functions
Function PageViewer
;Show page if no viewer is installed, the user has Power User or Administrator priviledges and
;Ghostscript is installed or will be installed
${if} $AdminOrPowerUser == ${FALSE}
${orif} $PathViewer == "associated"
Abort
${endif}
${if} $PathGhostscript == ""
${andif} $SetupGhostscript == ${FALSE}
!insertmacro SetComponentState $R0 Viewer
Abort
${endif}
!insertmacro MUI_HEADER_TEXT $(TEXT_VIEWER_TITLE) $(TEXT_VIEWER_SUBTITLE)
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "viewer.ini"
FunctionEnd
Function PageViewerValidate
;Download?
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "viewer.ini" "Field 2" "State"
!insertmacro SetComponentState $R0 Viewer
FunctionEnd