Skip to content
Snippets Groups Projects
Commit 94daedaa authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-16681 Better handling of locked files by NSIS Installer

1. When SL window closes it doesn't mean that process died so gave it a bit more time to terminate
2. Added a retry logic in case first run happened too early for some reason
3. Replaced ok/cancel on locked file with abort/retry/ignorei
parent fff0dd3f
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 7 deletions
...@@ -561,10 +561,17 @@ Function CloseSecondLife ...@@ -561,10 +561,17 @@ Function CloseSecondLife
LOOP: LOOP:
FindWindow $0 "Second Life" "" FindWindow $0 "Second Life" ""
IntCmp $0 0 DONE IntCmp $0 0 SLEEP
Sleep 500 Sleep 500
Goto LOOP 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: DONE:
Pop $0 Pop $0
Return Return
...@@ -611,6 +618,12 @@ Function RemoveProgFilesOnInst ...@@ -611,6 +618,12 @@ Function RemoveProgFilesOnInst
# RMDir /r $INSTDIR is especially unsafe if user installed somewhere # RMDir /r $INSTDIR is especially unsafe if user installed somewhere
# like Program Files # 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 # 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\$INSTEXE"
Delete "$INSTDIR\$VIEWER_EXE" Delete "$INSTDIR\$VIEWER_EXE"
...@@ -627,19 +640,26 @@ RMDir /r "$INSTDIR\vmp_icons" ...@@ -627,19 +640,26 @@ RMDir /r "$INSTDIR\vmp_icons"
# find modules from different versions # find modules from different versions
RMDir /r "$INSTDIR\llplugin" RMDir /r "$INSTDIR\llplugin"
IfErrors 0 PREINSTALLCLEAN IntOp $0 $0 + 1
StrCmp $SKIP_DIALOGS "true" PREINSTALLCLEAN
MessageBox MB_OKCANCEL $(CloseSecondLifeInstRM) IDOK PREINSTALLCLEAN IDCANCEL PREINSTALLFAIL 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: PREINSTALLFAIL:
Quit Quit
PREINSTALLCLEAN: PREINSTALLDONE:
# We are no longer including release notes with the viewer, so remove them. # We are no longer including release notes with the viewer, so remove them.
Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk" Delete "$SMPROGRAMS\$INSTSHORTCUT\SL Release Notes.lnk"
Delete "$INSTDIR\releasenotes.txt" Delete "$INSTDIR\releasenotes.txt"
Pop $0
FunctionEnd FunctionEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -64,7 +64,7 @@ LangString MissingSSE2 ${LANG_GERMAN} "Dieses Gerät verfügt möglicherweise ni ...@@ -64,7 +64,7 @@ LangString MissingSSE2 ${LANG_GERMAN} "Dieses Gerät verfügt möglicherweise ni
; closesecondlife function (install) ; closesecondlife function (install)
LangString CloseSecondLifeInstDP ${LANG_GERMAN} "Warten auf die Beendigung von Second Life ..." LangString CloseSecondLifeInstDP ${LANG_GERMAN} "Warten auf die Beendigung von Second Life ..."
LangString CloseSecondLifeInstMB ${LANG_GERMAN} "Second Life kann nicht installiert oder ersetzt werden, wenn es bereits läuft.$\n$\nBeenden Sie, was Sie gerade tun und klicken Sie OK, um Second Life zu beenden.$\nKlicken Sie CANCEL, um die Installation abzubrechen." LangString CloseSecondLifeInstMB ${LANG_GERMAN} "Second Life kann nicht installiert oder ersetzt werden, wenn es bereits läuft.$\n$\nBeenden Sie, was Sie gerade tun und klicken Sie OK, um Second Life zu beenden.$\nKlicken Sie CANCEL, um die Installation abzubrechen."
LangString CloseSecondLifeInstRM ${LANG_GERMAN} "Second Life failed to remove some files from a previous install.$\n$\nSelect OK to continue.$\nSelect CANCEL to cancel installation." LangString CloseSecondLifeInstRM ${LANG_GERMAN} "Second Life failed to remove some files from a previous install."
; closesecondlife function (uninstall) ; closesecondlife function (uninstall)
LangString CloseSecondLifeUnInstDP ${LANG_GERMAN} "Warten auf die Beendigung von Second Life ..." LangString CloseSecondLifeUnInstDP ${LANG_GERMAN} "Warten auf die Beendigung von Second Life ..."
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment