From: Bo Peng Date: Fri, 23 Mar 2007 02:03:42 +0000 (+0000) Subject: Add comments to installer code X-Git-Tag: 1.6.10~10537 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5653a3d744369726d5c95d819d2baa0139d6863e;p=features.git Add comments to installer code git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17517 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/development/Win32/packaging/installer/components/reinstall.nsh b/development/Win32/packaging/installer/components/reinstall.nsh index 610819328a..7464fbc892 100644 --- a/development/Win32/packaging/installer/components/reinstall.nsh +++ b/development/Win32/packaging/installer/components/reinstall.nsh @@ -9,7 +9,8 @@ Reinstall options Function PageReinstall - #Check whether this version is already installed + # Check whether this version is already installed + # If so, some registry key like Software/lyx15 should exist ReadRegStr $R0 SHELL_CONTEXT ${APP_REGKEY} "Version" @@ -26,10 +27,12 @@ Function PageReinstallValidate !insertmacro MUI_INSTALLOPTIONS_READ $R0 "reinstall.ini" "Field 2" "State" + # if re-installation, hide many sections + # FIXME: where is SelectSection defined? ${if} $R0 == "1" !insertmacro SelectSection ${SecCore} ${else} !insertmacro UnselectSection ${SecCore} ${endif} -FunctionEnd \ No newline at end of file +FunctionEnd diff --git a/development/Win32/packaging/installer/components/user.nsh b/development/Win32/packaging/installer/components/user.nsh index f21e70b0ff..dc6b32484a 100644 --- a/development/Win32/packaging/installer/components/user.nsh +++ b/development/Win32/packaging/installer/components/user.nsh @@ -7,13 +7,18 @@ Install type setting (current user/all users) #-------------------------------- #Macros +# COMPONENT can be LaTeX ImageMagick and Ghostscript !macro GetDirExternal COMPONENT + # APP_REGKEY_SETUP = "Software\${APP_NAME}${APP_SERIES_KEY}\Setup" + # where ${APP_NAME}${APP_SERIES_KEY} is something like LyX15 ReadRegStr $R0 SHELL_CONTEXT "${APP_REGKEY_SETUP}" "${COMPONENT} Path" + # BIN_LATEX etc are defined in settings.nsh ${if} ${FileExists} "$R0\${BIN_${COMPONENT}}" ${if} $R0 != "" + # define variables like PathLATEX StrCpy $Path${COMPONENT} $R0 ${endif} @@ -38,8 +43,8 @@ Function InitUser !insertmacro GetDirExternal ImageMagick !insertmacro GetDirExternal Ghostscript - #Set directories in dialogs - + # Set directories in dialogs + # Macro defined in include/gui.sh, parameters are COMPONENT CURRENTUSER_POSSIBLE !insertmacro InitDialogExternalDir latex ${TRUE} !insertmacro InitDialogExternalDir imagemagick ${FALSE} !insertmacro InitDialogExternalDir ghostscript ${FALSE} @@ -74,6 +79,8 @@ Function PageUserValidate !insertmacro MUI_INSTALLOPTIONS_READ $R0 "user.ini" "Field 2" "State" + # shell var context is important because it determines the actual + # meaning of variables like $DESKTOP ${if} $R0 == "1" SetShellVarContext all StrCpy $CurrentUserInstall ${FALSE} @@ -84,4 +91,4 @@ Function PageUserValidate Call InitUser -FunctionEnd \ No newline at end of file +FunctionEnd