]> git.lyx.org Git - features.git/commitdiff
fix lock on tmpbuf directory
authorJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 24 Apr 2008 10:51:56 +0000 (10:51 +0000)
committerJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 24 Apr 2008 10:51:56 +0000 (10:51 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24485 a592a061-630c-0410-9148-cb99ea01b6c8

development/Win32/pdfview/pdfview.nsi

index a30e9dfa84f677171964cafa2c189b211814c4b5..08d51400ffd6a7a444766aaa3e55166724f7aa0f 100644 (file)
@@ -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