mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 05:16:21 +00:00
Merge branch 'master' into features/latexargs
This commit is contained in:
commit
3b1a026a93
@ -1,8 +1,13 @@
|
||||
Changelog for LyX-205-4:
|
||||
- fixed bug that EPS and PDF images were not displayed if LyX was installed this time without admin privileges
|
||||
- support to update the view as PDF if Adobe Reader XI is used
|
||||
- fix long standing bug that updating a PDF view failed for larger
|
||||
LyX documents if Adobe Reader or Acrobat was used as PDF viewer
|
||||
- fixed bug that EPS and PDF images were not displayed if LyX was installed
|
||||
this time without admin privileges
|
||||
but an older LyX version was once installed with admin privileges
|
||||
- correct the required disk space for the German thesaurus dictionaries
|
||||
- updated Japanese, Norwegian, Slovak and Ukrainian translation of the installer messages
|
||||
- updated Japanese, Norwegian, Polish, Slovak and Ukrainian translation of
|
||||
the installer messages
|
||||
|
||||
|
||||
Changelog for LyX-205-3:
|
||||
|
@ -1,108 +1,108 @@
|
||||
!insertmacro LANGFILE_EXT "Polish"
|
||||
|
||||
${LangFileString} TEXT_INSTALL_CURRENTUSER "(Installed for Current User)"
|
||||
${LangFileString} TEXT_INSTALL_CURRENTUSER "(Zainstalowane dla bieżącego użytkownika)"
|
||||
|
||||
${LangFileString} TEXT_WELCOME "Kreator przeprowadzi Ciebie przez proces instalacji LyX-a.$\r$\n\
|
||||
${LangFileString} TEXT_WELCOME "Kreator przeprowadzi Ciebie przez proces instalacji LyX$\'a.$\r$\n\
|
||||
$\r$\n\
|
||||
$_CLICK"
|
||||
|
||||
${LangFileString} TEXT_CONFIGURE_MIKTEXFNDB "Updating MiKTeX filename database..."
|
||||
${LangFileString} TEXT_CONFIGURE_LYX "Configuring LyX (MiKTeX may download missing packages, this can take some time) ..."
|
||||
${LangFileString} TEXT_CONFIGURE_PYTHON "Compiling Python scripts..."
|
||||
${LangFileString} TEXT_CONFIGURE_MIKTEXFNDB "Aktualizacja bazy danych nazw plików MikTeX..."
|
||||
${LangFileString} TEXT_CONFIGURE_LYX "Konfigurowanie LyX (MiKTeX może pobrać brakujące pakiety, co może zająć trochę czasu)..."
|
||||
${LangFileString} TEXT_CONFIGURE_PYTHON "Kompilowanie skryptów Python..."
|
||||
|
||||
${LangFileString} TEXT_FINISH_DESKTOP "Create desktop shortcut"
|
||||
${LangFileString} TEXT_FINISH_WEBSITE "Visit lyx.org for the latest news, support and tips"
|
||||
${LangFileString} TEXT_FINISH_DESKTOP "Utwórz skrót na pulpicie"
|
||||
${LangFileString} TEXT_FINISH_WEBSITE "Odwiedź lyx.org by poznać wiadomości i wskazówki lub skorzystać ze wsparcia"
|
||||
|
||||
${LangFileString} FileTypeTitle "LyX-Document"
|
||||
${LangFileString} FileTypeTitle "Dokument LyX"
|
||||
|
||||
${LangFileString} SecInstJabRefTitle "JabRef"
|
||||
${LangFileString} SecAllUsersTitle "Instalacja dla wszystkich użytkowników?"
|
||||
${LangFileString} SecFileAssocTitle "Skojarzenie plików .lyx"
|
||||
${LangFileString} SecDesktopTitle "Ikona na pulpicie"
|
||||
|
||||
${LangFileString} SecCoreDescription "Pliki LyX-a."
|
||||
${LangFileString} SecInstJabRefDescription "Bibliography reference manager and editor for BibTeX files."
|
||||
${LangFileString} SecCoreDescription "Pliki LyX$\'a."
|
||||
${LangFileString} SecInstJabRefDescription "Aplikacja do zarządzania i edycji odnośników bibliografii w plikach BibTeX."
|
||||
${LangFileString} SecAllUsersDescription "Instalacja dla wszystkich użytkowników lub tylko dla bieżącego użytkownika."
|
||||
${LangFileString} SecFileAssocDescription "Skojarzenie LyX-a z plikami o rozszerzeniu .lyx."
|
||||
${LangFileString} SecDesktopDescription "Ikona LyX-a na pulpicie."
|
||||
${LangFileString} SecDictionariesDescription "Spell-checker dictionaries that can be downloaded and installed."
|
||||
${LangFileString} SecThesaurusDescription "Thesaurus dictionaries that can be downloaded and installed."
|
||||
${LangFileString} SecDesktopDescription "Ikona LyX$\'a na pulpicie."
|
||||
${LangFileString} SecDictionariesDescription "Słowniki sprawdzania pisowni, które mogą zostać pobrane i zainstalowane."
|
||||
${LangFileString} SecThesaurusDescription "Słowniki tezaurusa, które mogą zostać pobrane i zainstalowane."
|
||||
|
||||
${LangFileString} EnterLaTeXHeader1 'Dystrybucja LaTeX-a'
|
||||
${LangFileString} EnterLaTeXHeader2 'Wybierz dystrybucjê LaTeX-a, któr¹ chcesz u¿ywaæ z LyX-em.'
|
||||
${LangFileString} EnterLaTeXFolder 'You can optionally set here the path to the file $\"latex.exe$\" and therewith set the \
|
||||
LaTeX-distribution that should be used by LyX.$\r$\n\
|
||||
If you don$\'t use LaTeX, LyX cannot output documents!$\r$\n\
|
||||
${LangFileString} EnterLaTeXHeader1 'Dystrybucja LaTeX'
|
||||
${LangFileString} EnterLaTeXHeader2 'Wybierz dystrybucję LaTeX, którą chcesz używać z LyX.'
|
||||
${LangFileString} EnterLaTeXFolder 'Możesz opcjonalnie określić ścieżkę do pliku $\"latex.exe$\" i w związku z tym ustawić, \
|
||||
która dystrybucja LaTeX ma być używana przez LyX.$\r$\n\
|
||||
Jeżeli nie użyjesz LaTeX, LyX będzie niezdolny do wyprodukowania dokumentów!$\r$\n\
|
||||
$\r$\n\
|
||||
The installer has detected the LaTeX-distribution \
|
||||
$\"$LaTeXName$\" on your system. Displayed below is its path.'
|
||||
${LangFileString} EnterLaTeXFolderNone 'Set below the path to the file $\"latex.exe$\". Therewith you set which \
|
||||
LaTeX-distribution should be used by LyX.$\r$\n\
|
||||
If you don$\'t use LaTeX, LyX cannot output documents!$\r$\n\
|
||||
Instalator wykrył dystrybucję LaTeX \
|
||||
$\"$LaTeXName$\" w twoim systemie. Poniżej wyświetlono jego ścieżkę.'
|
||||
${LangFileString} EnterLaTeXFolderNone 'Poniżej podaj ścieżkę do pliku $\"latex.exe$\". W związku z tym od Ciebie \
|
||||
zależy, która dystrybucja LaTeX zostanie użyta przez LyX.$\r$\n\
|
||||
Jeżeli nie użyjesz LaTeX, LyX będzie niezdolny do wyprodukowania dokumentów!$\r$\n\
|
||||
$\r$\n\
|
||||
The installer couldn$\'t find a LaTeX-distribution on your system.'
|
||||
${LangFileString} PathName 'Path to the file $\"latex.exe$\"'
|
||||
Instalator nie może odnaleźć dystrybucji LaTeX w twoim systemie.'
|
||||
${LangFileString} PathName 'Ścieżka do pliku $\"latex.exe$\"'
|
||||
${LangFileString} DontUseLaTeX "Nie używaj LaTeX-a"
|
||||
${LangFileString} InvalidLaTeXFolder 'Plik $\"latex.exe$\" nie znajduje się w podanej ścieżce.'
|
||||
|
||||
${LangFileString} LatexInfo 'Teraz zostanie uruchomiony instalator dystrybucji LaTeX-a $\"MiKTeX$\".$\r$\n\
|
||||
${LangFileString} LatexInfo 'Teraz zostanie uruchomiony instalator dystrybucji LaTeX $\"MiKTeX$\".$\r$\n\
|
||||
Aby zainstalować ten program naciśnij przycisk $\"Dalej$\" w oknie instalatora.$\r$\n\
|
||||
$\r$\n\
|
||||
!!! Proszę użyć wszystkich domyślnych opcji instalatora MiKTeX-a !!!'
|
||||
${LangFileString} LatexError1 'Nie znaleziono dystrybucji LaTeX-a!$\r$\n\
|
||||
${LangFileString} LatexError1 'Nie znaleziono dystrybucji LaTeX$\'a!$\r$\n\
|
||||
LyX nie może być użyty bez dystrybucji LaTeX-a takiej jak $\"MiKTeX$\"!$\r$\n\
|
||||
Z tego powodu instalacja zostanie przerwana.'
|
||||
|
||||
${LangFileString} HunspellFailed 'Download of dictionary for language $\"$R3$\" failed.'
|
||||
${LangFileString} ThesaurusFailed 'Download of thesaurus for language $\"$R3$\" failed.'
|
||||
${LangFileString} HunspellFailed 'Pobranie słownika dla języka $\"$R3$\" nie powiodło się.'
|
||||
${LangFileString} ThesaurusFailed 'Pobranie tezaurusa dla języka $\"$R3$\" nie powiodło się.'
|
||||
|
||||
${LangFileString} JabRefInfo 'Now the installer of the program $\"JabRef$\" will be launched.$\r$\n\
|
||||
You can use all default options of the JabRef-installer.'
|
||||
${LangFileString} JabRefError 'The program $\"JabRef$\" could not successfully be installed!$\r$\n\
|
||||
The installer will continue anyway.$\r$\n\
|
||||
Try to install JabRef again later.'
|
||||
${LangFileString} JabRefInfo 'Teraz zostanie uruchomiony instalator aplikacji $\"JabRef$\".$\r$\n\
|
||||
Możesz użyć wszystkich domyślnych opcji instalatora JabRef.'
|
||||
${LangFileString} JabRefError 'Aplikacja $\"JabRef$\" nie może być z powodzeniem zainstalowana!$\r$\n\
|
||||
Instalator jednakże będzie kontynuował dalsze działanie..$\r$\n\
|
||||
Spróbuj ponownie później zainstalować JabRef.'
|
||||
|
||||
${LangFileString} LatexConfigInfo "Dalsza konfiguracja LyX-a chwilê potrwa."
|
||||
${LangFileString} LatexConfigInfo "Dalsza konfiguracja LyX$\'a chwilę potrwa."
|
||||
|
||||
${LangFileString} MiKTeXPathInfo "In order that every user is later able to customize MiKTeX for his needs$\r$\n\
|
||||
it is necessary to set write permissions for all users to MiKTeX's installation folder$\r$\n\
|
||||
${LangFileString} MiKTeXPathInfo "Aby umożliwić każdemu z użytkowników późniejsze dostosowanie MikTeX do ich potrzeb$\r$\n\
|
||||
niezbędne jest nadanie praw zapisu wszystkim użytkownikom od folderu instalacji MikTeX$\r$\n\
|
||||
$MiKTeXPath $\r$\n\
|
||||
and its subfolders."
|
||||
${LangFileString} MiKTeXInfo 'The LaTeX-distribution $\"MiKTeX$\" will be used together with LyX.$\r$\n\
|
||||
It is recommended to install available MiKTeX-updates using the program $\"MiKTeX Update Wizard$\"$\r$\n\
|
||||
before you use LyX for the first time.$\r$\n\
|
||||
Would you now check for MiKTeX updates?'
|
||||
i jego podfolderom."
|
||||
${LangFileString} MiKTeXInfo 'Dystrybucja LaTeX $\"MikTeX$\" będzie używana razem z LyX.$\r$\n\
|
||||
Zaleca się instalację dostępnych aktualizacji MikTeX z użyciem aplikacji $\"MikTeX update wizard$\"$\r$\n\
|
||||
przed użyciem LyX po raz pierwszy.$\r$\n\
|
||||
Czy życzysz sobie sprawdzenia tych aktualizacji dla MikTeX teraz?'
|
||||
|
||||
${LangFileString} ModifyingConfigureFailed "Nieudana próba ustawienia zmiennej 'path_prefix' w pliku skryptu konfigracyjnego"
|
||||
${LangFileString} ModifyingConfigureFailed "Nieudana próba ustawienia zmiennej 'path_prefix' w pliku skryptu konfiguracyjnego"
|
||||
${LangFileString} RunConfigureFailed "Niedana próba wykonania skryptu konfiguracyjnego"
|
||||
${LangFileString} NotAdmin "Musisz mieæ prawa administratora aby zainstalowaæ LyX-a!"
|
||||
${LangFileString} NotAdmin "Musisz mieć prawa administratora aby zainstalować LyX$\'a!"
|
||||
${LangFileString} InstallRunning "Instalator jest już uruchomiony!"
|
||||
${LangFileString} StillInstalled "LyX ${APP_SERIES_KEY2} jest już zainstalowany! Aby kontynować musisz go najpierw usunąć."
|
||||
${LangFileString} NewerInstalled "You are trying to install an older version of LyX than what you have installed.$\r$\n\
|
||||
If you really want this, you must uninstall the existing LyX $OldVersionNumber before."
|
||||
${LangFileString} NewerInstalled "Próbujesz zainstalować starszą wersję LyX, niż ta która jest już zainstalowana.$\r$\n\
|
||||
Jeżeli naprawdę chcesz tego dokonać, musisz wpierw odinstalować LyX $OldVersionNumber."
|
||||
|
||||
${LangFileString} MultipleIndexesNotAvailable "The support for using several indexes in a document will not be available because$\r$\n\
|
||||
MiKTeX was installed with administrator privileges but you are installing LyX without them."
|
||||
${LangFileString} MetafileNotAvailable "The LyX support for images in the format EMF or WMF will not be$\r$\n\
|
||||
available because that requires to install a software printer to$\r$\n\
|
||||
Windows which is only possible with administrator privileges."
|
||||
${LangFileString} MultipleIndexesNotAvailable "Wsparcie dla używania wielu indeksów w dokumencie nie będzie dostępne, ponieważ$\r$\n\
|
||||
MiKTeX został zainstalowany z uprawnieniami administratora, natomiast instalujesz LyX bez nich."
|
||||
${LangFileString} MetafileNotAvailable "Wsparcie LyX dla formatów graficznych EMF i WMF nie będzie$\r$\n\
|
||||
dostępne, ponieważ wymaga to instalacji drukarki programowej dla$\r$\n\
|
||||
Windows co jest możliwe tylko z uprawnieniami administratora."
|
||||
|
||||
${LangFileString} FinishPageMessage "Gratulacje! LyX został pomyślnie zainstalowany.$\r$\n\
|
||||
$\r$\n\
|
||||
(Pierwsze uruchomienie może potrwać kilka sekund.)"
|
||||
${LangFileString} FinishPageRun "Uruchom LyX-a"
|
||||
${LangFileString} FinishPageRun "Uruchom LyX"
|
||||
|
||||
${LangFileString} UnNotInRegistryLabel "Nie mo¿na znaleŸæ LyX-a w rejestrze.$\r$\n\
|
||||
${LangFileString} UnNotInRegistryLabel "Nie można znaleźć LyX$\'a w rejestrze.$\r$\n\
|
||||
Skróty na pulpicie i w menu Start nie zostaną usunięte."
|
||||
${LangFileString} UnInstallRunning "Musisz najpierw zamkn¹æ LyX-a!"
|
||||
${LangFileString} UnInstallRunning "Musisz najpierw zamknąć LyX$\'a!"
|
||||
${LangFileString} UnNotAdminLabel "Musisz posiadać prawa administratora do deinstalacji programu LyX."
|
||||
${LangFileString} UnReallyRemoveLabel "Czy na pewno chcesz usun¹æ LyX-a i wszystkie jego komponenty?"
|
||||
${LangFileString} UnLyXPreferencesTitle 'LyX$\'s user preferences'
|
||||
${LangFileString} UnReallyRemoveLabel "Czy na pewno chcesz usunąć LyX$\'a i wszystkie jego komponenty?"
|
||||
${LangFileString} UnLyXPreferencesTitle 'Preferencje użytkownika LyX$\'a'
|
||||
|
||||
${LangFileString} SecUnMiKTeXDescription "Uninstalls the LaTeX-distribution MiKTeX."
|
||||
${LangFileString} SecUnJabRefDescription "Uninstalls the bibliography manager JabRef."
|
||||
${LangFileString} SecUnPreferencesDescription 'Deletes LyX$\'s configuration folder$\r$\n\
|
||||
${LangFileString} SecUnMiKTeXDescription "Deinstalacja MikTeX, dystrybucji LaTeX."
|
||||
${LangFileString} SecUnJabRefDescription "Deinstalacja zarządcy bibliografii JabRef."
|
||||
${LangFileString} SecUnPreferencesDescription 'Usuwa folder konfiguracji LyX$\'a$\r$\n\
|
||||
$\"$AppPre\username\$AppSuff\${APP_DIR_USERDATA}$\"$\r$\n\
|
||||
for all users.'
|
||||
${LangFileString} SecUnProgramFilesDescription "Uninstall LyX and all of its components."
|
||||
wszystkim użytkownikom.'
|
||||
${LangFileString} SecUnProgramFilesDescription "Deinstalacja LyX i wszystkich jego komponentów."
|
||||
|
||||
|
@ -1,15 +1,15 @@
|
||||
/*
|
||||
|
||||
Windows PDF view helper
|
||||
Author: Joost Verburg
|
||||
Author: Joost Verburg and Uwe Stöhr
|
||||
|
||||
This will be installed as pdfview.exe.
|
||||
|
||||
The application will launch the default PDF viewer to display the PDF file,
|
||||
but works around the file locking problems of Adobe Reader.
|
||||
but works around the file locking problems of Adobe Reader and Acrobat.
|
||||
|
||||
Source code of pdfopen/pdfclose is available at:
|
||||
http://magic.aladdin.cs.cmu.edu/2005/07/15/pdfopen-and-pdfclose/
|
||||
The files pdfopen/pdfclose are part of this archive:
|
||||
http://www.tex.ac.uk/tex-archive/systems/win32/w32tex/pdftex-w32.tar.xz
|
||||
|
||||
*/
|
||||
|
||||
@ -25,7 +25,7 @@ Icon "..\packaging\icons\lyx.ico"
|
||||
SilentInstall silent
|
||||
|
||||
#--------------------------------
|
||||
# Windows Vista settings
|
||||
# Windows Vista (and later) settings
|
||||
|
||||
RequestExecutionLevel user
|
||||
|
||||
@ -35,7 +35,9 @@ RequestExecutionLevel user
|
||||
!define FALSE 0
|
||||
!define TRUE 1
|
||||
|
||||
# http://msdn.microsoft.com/en-us/library/windows/desktop/aa364417%28v=vs.85%29.aspx
|
||||
!define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010
|
||||
# http://msdn.microsoft.com/en-us/library/windows/desktop/ms687032%28v=vs.85%29.aspx
|
||||
!define WAIT_TIMEOUT 0x00000102
|
||||
|
||||
#--------------------------------
|
||||
@ -51,17 +53,12 @@ Var OriginalDir
|
||||
Var PDFFile
|
||||
Var ViewerFileName
|
||||
Var Viewer
|
||||
Var ViewerVersion
|
||||
Var DDEName
|
||||
|
||||
Var ChangeNotification
|
||||
Var WaitReturn
|
||||
Var LockedFile
|
||||
|
||||
Var OriginalTimeHigh
|
||||
Var OriginalTimeLow
|
||||
Var CurrentTimeHigh
|
||||
Var CurrentTimeLow
|
||||
Var TimeDiff
|
||||
|
||||
#--------------------------------
|
||||
# Macros
|
||||
@ -89,6 +86,76 @@ Var CurrentTimeLow
|
||||
|
||||
!macroend
|
||||
|
||||
# all following macros and functions are from
|
||||
# http://nsis.sourceforge.net/FileTimeDiff
|
||||
!define GetFileTimeS "!insertmacro _GetFileTimeS"
|
||||
|
||||
!macro _GetFileTimeS _Time_ _File_
|
||||
|
||||
Push "${_File_}"
|
||||
Call GetFileTimeS
|
||||
Pop ${_Time_}
|
||||
|
||||
!macroend
|
||||
|
||||
Function GetFileTimeS
|
||||
|
||||
Exch $0 ;; File / hi
|
||||
Push $1 ;; lo
|
||||
|
||||
ClearErrors
|
||||
GetFileTime "$0" $0 $1
|
||||
IfErrors err
|
||||
System::Call '*(i r1, i r0) i .r0'
|
||||
System::Call '*$0(l .r0)'
|
||||
System::Int64Op $0 / 10000000 ;; Conversion From '100 ns' to '1 sec' unit
|
||||
Goto end
|
||||
|
||||
err:
|
||||
Push ""
|
||||
SetErrors
|
||||
Goto +3
|
||||
end:
|
||||
System::Free $0
|
||||
Exch 2
|
||||
Pop $0
|
||||
Pop $1
|
||||
|
||||
FunctionEnd
|
||||
|
||||
!define FileTimeDiff "!insertmacro _FileTimeDiff"
|
||||
|
||||
!macro _FileTimeDiff _RetVal_ _FileA_ _FileB_
|
||||
|
||||
Push "${_FileB_}"
|
||||
Push "${_FileA_}"
|
||||
Call FileTimeDiff
|
||||
Pop ${_RetVal_}
|
||||
|
||||
!macroend
|
||||
|
||||
Function FileTimeDiff
|
||||
Exch $0 ;; FileA
|
||||
Exch
|
||||
Exch $1 ;; FileB
|
||||
|
||||
${GetFileTimeS} $0 "$0"
|
||||
IfErrors err
|
||||
${GetFileTimeS} $1 "$1"
|
||||
IfErrors err
|
||||
System::Int64Op $0 - $1
|
||||
Goto end
|
||||
|
||||
err:
|
||||
Push ""
|
||||
SetErrors
|
||||
end:
|
||||
Exch 2
|
||||
Pop $0
|
||||
Pop $1
|
||||
|
||||
FunctionEnd
|
||||
|
||||
#--------------------------------
|
||||
# PDF viewing
|
||||
|
||||
@ -130,55 +197,33 @@ Section "View PDF file"
|
||||
${EndIf}
|
||||
|
||||
${If} $Viewer == "AcroRd32.exe"
|
||||
${OrIf} $Viewer == "Acrobat.exe"
|
||||
${OrIf} $Viewer == "Acrobat.exe"
|
||||
|
||||
# Using Adobe viewer
|
||||
|
||||
GetDLLVersion $ViewerFileName $R0 $R1
|
||||
IntOp $R2 $R0 >> 16
|
||||
IntOp $R2 $R2 & 0x0000FFFF ; $R2 now contains major version
|
||||
IntOp $R3 $R0 & 0x0000FFFF ; $R3 now contains minor version
|
||||
IntOp $R4 $R1 >> 16
|
||||
IntOp $R4 $R4 & 0x0000FFFF ; $R4 now contains release
|
||||
IntOp $R5 $R1 & 0x0000FFFF ; $R5 now contains build
|
||||
StrCpy $ViewerVersion "$R2"
|
||||
|
||||
${If} $ViewerVersion < 10
|
||||
StrCpy $DDEName "AcroView"
|
||||
${Else}
|
||||
${If} $Viewer == "AcroRd32.exe"
|
||||
StrCpy $DDEName "AcroViewR$ViewerVersion"
|
||||
${ElseIf} $Viewer == "Acrobat.exe"
|
||||
StrCpy $DDEName "AcroViewA$ViewerVersion"
|
||||
${EndIf}
|
||||
${EndIf}
|
||||
|
||||
# Close existing view
|
||||
${If} ${FileExists} $PDFFile
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfclose.exe" --reader "$ViewerFileName" --ddename "$DDEName" --file "$PDFFile"'
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfclose.exe" --file "$PDFFile"'
|
||||
${EndIf}
|
||||
|
||||
# Copy PDF to temporary file to allow LyX to overwrite the original
|
||||
CopyFiles /SILENT $OriginalFile $PDFFile
|
||||
|
||||
# Open a new view
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfopen.exe" --reader "$ViewerFileName" --ddename "$DDEName" --back --file "$PDFFile"'
|
||||
|
||||
# Monitor for updates of the original file
|
||||
GetFileTime $OriginalFile $OriginalTimeHigh $OriginalTimeLow
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfopen.exe" --file "$PDFFile"'
|
||||
|
||||
# check if a file in LyX's temp folder has been changed
|
||||
!insertmacro SystemCall "kernel32::FindFirstChangeNotification(t '$OriginalDir', \
|
||||
i 1, i ${FILE_NOTIFY_CHANGE_LAST_WRITE}) i.s"
|
||||
Pop $ChangeNotification
|
||||
|
||||
${Do}
|
||||
|
||||
# wait until the folder is not changed anymore, if so a "0" is returned
|
||||
# otherwise a "258" (0x00000102) is returned
|
||||
!insertmacro SystemCall "kernel32::WaitForSingleObject(i $ChangeNotification, i 10000) i.s"
|
||||
Pop $WaitReturn
|
||||
|
||||
# Check whether the lock is still active (if not, Adobe Reader is closed)
|
||||
|
||||
# Check whether the lock of the PDF file is still active (if not, Adobe Reader is closed)
|
||||
FileOpen $LockedFile $PDFFile a
|
||||
|
||||
${If} $LockedFile != ""
|
||||
# Quit this application
|
||||
FileClose $LockedFile
|
||||
@ -187,29 +232,40 @@ Section "View PDF file"
|
||||
Quit
|
||||
${EndIf}
|
||||
|
||||
# if the folder is (for now) not changed anymore
|
||||
${IfNot} $WaitReturn = ${WAIT_TIMEOUT}
|
||||
|
||||
# check if the PDF-file in our temp directory is older than the one
|
||||
# in LyX's temp folder because then it has been changed by LaTeX
|
||||
${FileTimeDiff} $TimeDiff "$PDFFile" "$OriginalFile"
|
||||
|
||||
# The LyX temporary directory has been updated
|
||||
# Check whether it's the PDF file that has been updated
|
||||
# if the file is older than 1 second
|
||||
${If} $TimeDiff < -1
|
||||
# close the PDF
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfclose.exe" --file "$PDFFile"'
|
||||
|
||||
GetFileTime $OriginalFile $CurrentTimeHigh $CurrentTimeLow
|
||||
|
||||
${If} $OriginalTimeHigh != $CurrentTimeHigh
|
||||
${OrIf} $OriginalTimeLow != $CurrentTimeLow
|
||||
# PDF has been modified, update view
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfclose.exe" --reader "$ViewerFileName" --ddename "$DDEName" --file "$PDFFile"'
|
||||
CopyFiles /SILENT $OriginalFile $PDFFile
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfopen.exe" --reader "$ViewerFileName" --ddename "$DDEName" --back --file "$PDFFile"'
|
||||
# The problem is now that LaTeX might need several runs and therefore the PDF can
|
||||
# also be rewritten consecutively several times.
|
||||
# If we would directly open the file we will get in troubles as the PDF can be
|
||||
# unreadable. We also don't know the time of a LaTeX run.
|
||||
# (As example take UserGuide.lyx, view it, then remove a letter in a section heading
|
||||
# and finally update the view.)
|
||||
# We therefore loop until the PDF is no longer changed and wait some time in each loop.
|
||||
${Do}
|
||||
CopyFiles /SILENT $OriginalFile $PDFFile
|
||||
# wait 1.666 seconds (is empirically enough time that the PDF can be changed)
|
||||
Sleep 1666
|
||||
${FileTimeDiff} $TimeDiff "$PDFFile" "$OriginalFile"
|
||||
${LoopUntil} $TimeDiff = 0
|
||||
|
||||
# Time of new file
|
||||
StrCpy $OriginalTimeHigh $CurrentTimeHigh
|
||||
StrCpy $OriginalTimeLow $CurrentTimeLow
|
||||
# open the new file
|
||||
!insertmacro HideConsole '"$EXEDIR\pdfopen.exe" --file "$PDFFile"'
|
||||
${EndIf}
|
||||
|
||||
#Monitor again
|
||||
!insertmacro SystemCall "kernel32::FindNextChangeNotification(i $ChangeNotification)"
|
||||
|
||||
${EndIf}
|
||||
${EndIf} # end ifnot
|
||||
|
||||
${Loop}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user