summaryrefslogtreecommitdiff
path: root/indra/newview/installers/windows/installer_template.nsi
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-02-28 21:56:33 +0200
commitf62579f29303b33ff331f3f0b0e8d4197755d279 (patch)
tree06744ee5ccb2280970c8eed3303db326fbd5c128 /indra/newview/installers/windows/installer_template.nsi
parent611869b1035ef5677335a33169fb99413a90c3a6 (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-548-maint-N
Diffstat (limited to 'indra/newview/installers/windows/installer_template.nsi')
-rw-r--r--indra/newview/installers/windows/installer_template.nsi47
1 files changed, 44 insertions, 3 deletions
diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi
index 8838b6d0be..7513908cb4 100644
--- a/indra/newview/installers/windows/installer_template.nsi
+++ b/indra/newview/installers/windows/installer_template.nsi
@@ -561,10 +561,17 @@ Function CloseSecondLife
LOOP:
FindWindow $0 "Second Life" ""
- IntCmp $0 0 DONE
+ IntCmp $0 0 SLEEP
Sleep 500
Goto LOOP
-
+
+ SLEEP:
+ # Second life window just closed, but program might not be fully done yet
+ # and OS might have not released some locks, wait a bit more to make sure
+ # all file handles were released.
+ # If something still isn't unlocked, it will trigger a notification from
+ # RemoveProgFilesOnInst
+ Sleep 1000
DONE:
Pop $0
Return
@@ -605,6 +612,18 @@ FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Function RemoveProgFilesOnInst
+# We do not remove whole pervious install folder on install, since
+# there is a chance that viewer was installed into some important
+# folder by intent or accident
+# RMDir /r $INSTDIR is especially unsafe if user installed somewhere
+# like Program Files
+
+# Set retry counter. All integers are strings.
+Push $0
+StrCpy $0 0
+
+PREINSTALLREMOVE:
+
# 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"
@@ -612,13 +631,35 @@ Delete "$INSTDIR\$VIEWER_EXE"
# Remove old shader files first so fallbacks will work. See DEV-5663
RMDir /r "$INSTDIR\app_settings\shaders"
-# Remove skins folder to clean up files removed during development
+# Remove folders to clean up files removed during development
+RMDir /r "$INSTDIR\app_settings"
RMDir /r "$INSTDIR\skins"
+RMDir /r "$INSTDIR\vmp_icons"
+
+# Remove llplugin, plugins can crash or malfunction if they
+# find modules from different versions
+RMDir /r "$INSTDIR\llplugin"
+
+IntOp $0 $0 + 1
+
+IfErrors 0 PREINSTALLDONE
+ IntCmp $0 1 PREINSTALLREMOVE #try again once
+ StrCmp $SKIP_DIALOGS "true" PREINSTALLDONE
+ MessageBox MB_ABORTRETRYIGNORE $(CloseSecondLifeInstRM) IDABORT PREINSTALLFAIL IDRETRY PREINSTALLREMOVE
+ # MB_ABORTRETRYIGNORE does not accept IDIGNORE
+ Goto PREINSTALLDONE
+
+PREINSTALLFAIL:
+ Quit
+
+PREINSTALLDONE:
# We are no longer including release notes with the viewer, so remove them.
Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk"
Delete "$INSTDIR\releasenotes.txt"
+Pop $0
+
FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;