]> git.lyx.org Git - lyx.git/blob - development/Win32/packaging/AltInstaller/InstallThirdPartyProgs.nsh
move the LyXWinInstaller directory one step up in the hierarchy and rename it to...
[lyx.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   ${endif}
17
18 FunctionEnd
19
20 # -------------------------------------------
21
22 Function ImageMagick
23
24   # if ImageMagick is not installed
25   ${if} $ImageMagickPath == ""
26    # register ImageMagick
27    WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
28    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "BinPath" "${ImageMagickDir}"
29    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
30    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "ConfigurePath" "${ImageMagickDir}\config"
31    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "FilterModulesPath" "${ImageMagickDir}\modules\filters"
32    WriteRegStr HKLM "SOFTWARE\ImageMagick\${ImageMagickVersion}\Q:16" "LibPath" "${ImageMagickDir}"
33    
34    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "BinPath" "${ImageMagickDir}"
35    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "CoderModulesPath" "${ImageMagickDir}\modules\coders"
36    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "ConfigurePath" "${ImageMagickDir}\config"
37    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "FilterModulesPath" "${ImageMagickDir}\modules\filters"
38    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "LibPath" "${ImageMagickDir}"
39    WriteRegDWORD HKLM "SOFTWARE\ImageMagick\Current" "QuantumDepth" 0x00000010   
40    WriteRegStr HKLM "SOFTWARE\ImageMagick\Current" "Version" "${ImageMagickVersion}"
41    
42    WriteRegStr HKLM "Software\ImageMagick" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
43    StrCpy $ImageMagickPath ${ImageMagickDir}
44   ${else}
45    # delete unnecessary files
46    RMDir /r ${ImageMagickDir}
47   ${endif}
48
49 FunctionEnd
50
51 # -------------------------------------------
52
53 Function Aiksaurus
54
55   # if Aiksaurus is not installed
56   ${if} $AiksaurusPath == ""
57    # extract Aiksaurus' program files
58    SetOutPath "$INSTDIR\external"
59    File /r "${PRODUCT_SOURCEDIR}\${AiksaurusInstall}"
60    # copy the files and register Aiksaurus
61    CopyFiles "$INSTDIR\${AiksaurusInstall}" "$APPDATA"
62 #   WriteRegStr HKLM "Software\Aiksaurus" "OnlyWithLyX" "Yes${PRODUCT_VERSION_SHORT}" # special entry to tell the uninstaller that it was installed with LyX
63 #   WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
64   ${endif}
65
66 FunctionEnd
67
68 # -------------------------------------------
69
70 !if ${INSTALLER_VERSION} == "Complete"
71
72  Function PostScript
73
74   # if no PostScript viewer is installed
75   ${if} $PSVPath == ""
76    ${if} $InstallGSview == "true"
77     # launch installer
78     MessageBox MB_OK|MB_ICONINFORMATION "$(GSviewInfo)"
79     ExecWait "$INSTDIR\${GSviewInstall}"
80     # test if GSview is installed
81     StrCpy $PSVPath ""
82     ReadRegStr $PSVPath HKLM "Software\Microsoft\Windows\CurrentVersion\App Paths\gsview32.exe" "Path"    
83     ${if} $PSVPath == ""
84      MessageBox MB_OK|MB_ICONEXCLAMATION "$(GSviewError)"
85     ${endif}
86    ${endif}
87   ${endif}
88
89  FunctionEnd
90
91 !endif # endif ${INSTALLER_VERSION} == "Complete"
92
93 # -------------------------------------------
94
95 !if ${INSTALLER_VERSION} == "Complete"
96
97  Function BibTeX
98
99   # if no BibTeX editor is installed
100   ${if} $BibTeXEditorPath == ""
101    ${if} $InstallJabRef == "true"
102     # launch installer
103     MessageBox MB_OK|MB_ICONINFORMATION "$(JabRefInfo)"
104     ExecWait "$INSTDIR\${JabRefInstall}"
105     # test if JabRef is installed
106     StrCpy $BibTeXEditorPath ""
107     ReadRegStr $BibTeXEditorPath HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "UninstallString"    
108     ${if} $BibTeXEditorPath == ""
109      MessageBox MB_OK|MB_ICONEXCLAMATION "$(JabRefError)"
110     ${else}
111      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
112     ${endif}
113    ${endif}
114   ${endif}
115
116  FunctionEnd
117
118 !endif # endif ${INSTALLER_VERSION} == "Complete"
119