From 2e28b6e57b50ad1a211709f7eb37f7cf43386f17 Mon Sep 17 00:00:00 2001 From: Joost Verburg Date: Thu, 24 Apr 2008 10:51:56 +0000 Subject: [PATCH] fix lock on tmpbuf directory git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24485 a592a061-630c-0410-9148-cb99ea01b6c8 --- development/Win32/pdfview/pdfview.nsi | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/development/Win32/pdfview/pdfview.nsi b/development/Win32/pdfview/pdfview.nsi index a30e9dfa84..08d51400ff 100644 --- a/development/Win32/pdfview/pdfview.nsi +++ b/development/Win32/pdfview/pdfview.nsi @@ -113,7 +113,8 @@ Section "View PDF file" GetFullPathName $OriginalFile $OriginalFile ${GetFileName} $OriginalFile $OriginalFileName - ${GetParent} $OriginalFile $OriginalDir + ${GetParent} $OriginalFile $OriginalDir # tmpbuf + ${GetParent} $OriginalDir $OriginalDir # tmpdir SetOutPath $TEMP # The LyX tmpbuf should not be locked @@ -149,23 +150,15 @@ Section "View PDF file" # Monitor for updates of the original file GetFileTime $OriginalFile $OriginalTimeHigh $OriginalTimeLow !insertmacro SystemCall "kernel32::FindFirstChangeNotification(t '$OriginalDir', \ - i 0, i ${FILE_NOTIFY_CHANGE_LAST_WRITE}) i.s" + i 1, i ${FILE_NOTIFY_CHANGE_LAST_WRITE}) i.s" Pop $ChangeNotification ${Do} !insertmacro SystemCall "kernel32::WaitForSingleObject(i $ChangeNotification, i 10000) i.s" Pop $WaitReturn - - # Check whether the PDF still exists (if not, LyX is being closed) - - ${IfNot} ${FileExists} $LockedFile - # Quit this application - !insertmacro SystemCall "kernel32::FindCloseChangeNotification(i $ChangeNotification)" - Quit - ${EndIf} - - # Check whether the lock is still active (if not, Adobe Reader being closed) + + # Check whether the lock is still active (if not, Adobe Reader is closed) FileOpen $LockedFile $PDFFile a @@ -178,13 +171,14 @@ Section "View PDF file" ${EndIf} ${IfNot} $WaitReturn = ${WAIT_TIMEOUT} - # The LyX tmpbuf has been updated + + # The LyX temporary directory has been updated # Check whether it's the PDF file that has been updated GetFileTime $OriginalFile $CurrentTimeHigh $CurrentTimeLow - ${if} $OriginalTimeHigh != $CurrentTimeHigh - ${orif} $OriginalTimeLow != $CurrentTimeLow + ${If} $OriginalTimeHigh != $CurrentTimeHigh + ${OrIf} $OriginalTimeLow != $CurrentTimeLow # PDF has been modified, update view !insertmacro HideConsole '"$EXEDIR\pdfclose.exe" --file "$PDFFile"' CopyFiles /SILENT $OriginalFile $PDFFile -- 2.39.5