2007-02-08 21:09:30 +00:00
|
|
|
/*
|
|
|
|
|
|
|
|
Install type setting (current user/all users)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#--------------------------------
|
|
|
|
#Macros
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
# COMPONENT can be LaTeX ImageMagick and Ghostscript
|
2007-02-08 21:09:30 +00:00
|
|
|
!macro GetDirExternal COMPONENT
|
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
# APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup"
|
|
|
|
# where ${APP_NAME}${APP_SERIES_KEY} is something like LyX15
|
2007-02-08 21:09:30 +00:00
|
|
|
ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path"
|
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
# BIN_LATEX etc are defined in settings.nsh
|
2007-02-08 21:09:30 +00:00
|
|
|
${if} ${FileExists} "$R0\${BIN_${COMPONENT}}"
|
|
|
|
|
|
|
|
${if} $R0 != ""
|
2007-03-23 02:03:42 +00:00
|
|
|
# define variables like PathLATEX
|
2007-02-08 21:09:30 +00:00
|
|
|
StrCpy $Path${COMPONENT} $R0
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
!macroend
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#--------------------------------
|
|
|
|
#Functions
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
Function InitUser
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#Get directories from registry
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY}" ""
|
|
|
|
|
|
|
|
${if} $R0 != ""
|
|
|
|
StrCpy $INSTDIR $R0
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
!insertmacro GetDirExternal LaTeX
|
|
|
|
!insertmacro GetDirExternal ImageMagick
|
|
|
|
!insertmacro GetDirExternal Ghostscript
|
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
# Set directories in dialogs
|
|
|
|
# Macro defined in include/gui.sh, parameters are COMPONENT CURRENTUSER_POSSIBLE
|
2007-02-08 21:09:30 +00:00
|
|
|
!insertmacro InitDialogExternalDir latex ${TRUE}
|
|
|
|
!insertmacro InitDialogExternalDir imagemagick ${FALSE}
|
|
|
|
!insertmacro InitDialogExternalDir ghostscript ${FALSE}
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#Get LyX language
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY_SETUP}" "LyX Language"
|
|
|
|
|
|
|
|
${if} $R0 != ""
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_WRITE "langselect.ini" "Field 2" "State" $R0
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#--------------------------------
|
|
|
|
#Page functions
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
Function PageUser
|
|
|
|
|
2007-02-26 16:03:30 +00:00
|
|
|
#Only show page if installing for all users is possible
|
2007-02-08 21:09:30 +00:00
|
|
|
${if} $AdminOrPowerUser == ${FALSE}
|
|
|
|
Call InitUser
|
|
|
|
Abort
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
!insertmacro MUI_HEADER_TEXT $(TEXT_USER_TITLE) $(TEXT_USER_SUBTITLE)
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "user.ini"
|
|
|
|
|
|
|
|
FunctionEnd
|
|
|
|
|
|
|
|
Function PageUserValidate
|
|
|
|
|
|
|
|
!insertmacro MUI_INSTALLOPTIONS_READ $R0 "user.ini" "Field 2" "State"
|
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
# shell var context is important because it determines the actual
|
|
|
|
# meaning of variables like $DESKTOP
|
2007-02-08 21:09:30 +00:00
|
|
|
${if} $R0 == "1"
|
|
|
|
SetShellVarContext all
|
|
|
|
StrCpy $CurrentUserInstall ${FALSE}
|
|
|
|
${else}
|
|
|
|
SetShellVarContext current
|
|
|
|
StrCpy $CurrentUserInstall ${TRUE}
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
Call InitUser
|
|
|
|
|
2007-03-23 02:03:42 +00:00
|
|
|
FunctionEnd
|