lyx_mirror/development/Win32/packaging/installer/gui/reinstall.nsh
Joost Verburg d1a3055578 lots of installer improvements:
* use nsDialogs instead of InstallOptions for custom wizard pages, faster & easier to customize
* upgrade to Modern UI 2
* use MultiUser.nsh to support multiple installation modes (all users / current user) in a much more simple way
* use LangFile.nsh for the language files, again less scripting required
* simplified installer structure
* more meaningful variable names
* more comments
* minor fixes

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24062 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-30 21:37:53 +00:00

68 lines
1.6 KiB
Plaintext

/*
reinstall.nsh
Verify whether the LyX version of the installer is already installed.
If yes, ask the user whether the program files need to be reinstalled.
*/
Var ReinstallPage
Var ReinstallPage.Info
Var ReinstallPage.CheckBox
Var ReinstallPage.CheckBox.State
Var InstalledVersion
# Page functions
Function PageReinstall
# Check whether this version is already installed
# If so, some registry key like Software/Lyx16 should exist
ReadRegStr $InstalledVersion SHELL_CONTEXT ${APP_REGKEY} "Version"
${If} $InstalledVersion != "${APP_VERSION}"
# Different version, go ahead
Abort
${EndIf}
# Same version is already installed, ask the user
!insertmacro MUI_HEADER_TEXT $(TEXT_REINSTALL_TITLE) $(TEXT_REINSTALL_SUBTITLE)
# Build the dialog
nsDialogs::Create /NOUNLOAD 1018
Pop $ReinstallPage
${NSD_CreateLabel} 0u 0u 300u 60u $(TEXT_REINSTALL_INFO)
Pop $ReinstallPage.Info
${NSD_CreateCheckBox} 20u 60u 280u 10u $(TEXT_REINSTALL_ENABLE)
Pop $ReinstallPage.CheckBox
${If} ${SectionIsSelected} ${SecProgramFiles}
${NSD_SetState} $ReinstallPage.CheckBox ${BST_CHECKED}
${Else}
${NSD_SetState} $ReinstallPage.CheckBox ${BST_UNCHECKED}
${EndIf}
nsDialogs::Show
FunctionEnd
Function PageReinstallValidate
# Get state of checkbox
${NSD_GetState} $ReinstallPage.CheckBox $ReinstallPage.CheckBox.State
# Set whether the programs files need to be installed
${If} $ReinstallPage.CheckBox.State = ${BST_CHECKED}
!insertmacro SelectSection ${SecProgramFiles}
${Else}
!insertmacro UnselectSection ${SecProgramFiles}
${EndIf}
FunctionEnd