]> git.lyx.org Git - features.git/blob - development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh
installer: fix a small bug
[features.git] / development / Win32 / packaging / AltInstaller / InstallThirdPartyProgs.nsh
1 # this file contains the installation actions for the third-party programs
2
3 Function Ghostscript
4
5   # if GhostScript is not installed
6   ${if} $GhostscriptPath == ""
7    # register Ghostscript
8    WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_DLL" "${GhostscriptDir}\bin\gsdll32.dll"
9    WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_LIB" "${GhostscriptDir}\lib;${GhostscriptDir}\fonts;${GhostscriptDir}\Resource"
10    
11    WriteRegStr HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
12    StrCpy $GhostscriptPath "${GhostscriptDir}\bin"
13   ${else}
14    # delete unnecessary files
15    RMDir /r ${GhostscriptDir}
16    StrCpy $DelGSDir "Yes" # used later in function ImageMagick
17   ${endif}
18
19 FunctionEnd
20
21 # -------------------------------------------
22
23 Function ImageMagick
24
25   # if ImageMagick is not installed
26   ${if} $ImageMagickPath == ""
27    # register ImageMagick
28    WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
29    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "${ImageMagickDir}"
30    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
31    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "ConfigurePath" "${ImageMagickDir}\config"
32    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "FilterModulesPath" "${ImageMagickDir}\modules\filters"
33    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "LibPath" "${ImageMagickDir}"
34    
35    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "BinPath" "${ImageMagickDir}"
36    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
37    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "ConfigurePath" "${ImageMagickDir}\config"
38    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "${ImageMagickDir}\modules\filters"
39    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "LibPath" "${ImageMagickDir}"
40    WriteRegDWORD HKLM "SOFTWARE\ImageMagick\Current" "QuantumDepth" 0x00000010   
41    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "Version" "${ImageMagickVersion}"
42    
43    WriteRegStr HKLM "Software\ImageMagick" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
44    StrCpy $ImageMagickPath ${ImageMagickDir}
45   ${else}
46    # delete unnecessary files
47    RMDir /r ${ImageMagickDir}
48    # delete the "etc" folder when also the Ghostscript folder was deleted because it is then empty 
49    ${if} $DelGSDir == "Yes"
50     RMDir /r "$INSTDIR\etc"
51    ${endif}
52   ${endif}
53
54 FunctionEnd
55
56 # -------------------------------------------
57
58 Function Aiksaurus
59
60   # if Aiksaurus is not installed
61   ${if} $AiksaurusPath == ""
62    # extract Aiksaurus' program files
63    SetOutPath "$INSTDIR\external"
64    File /r "${PRODUCT_SOURCEDIR}\${AiksaurusInstall}"
65    # copy the files and register Aiksaurus
66    CopyFiles "$INSTDIR\${AiksaurusInstall}" "$APPDATA"
67 #   WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
68 #   WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
69   ${endif}
70
71 FunctionEnd
72
73 # -------------------------------------------
74
75 !if ${INSTALLER_VERSION} == "Complete"
76
77  Function PostScript
78
79   # if no PostScript viewer is installed
80   ${if} $PSVPath == ""
81    ${if} $InstallGSview == "true"
82     # launch installer
83     MessageBox MB_OK|MB_ICONINFORMATION "$(GSviewInfo)"
84     ExecWait "$INSTDIR\${GSviewInstall}"
85     # test if GSview is installed
86     StrCpy $PSVPath ""
87     ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"    
88     ${if} $PSVPath == ""
89      MessageBox MB_OK|MB_ICONEXCLAMATION "$(GSviewError)"
90     ${endif}
91    ${endif}
92   ${endif}
93
94  FunctionEnd
95
96 !endif # endif ${INSTALLER_VERSION} == "Complete"
97
98 # -------------------------------------------
99
100 !if ${INSTALLER_VERSION} == "Complete"
101
102  Function BibTeX
103
104   # if no BibTeX editor is installed
105   ${if} $BibTeXEditorPath == ""
106    ${if} $InstallJabRef == "true"
107     # launch installer
108     MessageBox MB_OK|MB_ICONINFORMATION "$(JabRefInfo)"
109     ExecWait "$INSTDIR\${JabRefInstall}"
110     # test if JabRef is installed
111     StrCpy $BibTeXEditorPath ""
112     ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "UninstallString"    
113     ${if} $BibTeXEditorPath == ""
114      MessageBox MB_OK|MB_ICONEXCLAMATION "$(JabRefError)"
115     ${else}
116      WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
117     ${endif}
118    ${endif}
119   ${endif}
120
121  FunctionEnd
122
123 !endif # endif ${INSTALLER_VERSION} == "Complete"
124