2011-05-23 04:12:10 +00:00
|
|
|
Function LatexFolder
|
|
|
|
|
2011-08-19 14:08:59 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_EXTRACT "gui\io_latex.ini"
|
2011-05-23 04:12:10 +00:00
|
|
|
# generate the installer page
|
|
|
|
!insertmacro MUI_HEADER_TEXT "$(EnterLaTeXHeader1)" "$(EnterLaTeXHeader2)"
|
|
|
|
${if} $LatexName != ""
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 1" "Text" "$(EnterLaTeXFolder)"
|
2011-05-23 04:12:10 +00:00
|
|
|
${else}
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 1" "Text" "$(EnterLaTeXFolderNone)"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 2" "Text" "$(PathName)"
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $PathLaTeX == ""
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 3" "State" "C:\" # Does \" quote a "?
|
2011-05-23 04:12:10 +00:00
|
|
|
${else}
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 3" "State" "$PathLaTeX"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 4" "Text" "$(DontUseLaTeX)"
|
|
|
|
!insertmacro INSTALLOPTIONS_WRITE "gui\io_latex.ini" "Field 4" "State" "$State"
|
2011-05-23 04:12:10 +00:00
|
|
|
AgainFolder:
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_DISPLAY "gui\io_latex.ini"
|
|
|
|
!insertmacro INSTALLOPTIONS_READ "$State" "gui\io_latex.ini" "Field 4" "State" # read checkbox if LaTeX should be used, "0" or not "1"
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $State == "1"
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
Goto ReadyFolder
|
|
|
|
${endif}
|
2011-08-19 21:17:29 +00:00
|
|
|
!insertmacro INSTALLOPTIONS_READ "$PathLaTeX" "gui\io_latex.ini" "Field 3" "State"
|
2011-05-23 04:12:10 +00:00
|
|
|
# check if the latex.exe exists in the $PathLaTeX folder
|
|
|
|
!insertmacro FileCheck $5 "latex.exe" "$PathLaTeX"
|
|
|
|
${if} $5 == "False"
|
|
|
|
MessageBox MB_RETRYCANCEL "$(InvalidLaTeXFolder)" IDRETRY AgainFolder
|
|
|
|
StrCpy $PathLaTeX ""
|
|
|
|
${endif}
|
|
|
|
ReadyFolder:
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function LatexFolder_LeaveFunction
|
|
|
|
|
|
|
|
FunctionEnd
|