From 2081b8a654fa78c4414ec2619522c8ef461a1881 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 12:15:41 -0400 Subject: DRTVWR-474: Make NSIS run new updater.exe after install. But change shortcuts and registry entries and everything else back to the real viewer executable, so that every subsequent run directly launches the viewer. Eliminate SL_Launcher references from viewer_manifest.py. --- .../installers/windows/installer_template.nsi | 41 ++++++++++++++-------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 14c8dba39f..c53d7989fc 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -299,7 +299,7 @@ StrCpy $SHORTCUT_LANG_PARAM "--set InstallLanguage $(LanguageCode)" CreateDirectory "$SMPROGRAMS\$INSTSHORTCUT" SetOutPath "$INSTDIR" CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" WriteINIStr "$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \ @@ -317,9 +317,9 @@ CreateShortCut "$SMPROGRAMS\$INSTSHORTCUT\Uninstall $INSTSHORTCUT.lnk" \ # Other shortcuts SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\$INSTSHORTCUT.lnk" \ - "$INSTDIR\$INSTEXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" + "$INSTDIR\$VIEWER_EXE" "$SHORTCUT_LANG_PARAM" "$INSTDIR\$VIEWER_EXE" CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' @@ -327,7 +327,7 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$INSTEXE" +WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$VIEWER_EXE" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc." WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/" WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/" @@ -338,10 +338,10 @@ WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninst 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"' +WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' # BUG-2707 Disable SEHOP for installed viewer. -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" "DisableExceptionChainValidation" 1 +WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 # Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" @@ -358,9 +358,8 @@ WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$ # URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks. WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"' -# Only allow Launcher to be the icon -WriteRegStr HKEY_CLASSES_ROOT "Applications\$INSTEXE" "IsHostApp" "" -WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" +WriteRegStr HKEY_CLASSES_ROOT "Applications\$VIEWER_EXE" "IsHostApp" "" +##WriteRegStr HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" "NoStartPage" "" # Write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" @@ -398,8 +397,8 @@ Call un.CloseSecondLife DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" # BUG-2707 Remove entry that disabled SEHOP -DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$INSTEXE" -DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" +DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" +##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" # Clean up shortcuts @@ -537,6 +536,7 @@ 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\$INSTEXE" +Delete "$INSTDIR\$VIEWER_EXE" # Remove old shader files first so fallbacks will work. See DEV-5663 RMDir /r "$INSTDIR\app_settings\shaders" @@ -673,7 +673,7 @@ FunctionEnd ;; After install completes, launch app ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInstSuccess -Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. + Call CheckWindowsServPack # Warn if not on the latest SP before asking to launch. Push $R0 Push $0 ;; MAINT-7812: Only write nsis.winstall file with /marker switch @@ -694,8 +694,21 @@ Call CheckWindowsServPack # Warn if not on the latest SP before asking to launc Pop $R0 Push $R0 # Option value, unused# StrCmp $SKIP_AUTORUN "true" +2; -# Assumes SetOutPath $INSTDIR - Exec '"$WINDIR\explorer.exe" "$INSTDIR\$INSTSHORTCUT.lnk"' + # Assumes SetOutPath $INSTDIR + # Run INSTEXE (our updater), passing VIEWER_EXE plus the command-line + # arguments built into our shortcuts. This gives the updater a chance + # to verify that the viewer we just installed is appropriate for the + # running system -- or, if not, to download and install a different + # viewer. For instance, if a user running 32-bit Windows installs a + # 64-bit viewer, it cannot run on this system. But since the updater + # is a 32-bit executable even in the 64-bit viewer package, the + # updater can detect the problem and adapt accordingly. + # Once everything is in order, the updater will run the specified + # viewer with the specified params. + # Quote the updater executable and the viewer executable because each + # must be a distinct command-line token, but DO NOT quote the language + # string because it must decompose into separate command-line tokens. + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From d41245f252442d91432f06b039abea81831cc083 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Sep 2018 20:13:53 -0400 Subject: DRTVWR-474: $VIEWER_EXE, rather than plain VIEWER_EXE --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index c53d7989fc..3117cf6b85 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From 83b40329fd822277ff5b47e6f36a7897c85e6260 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 13 Sep 2018 16:22:38 -0400 Subject: DRTVWR-474: Make NSIS installer invoke updater precheck subcommand. --- indra/newview/installers/windows/installer_template.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 3117cf6b85..76187b49a5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -708,7 +708,7 @@ Function .onInstSuccess # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From a5f492acf19664593b040a8cdff1e5e251f65dba Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 29 Oct 2018 17:17:26 -0400 Subject: SL-9980: Launch the first-run updater via explorer.exe as we used to run the viewer from the installer. Turns out that the peculiar indirection through explorer.exe was a known trick for an elevated-privileges program to launch a program as the logged-in Windows user. (They could have commented that...) But explorer.exe doesn't pass command-line parameters, so if you want to pass any such to the actual target program, you have to launch a shortcut with those parameters. But this target program (the updater) and its parameters (precheck mumble) are specific to the very first viewer run after installation, so delete it after. Having an additional permanent icon that always runs the updater before the viewer would only confuse matters. --- indra/newview/installers/windows/installer_template.nsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 76187b49a5..adcf8fd0e4 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -705,10 +705,21 @@ Function .onInstSuccess # updater can detect the problem and adapt accordingly. # Once everything is in order, the updater will run the specified # viewer with the specified params. + # 'Exec updater' causes the viewer to inherit elevated Admin privileges. See + # http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html + # for workaround: running the updater via explorer.exe. + # Thing is, you can't pass parameters with the explorer.exe trick, so + # you have to create a shortcut or a .bat file. Since we don't want a + # permanent shortcut for the user to relaunch the updater like this + # first time, create it in a temp location and delete it once we've + # used it. # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + CreateShortCut "$TEMP\SLFirst.lnk" "$INSTDIR\$INSTEXE" \ + 'precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' + Exec '"$WINDIR\explorer.exe" "$TEMP\SLFirst.lnk"' + Delete "$TEMP\SLFirst.lnk" Pop $R0 # FunctionEnd -- cgit v1.2.3 From e2ca890898ecb79ff314b1f748bb6a3a9dbf602b Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Oct 2018 10:36:28 -0400 Subject: DRTVWR-447: Copy VIEWER_EXE to local variable (thanks Ansariel) --- indra/newview/installers/windows/installer_template.nsi | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index adcf8fd0e4..f8e9bc4781 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -382,6 +382,7 @@ Section Uninstall # Start with some default values. StrCpy $INSTPROG "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" +StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" # Make sure the user can install/uninstall -- cgit v1.2.3 From a186f9a729e9ae9c834121708177b177f2c26283 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 1 Nov 2018 22:08:44 -0400 Subject: DRTVWR-447: Allow Standard Windows user to install for current user. This should eliminate any confusion due to a Standard user needing to elevate to Admin privileges, since from that point on Windows tells the running program the current user is that Admin. Bypass all that. --- .../installers/windows/installer_template.nsi | 165 ++++++++++----------- indra/newview/installers/windows/lang_da.nsi | Bin 7816 -> 7816 bytes indra/newview/installers/windows/lang_de.nsi | Bin 9850 -> 9854 bytes indra/newview/installers/windows/lang_en-us.nsi | Bin 8734 -> 11342 bytes indra/newview/installers/windows/lang_es.nsi | Bin 9872 -> 9876 bytes indra/newview/installers/windows/lang_fr.nsi | Bin 10258 -> 10262 bytes indra/newview/installers/windows/lang_it.nsi | Bin 9520 -> 9524 bytes indra/newview/installers/windows/lang_ja.nsi | Bin 7204 -> 7208 bytes indra/newview/installers/windows/lang_pl.nsi | Bin 8136 -> 8136 bytes indra/newview/installers/windows/lang_pt-br.nsi | Bin 9864 -> 9864 bytes indra/newview/installers/windows/lang_ru.nsi | Bin 9188 -> 9188 bytes indra/newview/installers/windows/lang_tr.nsi | Bin 9286 -> 9290 bytes indra/newview/installers/windows/lang_zh.nsi | Bin 6846 -> 6850 bytes 13 files changed, 79 insertions(+), 86 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index f8e9bc4781..500b35255e 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -32,7 +32,7 @@ SetCompress auto # Compress if saves space SetCompressor /solid lzma # Compress whole installer as one block SetDatablockOptimize off # Only saves us 0.1%, not worth it XPStyle on # Add an XP manifest to the installer -RequestExecutionLevel admin # For when we write to Program Files +RequestExecutionLevel highest # match MULTIUSER_EXECUTIONLEVEL ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Project flags @@ -90,20 +90,43 @@ InstProgressFlags smooth colored # New colored smooth look SetOverwrite on # Overwrite files by default AutoCloseWindow true # After all files install, close window -# 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}" +# Registry key paths, ours and Microsoft's +!define LINDEN_KEY "SOFTWARE\Linden Research, Inc." +!define INSTNAME_KEY "${LINDEN_KEY}\${INSTNAME}" +!define MSCURRVER_KEY "SOFTWARE\Microsoft\Windows\CurrentVersion" +!define MSNTCURRVER_KEY "SOFTWARE\Microsoft\Windows NT\CurrentVersion" +!define MSUNINSTALL_KEY "${MSCURRVER_KEY}\Uninstall\${INSTNAME}" + +# from http://nsis.sourceforge.net/Docs/MultiUser/Readme.html +# Highest level permitted for user: Admin for Admin, Standard for Standard +!define MULTIUSER_EXECUTIONLEVEL Highest +!define MULTIUSER_MUI +# Look for /AllUsers or /CurrentUser switches +!define MULTIUSER_INSTALLMODE_COMMANDLINE +# appended to $PROGRAMFILES, as affected by MULTIUSER_USE_PROGRAMFILES64 +!define MULTIUSER_INSTALLMODE_INSTDIR "${INSTNAME}" +# expands to !define MULTIUSER_USE_PROGRAMFILES64 or nothing +%%PROGRAMFILES%% +# should make MultiUser.nsh initialization read existing INSTDIR from registry +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${INSTNAME_KEY}" +!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME "" +# should make MultiUser.nsh initialization write $MultiUser.InstallMode to registry +!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY "${INSTNAME_KEY}" +!define MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME "InstallMode" +!include MultiUser.nsh +!include MUI2.nsh UninstallText $(UninstallTextMsg) DirText $(DirectoryChooseTitle) $(DirectoryChooseSetup) -Page directory dirPre -Page instfiles +!insertmacro MULTIUSER_PAGE_INSTALLMODE +!define MUI_PAGE_CUSTOMFUNCTION_PRE dirPre +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_INSTFILES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Variables ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Var INSTPROG +Var INSTNAME Var INSTEXE Var VIEWER_EXE Var INSTSHORTCUT @@ -142,20 +165,13 @@ FunctionEnd ;; entry to the language ID selector below ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function .onInit +!insertmacro MULTIUSER_INIT %%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} +# Setting MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY and +# MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME should +# read the current location of the install for this version into INSTDIR. Call CheckCPUFlags # Make sure we have SSE2 support Call CheckWindowsVersion # Don't install On unsupported systems @@ -181,7 +197,7 @@ Call CheckWindowsVersion # Don't install On unsupported systems lbl_configure_default_lang: # If we currently have a version of SL installed, default to the language of that install # Otherwise don't change $LANGUAGE and it will default to the OS UI language. - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" + ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" IfErrors +2 0 # If error skip the copy instruction StrCpy $LANGUAGE $0 @@ -204,7 +220,7 @@ lbl_build_menu: StrCpy $LANGUAGE $0 # Save language in registry - WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\${INSTNAME}" "InstallerLanguage" $LANGUAGE + WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" $LANGUAGE lbl_return: Pop $0 Return @@ -215,16 +231,20 @@ FunctionEnd ;; Prep Uninstaller Section ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Function un.onInit +!insertmacro MULTIUSER_UNINIT %%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" + ReadRegStr $0 SHELL_CONTEXT "${INSTNAME_KEY}" "InstallerLanguage" IfErrors lbl_end StrCpy $LANGUAGE $0 lbl_end: Return + # Does MultiUser.nsh init read back + # MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY into $MultiUser.InstallMode? + FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -272,15 +292,14 @@ FunctionEnd ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Section "" -SetShellVarContext all # Install for all users (if you change this, change it in the uninstall as well) +# SetShellVarContext is set by MultiUser.nsh initialization. # Start with some default values. -StrCpy $INSTPROG "${INSTNAME}" +StrCpy $INSTNAME "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" -Call CheckIfAdministrator # Make sure the user can install/uninstall Call CloseSecondLife # Make sure Second Life not currently running Call CheckWillUninstallV2 # Check if Second Life is already installed @@ -324,24 +343,24 @@ CreateShortCut "$INSTDIR\Uninstall $INSTSHORTCUT.lnk" \ '"$INSTDIR\uninst.exe"' '' # Write registry -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "" "$INSTDIR" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Version" "${VERSION_LONG}" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Shortcut" "$INSTSHORTCUT" -WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" "Exe" "$VIEWER_EXE" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "Publisher" "Linden Research, Inc." -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLInfoAbout" "http://secondlife.com/whatis/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "URLUpdateInfo" "http://secondlife.com/support/downloads/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "HelpLink" "https://support.secondlife.com/contact-support/" -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayName" "$INSTPROG" -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 +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "" "$INSTDIR" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Version" "${VERSION_LONG}" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Shortcut" "$INSTSHORTCUT" +WriteRegStr SHELL_CONTEXT "${INSTNAME_KEY}" "Exe" "$VIEWER_EXE" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "Publisher" "Linden Research, Inc." +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "URLInfoAbout" "http://secondlife.com/whatis/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "URLUpdateInfo" "http://secondlife.com/support/downloads/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "HelpLink" "https://support.secondlife.com/contact-support/" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayName" "$INSTNAME" +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "UninstallString" '"$INSTDIR\uninst.exe"' +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayVersion" "${VERSION_LONG}" +WriteRegDWORD SHELL_CONTEXT "${MSUNINSTALL_KEY}" "EstimatedSize" "0x0001D500" # ~117 MB # from FS:Ansariel -WriteRegStr HKEY_LOCAL_MACHINE "Software\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' +WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"' # BUG-2707 Disable SEHOP for installed viewer. -WriteRegDWORD HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 +WriteRegDWORD SHELL_CONTEXT "${MSNTCURRVER_KEY}\Image File Execution Options\$VIEWER_EXE" "DisableExceptionChainValidation" 1 # Write URL registry info WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}" "(default)" "URL:Second Life" @@ -380,25 +399,29 @@ SectionEnd Section Uninstall # Start with some default values. -StrCpy $INSTPROG "${INSTNAME}" +StrCpy $INSTNAME "${INSTNAME}" StrCpy $INSTEXE "${INSTEXE}" StrCpy $VIEWER_EXE "${VIEWER_EXE}" StrCpy $INSTSHORTCUT "${SHORTCUT}" -# Make sure the user can install/uninstall -Call un.CheckIfAdministrator - -# Uninstall for all users (if you change this, change it in the install as well) -SetShellVarContext all +# SetShellVarContext per the mode saved at install time in registry at +# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_KEY +# MULTIUSER_INSTALLMODE_DEFAULT_REGISTRY_VALUENAME +# Couln't get NSIS to expand $MultiUser.InstallMode into the function name at Call time +${If} $MultiUser.InstallMode == 'AllUsers' + Call un.MultiUser.InstallMode.AllUsers +${Else} + Call un.MultiUser.InstallMode.CurrentUser +${EndIf} # Make sure we're not running Call un.CloseSecondLife # Clean up registry keys and subkeys (these should all be !defines somewhere) -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Linden Research, Inc.\$INSTPROG" -DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$INSTPROG" +DeleteRegKey SHELL_CONTEXT "${INSTNAME_KEY}" +DeleteRegKey SHELL_CONTEXT "${MSCURRVER_KEY}\Uninstall\$INSTNAME" # BUG-2707 Remove entry that disabled SEHOP -DeleteRegKey HKEY_LOCAL_MACHINE "Software\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\$VIEWER_EXE" +DeleteRegKey SHELL_CONTEXT "${MSNTCURRVER_KEY}\Image File Execution Options\$VIEWER_EXE" ##DeleteRegKey HKEY_CLASSES_ROOT "Applications\$INSTEXE" DeleteRegKey HKEY_CLASSES_ROOT "Applications\${VIEWER_EXE}" @@ -418,36 +441,6 @@ Call un.UserSettingsFiles SectionEnd -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Make sure the user can install -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function CheckIfAdministrator - DetailPrint $(CheckAdministratorInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" lbl_is_admin - MessageBox MB_OK $(CheckAdministratorInstMB) - Quit -lbl_is_admin: - Return - -FunctionEnd - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Make sure the user can uninstall -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -Function un.CheckIfAdministrator - DetailPrint $(CheckAdministratorUnInstDP) - UserInfo::GetAccountType - Pop $R0 - StrCmp $R0 "Admin" lbl_is_admin - MessageBox MB_OK $(CheckAdministratorUnInstMB) - Quit -lbl_is_admin: - Return - -FunctionEnd - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Function CheckWillUninstallV2 ;; @@ -571,10 +564,10 @@ Push $2 StrCpy $0 0 # Index number used to iterate via EnumRegKey LOOP: - EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 + EnumRegKey $1 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList" $0 StrCmp $1 "" DONE # No more users - ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" + ReadRegStr $2 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList\$1" "ProfileImagePath" StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing # Required since ProfileImagePath is of type REG_EXPAND_SZ @@ -604,7 +597,7 @@ Pop $0 # Delete files in ProgramData\Secondlife Push $0 - ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" + ReadRegStr $0 SHELL_CONTEXT "${MSCURRVER_KEY}\Explorer\Shell Folders" "Common AppData" StrCmp $0 "" +2 RMDir /r "$0\SecondLife" Pop $0 @@ -661,8 +654,8 @@ NOFOLDER: MessageBox MB_YESNO $(DeleteRegistryKeysMB) IDYES DeleteKeys IDNO NoDelete DeleteKeys: - DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\x-grid-location-info" - DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Classes\secondlife" + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-location-info" + DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\secondlife" DeleteRegKey HKEY_CLASSES_ROOT "x-grid-location-info" DeleteRegKey HKEY_CLASSES_ROOT "secondlife" @@ -758,10 +751,10 @@ FunctionEnd ; StrCpy $0 0 # Index number used to iterate via EnumRegKey ; ; LOOP: -; EnumRegKey $1 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList" $0 +; EnumRegKey $1 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList" $0 ; StrCmp $1 "" DONE # no more users ; -; ReadRegStr $2 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\$1" "ProfileImagePath" +; ReadRegStr $2 SHELL_CONTEXT "${MSNTCURRVER_KEY}\ProfileList\$1" "ProfileImagePath" ; StrCmp $2 "" CONTINUE 0 # "ProfileImagePath" value is missing ; ;# Required since ProfileImagePath is of type REG_EXPAND_SZ @@ -780,7 +773,7 @@ FunctionEnd ; ;# Copy files in Documents and Settings\All Users\SecondLife ;Push $0 -; ReadRegStr $0 HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" "Common AppData" +; ReadRegStr $0 SHELL_CONTEXT "${MSCURRVER_KEY}\Explorer\Shell Folders" "Common AppData" ; StrCmp $0 "" +2 ; RMDir /r "$2\Application Data\SecondLife\" ;Pop $0 diff --git a/indra/newview/installers/windows/lang_da.nsi b/indra/newview/installers/windows/lang_da.nsi index 83e1a3ea94..b3b8cf34d5 100644 Binary files a/indra/newview/installers/windows/lang_da.nsi and b/indra/newview/installers/windows/lang_da.nsi differ diff --git a/indra/newview/installers/windows/lang_de.nsi b/indra/newview/installers/windows/lang_de.nsi index 2a868acc89..7758a3bda6 100644 Binary files a/indra/newview/installers/windows/lang_de.nsi and b/indra/newview/installers/windows/lang_de.nsi differ diff --git a/indra/newview/installers/windows/lang_en-us.nsi b/indra/newview/installers/windows/lang_en-us.nsi index 00aa47de69..1e81c5294a 100644 Binary files a/indra/newview/installers/windows/lang_en-us.nsi and b/indra/newview/installers/windows/lang_en-us.nsi differ diff --git a/indra/newview/installers/windows/lang_es.nsi b/indra/newview/installers/windows/lang_es.nsi index 1ecf254ffb..6d4a7495a6 100644 Binary files a/indra/newview/installers/windows/lang_es.nsi and b/indra/newview/installers/windows/lang_es.nsi differ diff --git a/indra/newview/installers/windows/lang_fr.nsi b/indra/newview/installers/windows/lang_fr.nsi index bec5835bed..421015fc6b 100644 Binary files a/indra/newview/installers/windows/lang_fr.nsi and b/indra/newview/installers/windows/lang_fr.nsi differ diff --git a/indra/newview/installers/windows/lang_it.nsi b/indra/newview/installers/windows/lang_it.nsi index 1d2e150525..df735ba742 100644 Binary files a/indra/newview/installers/windows/lang_it.nsi and b/indra/newview/installers/windows/lang_it.nsi differ diff --git a/indra/newview/installers/windows/lang_ja.nsi b/indra/newview/installers/windows/lang_ja.nsi index 1bd6526670..f2cc1f9fde 100644 Binary files a/indra/newview/installers/windows/lang_ja.nsi and b/indra/newview/installers/windows/lang_ja.nsi differ diff --git a/indra/newview/installers/windows/lang_pl.nsi b/indra/newview/installers/windows/lang_pl.nsi index a172f0cdeb..61dc769126 100644 Binary files a/indra/newview/installers/windows/lang_pl.nsi and b/indra/newview/installers/windows/lang_pl.nsi differ diff --git a/indra/newview/installers/windows/lang_pt-br.nsi b/indra/newview/installers/windows/lang_pt-br.nsi index 87032fec18..d481434ab2 100644 Binary files a/indra/newview/installers/windows/lang_pt-br.nsi and b/indra/newview/installers/windows/lang_pt-br.nsi differ diff --git a/indra/newview/installers/windows/lang_ru.nsi b/indra/newview/installers/windows/lang_ru.nsi index 019c66123c..a42c719169 100644 Binary files a/indra/newview/installers/windows/lang_ru.nsi and b/indra/newview/installers/windows/lang_ru.nsi differ diff --git a/indra/newview/installers/windows/lang_tr.nsi b/indra/newview/installers/windows/lang_tr.nsi index 1c4e2c2f48..c320764fac 100644 Binary files a/indra/newview/installers/windows/lang_tr.nsi and b/indra/newview/installers/windows/lang_tr.nsi differ diff --git a/indra/newview/installers/windows/lang_zh.nsi b/indra/newview/installers/windows/lang_zh.nsi index 355e01a333..8da802df68 100644 Binary files a/indra/newview/installers/windows/lang_zh.nsi and b/indra/newview/installers/windows/lang_zh.nsi differ -- cgit v1.2.3 From 75cbe187a6572e904e2f931c6a1902b186eec844 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Nov 2018 07:59:51 -0400 Subject: DRTVWR-447: Back out changeset 69118ad33b45: directly run updater from NSIS installer, instead of via explorer.exe. A recent test run performed the install, then opened an Explorer window on My Documents. --- indra/newview/installers/windows/installer_template.nsi | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index adcf8fd0e4..76187b49a5 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -705,21 +705,10 @@ Function .onInstSuccess # updater can detect the problem and adapt accordingly. # Once everything is in order, the updater will run the specified # viewer with the specified params. - # 'Exec updater' causes the viewer to inherit elevated Admin privileges. See - # http://mdb-blog.blogspot.com/2013/01/nsis-lunch-program-as-user-from-uac.html - # for workaround: running the updater via explorer.exe. - # Thing is, you can't pass parameters with the explorer.exe trick, so - # you have to create a shortcut or a .bat file. Since we don't want a - # permanent shortcut for the user to relaunch the updater like this - # first time, create it in a temp location and delete it once we've - # used it. # Quote the updater executable and the viewer executable because each # must be a distinct command-line token, but DO NOT quote the language # string because it must decompose into separate command-line tokens. - CreateShortCut "$TEMP\SLFirst.lnk" "$INSTDIR\$INSTEXE" \ - 'precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' - Exec '"$WINDIR\explorer.exe" "$TEMP\SLFirst.lnk"' - Delete "$TEMP\SLFirst.lnk" + Exec '"$INSTDIR\$INSTEXE" precheck "$INSTDIR\$VIEWER_EXE" $SHORTCUT_LANG_PARAM' Pop $R0 # FunctionEnd -- cgit v1.2.3 From e7ce166469dafe815ab002be76c6f80acaaff35c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 2 Nov 2018 08:24:28 -0400 Subject: DRTVWR-447: Fix NSIS installer icons with "Modern UI" mechanism. --- indra/newview/installers/windows/installer_template.nsi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/installers') diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 219ee2695b..bd290b710b 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -80,9 +80,12 @@ Name ${INSTNAME} SubCaption 0 $(LicenseSubTitleSetup) # Override "license agreement" text +!define MUI_ICON "%%SOURCE%%\installers\windows\install_icon.ico" +!define MUI_UNICON "%%SOURCE%%\installers\windows\uninstall_icon.ico" + BrandingText " " # Bottom of window text -Icon %%SOURCE%%\installers\windows\install_icon.ico -UninstallIcon %%SOURCE%%\installers\windows\uninstall_icon.ico +Icon "${MUI_ICON}" +UninstallIcon "${MUI_UNICON}" WindowIcon on # Show our icon in left corner BGGradient off # No big background window CRCCheck on # Make sure CRC is OK -- cgit v1.2.3