Var newStartMenuLinkVar oldStartMenuLinkVar newDesktopLinkVar oldDesktopLinkVar oldShortcutNameVar oldMenuDirectory!include "common.nsh"!include "MUI2.nsh"!include "multiUser.nsh"!include "allowOnlyOneInstallerInstance.nsh"!ifdef INSTALL_MODE_PER_ALL_USERS!ifdef BUILD_UNINSTALLERRequestExecutionLevel user!elseRequestExecutionLevel admin!endif!elseRequestExecutionLevel user!endif!ifdef BUILD_UNINSTALLERSilentInstall silent!elseVar appExeVar launchLink!endif!ifdef ONE_CLICK!include "oneClick.nsh"!else!include "assistedInstaller.nsh"!endif!insertmacro addLangs!ifmacrodef customHeader!insertmacro customHeader!endifFunction .onInitCall setInstallSectionSpaceRequiredSetOutPath $INSTDIR${LogSet} on!ifmacrodef preInit!insertmacro preInit!endif!ifdef DISPLAY_LANG_SELECTOR!insertmacro MUI_LANGDLL_DISPLAY!endif!ifdef BUILD_UNINSTALLERWriteUninstaller "${UNINSTALLER_OUT_FILE}"!insertmacro quitSuccess!else!insertmacro check64BitAndSetRegView!ifdef ONE_CLICK!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE!else${IfNot} ${UAC_IsInnerInstance}!insertmacro ALLOW_ONLY_ONE_INSTALLER_INSTANCE${EndIf}!endif!insertmacro initMultiUser!ifmacrodef customInit!insertmacro customInit!endif!ifmacrodef addLicenseFilesInitPluginsDir!insertmacro addLicenseFiles!endif!endifFunctionEnd!ifndef BUILD_UNINSTALLER!include "installUtil.nsh"!endifSection "install" INSTALL_SECTION_ID!ifndef BUILD_UNINSTALLER# If we're running a silent upgrade of a per-machine installation, elevate so extracting the new app will succeed.# For a non-silent install, the elevation will be triggered when the install mode is selected in the UI,# but that won't be executed when silent.!ifndef INSTALL_MODE_PER_ALL_USERS!ifndef ONE_CLICK${if} $hasPerMachineInstallation == "1" # set in onInit by initMultiUser${andIf} ${Silent}${ifNot} ${UAC_IsAdmin}ShowWindow $HWNDPARENT ${SW_HIDE}!insertmacro UAC_RunElevated${Switch} $0${Case} 0${Break}${Case} 1223 ;user aborted${Break}${Default}MessageBox mb_IconStop|mb_TopMost|mb_SetForeground "Unable to elevate, error $0"${Break}${EndSwitch}Quit${else}!insertmacro setInstallModePerAllUsers${endIf}${endIf}!endif!endif!include "installSection.nsh"!endifSectionEndFunction setInstallSectionSpaceRequired!insertmacro setSpaceRequired ${INSTALL_SECTION_ID}FunctionEnd!ifdef BUILD_UNINSTALLER!include "uninstaller.nsh"!endif