lyx_mirror/development/Win32/packaging/installer/components/viewer.nsh
Joost Verburg 3e5373de28 new Windows installer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@14420 a592a061-630c-0410-9148-cb99ea01b6c8
2006-07-12 11:03:00 +00:00

61 lines
1.3 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