From 510e101627970c62a479ec01d26a26124c9c7991 Mon Sep 17 00:00:00 2001 From: Callum Prentice Date: Thu, 30 Mar 2017 17:36:33 -0700 Subject: fix for MAINT-6998 64bit viewer installs to Program Files (x86) by default. - this change also fixes MAINT-5365 Windows viewer uninstall icon is system default not SL logo --- .../installers/windows/installer_template.nsi | 31 +++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'indra/newview/installers/windows') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index eb07b54d8d..71a33a0dc0 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -90,8 +90,11 @@ InstProgressFlags smooth colored # New colored smooth look SetOverwrite on # Overwrite files by default AutoCloseWindow true # After all files install, close window -InstallDir "%%$PROGRAMFILES%%\${INSTNAME}" -InstallDirRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "" +# initial location of install (default when not already installed) +# note: Now we defer looking for existing install until onInit when we +# are able to engage the 32/64 registry function +InstallDir "%%PROGRAMFILES%%\${INSTNAME}" + UninstallText $(UninstallTextMsg) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) Page directory dirPre @@ -118,6 +121,8 @@ Var DO_UNINSTALL_V2 # If non-null, path to a previous Viewer 2 installation !insertmacro GetParameters !insertmacro GetOptions !include WinVer.nsh # For OS and SP detection +!include 'LogicLib.nsh' # for value comparison +!include "x64.nsh" # for 64bit detection ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Pre-directory page callback @@ -136,7 +141,21 @@ FunctionEnd ;; entry to the language ID selector below ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInit + %%ENGAGEREGISTRY%% + +# read the current location of the install for this version +# if $0 is empty, this is the first time for this viewer name +ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\\Linden Research, Inc.\\${INSTNAME}" "" + +# viewer with this name not installed before +${If} $0 == "" + # nothing to do here +${Else} + # use the value we got from registry as install location + StrCpy $INSTDIR $0 +${EndIf} + Call CheckCPUFlags # Make sure we have SSE2 support Call CheckWindowsVersion # Don't install On unsupported systems Push $0 @@ -195,7 +214,9 @@ FunctionEnd ;; Prep Uninstaller Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.onInit + %%ENGAGEREGISTRY%% + # Read language from registry and set for uninstaller. Key will be removed on successful uninstall ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" IfErrors lbl_end @@ -320,6 +341,10 @@ WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninst WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "UninstallString" '"$INSTDIR\uninst.exe"' WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayVersion" "${VERSION_LONG}" WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "EstimatedSize" "0x0001D500" # ~117 MB + +# from FS:Ansariel +WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$INSTEXE"' + # BUG-2707 Disable SEHOP for installed viewer. WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" "DisableExceptionChainValidation" 1 @@ -561,7 +586,7 @@ FunctionEnd Function RemoveProgFilesOnInst # Remove old SecondLife.exe to invalidate any old shortcuts to it that may be in non-standard locations. See MAINT-3575 -Delete "$INSTDIR\SecondLife.exe" +Delete "$INSTDIR\$INSTEXE" # Remove old shader files first so fallbacks will work. See DEV-5663 RMDir /r "$INSTDIR\app_settings\shaders" -- cgit v1.2.3