]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/installer/components/viewer.nsh
Change windows installer comments from ; to #
[lyx.git] / development / Win32 / packaging / installer / components / viewer.nsh
1 /*
2
3 Option to download GSView (PDF/Postscript viewer)
4
5 */
6
7 #--------------------------------
8 #Sections
9
10 Section -Viewer ExternalViewer
11   !insertmacro ExternalComponent Viewer
12 SectionEnd
13
14 #--------------------------------
15 #Functions
16
17 Function InitSizeViewer
18
19   #Get size of viewer installer
20  
21   SectionGetSize ${ExternalViewer} $SizeViewer
22   
23   !ifndef SETUPTYPE_BUNDLE
24     #Add download size
25     IntOp $SizeViewer $SizeViewer + ${SIZE_DOWNLOAD_VIEWER}
26   !endif
27   
28 FunctionEnd
29
30 #--------------------------------
31 #Page functions
32
33 Function PageViewer
34
35   #Show page if no viewer is installed, the user has Power User or Administrator priviledges and
36   #Ghostscript is installed or will be installed
37
38   ${if} $AdminOrPowerUser == ${FALSE}
39   ${orif} $PathViewer == "associated"
40     Abort
41   ${endif}
42
43   ${if} $PathGhostscript == ""
44   ${andif} $SetupGhostscript == ${FALSE}
45     !insertmacro SetComponentState $R0 Viewer
46     Abort
47   ${endif}
48
49   !insertmacro MUI_HEADER_TEXT $(TEXT_VIEWER_TITLE) $(TEXT_VIEWER_SUBTITLE)
50   !insertmacro MUI_INSTALLOPTIONS_DISPLAY "viewer.ini"
51
52 FunctionEnd
53
54 Function PageViewerValidate
55
56   #Download?
57   !insertmacro MUI_INSTALLOPTIONS_READ $R0 "viewer.ini" "Field 2" "State"
58   !insertmacro SetComponentState $R0 Viewer
59
60 FunctionEnd