From 7452327850b7cf2cbfc5ee5e2f65eaa843d3dcf1 Mon Sep 17 00:00:00 2001 From: bitraid Date: Tue, 6 Nov 2018 12:22:52 +0200 Subject: [PATCH] NSIS: use DeleteRetryAbort for all files Even if qutebrowser.exe is successfully deleted, other files might still be locked (QtWebEngineProcess.exe hang). --- misc/nsis/mkunlist.cmd | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/misc/nsis/mkunlist.cmd b/misc/nsis/mkunlist.cmd index 6c681c3ed..864b208c9 100755 --- a/misc/nsis/mkunlist.cmd +++ b/misc/nsis/mkunlist.cmd @@ -23,14 +23,14 @@ if exist "%ULIST%" del "%ULIST%" || exit 3 if exist "%DLIST%" del "%DLIST%" || exit 3 rem Add release files deletion commands -for /r "%DIST%" %%i in (*) do call:AddToNSH Delete "%%i" "%ULIST%" +for /r "%DIST%" %%i in (*) do call:AddToNSH f "%%i" "%ULIST%" rem '*' doesn't catch hidden files and there are a couple files starting with rem a '.', which will appear as hidden if mapped from a linux file system. -for /f "tokens=*" %%i in ('dir "%DIST%" /a:h-d /b /s') do call:AddToNSH Delete "%%i" "%ULIST%" +for /f "tokens=*" %%i in ('dir "%DIST%" /a:h-d /b /s') do call:AddToNSH f "%%i" "%ULIST%" rem Add to the temporary file the directories removal commands -for /r "%DIST%" %%i in (.) do call:AddToNSH RMDir "%%i" "%DLIST%" +for /r "%DIST%" %%i in (.) do call:AddToNSH d "%%i" "%DLIST%" rem Reverse dir-list items (so each child will get deleted first) rem and append them to the nsh. @@ -38,7 +38,7 @@ sort /r "%DLIST%" >> "%ULIST%" del "%DLIST%" goto:eof -rem AddToNSH +rem AddToNSH :AddToNSH rem Strip quotes from file/dir name set "FN=%~2" @@ -46,4 +46,9 @@ rem Strip leading path set "FN=!FN:%DIST%=!" rem If the name contains a '$', escape it by adding another '$' set "FN=!FN:$=$$!" -(echo:%1 "$INSTDIR!FN!") >> %3 +rem Writing to out_file. EnableDelayedExpansion is weird with '!' +if %1==f ( + (echo:^^!insertmacro DeleteRetryAbort "$INSTDIR!FN!") >> %3 +) else ( + (echo:RMDir "$INSTDIR!FN!") >> %3 +)