-Version LyX 1.5svn-15-04-2007
+Version LyX 1.5svn-xx-04-2007
+- LyX 1.5svn from xx-04-2007
+ - math-macro fixes
+
+- fix bug that JabRef wasn't recognized by the uninstaller
+- Update installer: require to close LyX before it can be updated
+- Update installer: fix bug that sessions files weren't actualized while
+ updating
+
+
+Version LyX 1.5svn-15-04-2007
- LyX 1.5svn from 15-04-2007
- reworked paragraph dialog
Abort
${endif} ; endif $LatexPath != ""
${endif}
-
+
+ ; if GhostScript is not installed
${if} $GhostscriptPath == ""
; register Ghostscript
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_DLL" "${GhostscriptDir}\bin\gsdll32.dll"
RMDir /r ${GhostscriptDir}
${endif}
+ ; if ImageMagick is not installed
${if} $ImageMagickPath == ""
; register ImageMagick
WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
RMDir /r ${ImageMagickDir}
${endif}
+ ; if Aspell is not installed
${if} $AspellPath == ""
; extract Aspell's program files
SetOutPath "$INSTDIR\external"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Aspell" "UninstallString" "${AspellDir}\${AspellUninstall}"
${endif}
+ ; if Aiksaurus is not installed
${if} $AiksaurusPath == ""
; extract Aiksaurus' program files
SetOutPath "$INSTDIR\external"
; WriteRegStr HKLM "Software\Aiksaurus" "Data Path" "${AiksaurusDir}"
${endif}
+ ; if no PostScript viewer is installed
${if} $PSVPath == ""
${if} $InstallGSview == "true"
; launch installer
${endif}
${endif}
${endif}
-
+
+ ; if no BibTeX editor is installed
${if} $BibTeXEditorPath == ""
${if} $InstallJabRef == "true"
; launch installer
File /r "${PRODUCT_SOURCEDIR}\etc"
File /r "${PRODUCT_SOURCEDIR}\Resources"
+ ; if GhostScript is not installed
${if} $GhostscriptPath == ""
; register Ghostscript
WriteRegStr HKLM "SOFTWARE\GPL Ghostscript\${GhostscriptVersion}" "GS_DLL" "${GhostscriptDir}\bin\gsdll32.dll"
RMDir /r ${GhostscriptDir}
${endif}
+ ; if ImageMagick is not installed
${if} $ImageMagickPath == ""
; register ImageMagick
WriteRegStr HKLM "SOFTWARE\Classes\Applications" "AutoRun" "${ImageMagickDir}\convert.exe $$"
RMDir /r ${ImageMagickDir}
${endif}
+ ; if Aspell is not installed
${if} $AspellPath == ""
; extract Aspell's program files
SetOutPath "$INSTDIR\external"
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Aspell" "UninstallString" "${AspellDir}\${AspellUninstall}"
${endif}
+ ; if Aiksaurus is not installed
${if} $AiksaurusPath == ""
; extract Aiksaurus' program files
SetOutPath "$INSTDIR\external"
--- /dev/null
+; The '-' makes the section invisible.
+; Sections are entered in order, so the settings above are all
+; available to SecInstallation
+Section "-Installation actions" SecInstallation
+
+ ; extract modified files
+ Call UpdateModifiedFiles ; macro from Updated.nsh
+
+ ; delete files
+ Call DeleteFiles ; macro from Deleted.nsh
+
+ ; delete old uninstaller
+ Delete "${PRODUCT_UNINSTALL_EXE}"
+
+ ; delete old start menu folder
+ ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY_OLD}" "StartMenu"
+ RMDir /r $0
+ ; delete desktop icon
+ Delete "$DESKTOP\${PRODUCT_VERSION_OLD}.lnk"
+
+ ; delete old registry entries
+ DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY_OLD}"
+ DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
+ DeleteRegKey HKCR "Applications\lyx.bat"
+ ; remove extension .lyx
+ ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
+ DeleteRegKey HKCR "${PRODUCT_NAME}"
+
+ ; determine the new name of the install location,
+ ; only when the user has used the default path settings of the previous LyX-version
+ StrCpy $String $INSTDIR
+ StrCpy $Search "${PRODUCT_VERSION_OLD}"
+ StrLen $3 $String
+ Call StrPoint ; search the $INSTDIR for the phrase in ${PRODUCT_VERSION_OLD} ; function from LyXUtils.nsh
+ ${if} $Pointer != "-1" ; if something was found
+
+ IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\${PRODUCT_VERSION_OLD}"
+ StrCpy $String $String "$Pointer" ; $String is now the part before "\${PRODUCT_VERSION_OLD}"
+ ; rename the installation folder by copying LyX files
+ StrCpy $INSTDIR_NEW "$String\LyX ${PRODUCT_VERSION}"
+ CreateDirectory "$INSTDIR_NEW"
+ CopyFiles "$INSTDIR\*.*" "$INSTDIR_NEW"
+ ; delete the old folder
+ RMDir /r $INSTDIR
+ StrCpy $INSTDIR $INSTDIR_NEW
+
+ ; set new PATH_PREFIX in the file lyxrc.dist
+ FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" a
+ FileRead $R1 $PathPrefix
+ ${WordReplace} $PathPrefix "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $PathPrefix
+ FileSeek $R1 0 ; set file pointer to the beginning
+ FileWrite $R1 '$PathPrefix' ; overwrite the existing path with the actual one
+ FileClose $R1
+
+ ; set the new path to the preferences file for all users
+ StrCpy $FileName "preferences"
+ StrCpy $OldString "${PRODUCT_VERSION_OLD}"
+ StrCpy $NewString "LyX ${PRODUCT_VERSION}"
+ Call CheckAppPathPreferences ; function from LyXUtils.nsh
+
+ ; set the new path to the session file for all users
+ StrCpy $FileName "session"
+ Call CheckAppPathPreferences ; function from LyXUtils.nsh
+
+ ; set new path to ImageMagick
+ ReadRegStr $ImageMagickPath SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
+ ${if} $ImageMagickPath != ""
+ ${WordReplace} $ImageMagickPath "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $ImageMagickPath ; macro from WordFunc.nsh
+ WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" "$ImageMagickPath"
+ ${endif}
+
+ ${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
+
+ ; register LyX
+ WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "LyX ${PRODUCT_VERSION}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "${PRODUCT_EXE}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_INFO_URL}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_ABOUT_URL}"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "LyX Team"
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "HelpLink" "${PRODUCT_HELP_LINK}"
+ WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
+ WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
+
+ ; create start menu entry
+ SetOutPath "$INSTDIR\bin"
+ CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
+ CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
+ SetOutPath "$INSTDIR"
+ CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
+
+ ; create desktop icon
+ ${if} $CreateDesktopIcon == "true"
+ SetOutPath "$INSTDIR\bin"
+ CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
+ ${endif}
+
+ ; register the extension .lyx
+ ${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
+ ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
+
+ ; create Uninstaller
+ WriteUninstaller "${PRODUCT_UNINSTALL_EXE}"
+
+ ; test if Python is installed
+ ; only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
+ ; with outdated Python interpreters
+ ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
+ ${if} $PythonPath == ""
+ StrCpy $PythonPath "$INSTDIR\bin"
+ ${else}
+ StrCpy $PythonPath $PythonPath -1 ; remove the "\" at the end
+ ${endif}
+
+ ; run LyX's configure script
+ ; create a bat-file to start configure in a console window so that the user see the progress
+ ; of the configuration and to have a signal when the configuration is ready to start LyX
+ ; this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
+ ; time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
+ ; a batch file is needed because simply calling ExecWait '"$PythonPath\python.exe" "$INSTDIR\Resources\configure.py"'
+ ; creates the config files in $INSTDIR\bin
+ StrCpy $1 $INSTDIR 2 ; get drive letter
+ FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
+ FileWrite $R1 '$1$\r$\n\
+ cd $INSTDIR\Resources\$\r$\n\
+ "$PythonPath\python.exe" configure.py'
+ FileClose $R1
+ MessageBox MB_OK|MB_ICONINFORMATION "$(LatexConfigInfo)"
+ ExecWait '"$INSTDIR\Resources\configLyX.bat"'
+ Delete "$INSTDIR\Resources\configLyX.bat"
+
+SectionEnd
!macroend
;--------------------
+; function that creates the installer page for the language setting
Function SelectMenuLanguage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "io_ui_language.ini"
;--------------------------------
; Languages
-!insertmacro MUI_LANGUAGE "English" # first language is the default language
+!insertmacro MUI_LANGUAGE "English" ; first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "French"
; This hook function is called internally by NSIS on installer startup
Function .onInit
- ; set the installer language to the Windows locale language
+ ; set the installer language to the Windows locale language
System::Call "kernel32::GetUserDefaultLangID()i.a"
- ; Check that the installer is not currently running
+ ; check that the installer is not currently running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${INSTALLER_EXE}.Instance") i .r1 ?e'
Pop $R0
${if} $R0 != "0"
Abort
${endif}
- ; Check if LyX is already installed
+ ; check if LyX is already installed
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
${if} $0 != ""
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
- ; Default settings
- ; These can be reset to "all" in section SecAllUsers.
+ ; default settings
+ ; these can be reset to "all" in section SecAllUsers
SetShellVarContext current
StrCpy $ProductRootKey "HKCU"
- ; This can be reset to "true" in section SecDesktop.
+ ; this can be reset to "true" in section SecDesktop
StrCpy $CreateDesktopIcon "false"
StrCpy $CreateFileAssociations "false"
- ; If the user does *not* have administrator privileges, abort
+ ; if the user does *not* have administrator privileges, abort
StrCpy $Answer ""
StrCpy $UserName ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
;--------------------------------
; Languages
-!insertmacro MUI_LANGUAGE "English" # first language is the default language
+!insertmacro MUI_LANGUAGE "English" ; first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "French"
; This hook function is called internally by NSIS on installer startup
Function .onInit
- ; set the installer language to the Windows locale language
+ ; set the installer language to the Windows locale language
System::Call "kernel32::GetUserDefaultLangID()i.a"
- ; Check that the installer is not currently running
+ ; check that the installer is not currently running
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${INSTALLER_EXE}.Instance") i .r1 ?e'
Pop $R0
${if} $R0 != "0"
Abort
${endif}
- ; Check if LyX is already installed
+ ; check if LyX is already installed
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "Publisher"
${if} $0 != ""
MessageBox MB_OK|MB_ICONSTOP "$(StillInstalled)"
Abort
${endif}
- ; Default settings
- ; These can be reset to "all" in section SecAllUsers.
+ ; default settings
+ ; these can be reset to "all" in section SecAllUsers
SetShellVarContext current
StrCpy $ProductRootKey "HKCU"
- ; This can be reset to "true" in section SecDesktop.
+ ; this can be reset to "true" in section SecDesktop
StrCpy $CreateDesktopIcon "false"
StrCpy $CreateFileAssociations "false"
- ; If the user does *not* have administrator privileges, abort
+ ; if the user does *not* have administrator privileges, abort
StrCpy $Answer ""
StrCpy $UserName ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
!define PRODUCT_DIR "D:\LyXPackage1.5"
!define PRODUCT_NAME "LyX"
-!define PRODUCT_VERSION "1.5svn-15-04-2007"
+!define PRODUCT_VERSION "1.5svn-xx-04-2007"
!define PRODUCT_VERSION_SHORT "150svn"
!define PRODUCT_SUBFOLDER "lyx15"
!define PRODUCT_LICENSE_FILE "${PRODUCT_DIR}\License.txt"
!define PRODUCT_BAT "$INSTDIR\bin\lyx.bat"
!define PRODUCT_EXT ".lyx"
!define PRODUCT_MIME_TYPE "application/lyx"
-!define PRODUCT_UNINSTALL_EXE "$INSTDIR\LyXWinUninstall.exe"
+!define PRODUCT_UNINSTALL_EXE "$INSTDIR\LyXWinUninstall${PRODUCT_VERSION}.exe"
!define PRODUCT_HELP_LINK "http://www.lyx.org/internet/mailing.php"
!define PRODUCT_ABOUT_URL "http://www.lyx.org/about/"
!define PRODUCT_INFO_URL "http://www.lyx.org/"
-BrandingText "LyXWinInstaller v3.12 - Update"
+BrandingText "LyXWinInstaller v3.13 - Update"
!define INSTALLER_VERSION "Small"
-!define INSTALLER_EXE "LyXWin150svnUpdate-3-12.exe"
-!define INSTALLER2_EXE "LyXWin150svnSmall-3-12.exe" ; to check later if this installer version is running at the same time
-!define INSTALLER3_EXE "LyXWin150svnComplete-3-12.exe" ; to check later if this installer version is running at the same time
+!define INSTALLER_EXE "LyXWin150svnUpdate-3-13.exe"
+!define INSTALLER2_EXE "LyXWin150svnSmall-3-13.exe" ; to check later if this installer version is running at the same time
+!define INSTALLER3_EXE "LyXWin150svnComplete-3-13.exe" ; to check later if this installer version is running at the same time
!define VERSION_BITMAP "${PRODUCT_DIR}\icons\lyx_logo_vert${PRODUCT_VERSION_SHORT}.bmp"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\lyx.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX${PRODUCT_VERSION_SHORT}"
!define PRODUCT_UNINST_KEY_OLD "Software\Microsoft\Windows\CurrentVersion\Uninstall\LyX150svn"
-!define PRODUCT_VERSION_OLD "LyX 1.5svn-09-04-2007"
+!define PRODUCT_VERSION_OLD "LyX 1.5svn-15-04-2007"
+!define PRODUCT_UNINSTALL_EXE_OLD "$INSTDIR\LyXWinUninstall.exe"
;--------------------------------
; Make some of the information above available to NSIS.
; Variables
Var LatexPath
-Var EditorPath
Var PythonPath
Var ImageMagickPath
Var PathPrefix
Var Pointer
Var UserList
Var INSTDIR_NEW
+Var FileName
Var OldString
Var NewString
;--------------------------------
; Languages
-!insertmacro MUI_LANGUAGE "English" # first language is the default language
+!insertmacro MUI_LANGUAGE "English" ; first language is the default language
!insertmacro MUI_LANGUAGE "Danish"
!insertmacro MUI_LANGUAGE "Dutch"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_DESCRIPTION_TEXT ${SecDesktop} "$(SecDesktopDescription)"
!insertmacro MUI_FUNCTION_DESCRIPTION_END
+; the installation section
+!include "InstallActions-update.nsh"
+
;--------------------------------
; This hook function is called internally by NSIS on installer startup
Function .onInit
- ; set the installer language to the Windows locale language
+ ; Check that LyX is not currently running
+ FindProcDLL::FindProc "lyx.exe"
+ ${if} $R0 == "1"
+ MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
+ Abort
+ ${endif}
+
+ ; set the installer language to the Windows locale language
System::Call "kernel32::GetUserDefaultLangID()i.a"
; Check that the installer is not currently running
Abort
${endif}
- ; Check where LyX is installed
+ ; check where LyX is installed
ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY_OLD}" "DisplayIcon"
${if} $0 != ""
SetShellVarContext all
StrCpy $INSTDIR $INSTDIR -12 ; delete the string "\bin\lyx.exe" or "\bin\lyx.bat"
${endif}
- ; If the user does *not* have administrator privileges, abort
+ ; abort if the user doesn't have administrator privileges but LyX was installed as admin
StrCpy $Answer ""
StrCpy $UserName ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
FunctionEnd
;--------------------------------
+; The Uninstaller
-; The '-' makes the section invisible.
-; Sections are entered in order, so the settings above are all
-; available to SecInstallation
-Section "-Installation actions" SecInstallation
+Function un.onInit
+
+ ; Check that LyX is not currently running
+ FindProcDLL::FindProc "lyx.exe"
+ ${if} $R0 == "1"
+ MessageBox MB_OK|MB_ICONSTOP "$(UnInstallRunning)"
+ Abort
+ ${endif}
- ; extract modified files
- Call UpdateModifiedFiles ; macro from Updated.nsh
-
- ; delete files
- Call DeleteFiles ; macro from Deleted.nsh
+ ; set registry root key
+ StrCpy $Answer ""
+ !insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
+ ${if} $Answer == "yes"
+ SetShellVarContext all
+ ${else}
+ SetShellVarContext current
+ ${endif}
- ; delete old start menu folder
- ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY_OLD}" "StartMenu"
- RMDir /r $0
- ; delete desktop icon
- Delete "$DESKTOP\${PRODUCT_NAME}.lnk" ; remove this for the next version!
- ; Delete "$DESKTOP\${PRODUCT_VERSION_OLD}.lnk" ; for the next version
-
- ; delete old registry entries
- DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY_OLD}"
- DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
- DeleteRegKey HKCR "Applications\lyx.bat"
- ; remove extension .lyx
- ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
- DeleteRegKey HKCR "${PRODUCT_NAME}"
+ ; Ascertain whether the user has sufficient privileges to uninstall.
+ ; abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
+ ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
+ ${if} $0 != ""
+ ${andif} $Answer != "yes"
+ MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
+ Abort
+ ${endif}
+ ; abort when LyX couldn't be found in the registry
+ ${if} $0 == "" ; check in HKCU
+ ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
+ ${if} $0 == ""
+ MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
+ ${endif}
+ ${endif}
- ; determine the new name of the install location,
- ; only when the user has used the default path settings of the previous LyX-version
- StrCpy $String $INSTDIR
- StrCpy $Search "${PRODUCT_VERSION_OLD}"
+FunctionEnd
+
+Function un.onUninstSuccess
+
+ HideWindow ; hides the uninstaller Window when it is ready
+
+FunctionEnd
+
+Section "un.LyX" un.SecUnProgramFiles
+
+ SectionIn RO
+
+ ; delete LaTeX class files that were installed together with LyX
+ FileOpen $R5 "$INSTDIR\Resources\uninstallPaths.dat" r
+ FileRead $R5 $LatexPath
+ FileClose $R5
+ StrCpy $String $LatexPath
+ StrCpy $Search "miktex\bin"
StrLen $3 $String
- Call StrPoint ; search the $INSTDIR for the phrase in ${PRODUCT_VERSION_OLD} ; function from LyXUtils.nsh
+ Call un.StrPoint ; search the LaTeXPath for the phrase "miktex\bin" (function from LyXUtils.nsh)
${if} $Pointer != "-1" ; if something was found
-
- IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\${PRODUCT_VERSION_OLD}"
- StrCpy $String $String "$Pointer" ; $String is now the part before "\${PRODUCT_VERSION_OLD}"
- ; rename the installation folder by copying LyX files
- StrCpy $INSTDIR_NEW "$String\LyX ${PRODUCT_VERSION}"
- CreateDirectory "$INSTDIR_NEW"
- CopyFiles "$INSTDIR\*.*" "$INSTDIR_NEW"
- ; delete the old folder
- RMDir /r $INSTDIR
- StrCpy $INSTDIR $INSTDIR_NEW
-
- ; set new PATH_PREFIX in the file lyxrc.dist
- FileOpen $R1 "$INSTDIR\Resources\lyxrc.dist" a
- FileRead $R1 $PathPrefix
- ${WordReplace} $PathPrefix "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $PathPrefix
- FileSeek $R1 0 ; set file pointer to the beginning
- FileWrite $R1 '$PathPrefix' ; overwrite the existing path with the actual one
- FileClose $R1
-
- ; set the new path to the preferences files for all users
- StrCpy $OldString "${PRODUCT_VERSION_OLD}"
- StrCpy $NewString "LyX ${PRODUCT_VERSION}"
- Call CheckAppPathPreferences ; function from LyXUtils.nsh
-
- ; Copy the given strings to variables that the Function "ReplaceLineContent" can later access them
- ; set new PDF-viewer settings also to the preferences file for all users
- StrCpy $OldString "PDFViewWin7"
- StrCpy $NewString "PDFViewWin"
- Call CheckAppPathPreferences ; function from LyXUtils.nsh
- ; set new PDF-viewer settings also to the preferences file in the $INSTDIR
- ; search for "$OldString" and replace it with "$NewString"
- ; calls function "ReplaceLineContent" from LyXUtils.nsh
- ${LineFind} "$INSTDIR\Resources\preferences" "" "1:-1" "ReplaceLineContent" ; macro from TextFunc.nsh
-
- ; set new path to ImageMagick
- ReadRegStr $ImageMagickPath SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
- ${if} $ImageMagickPath != ""
- ${WordReplace} $ImageMagickPath "${PRODUCT_VERSION_OLD}" "LyX ${PRODUCT_VERSION}" "+" $ImageMagickPath ; macro from WordFunc.nsh
- WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" "$ImageMagickPath"
- ${endif}
-
- ${endif} ; end ${if} $Pointer != "-1" (if the folder is renamed)
-
- ; register LyX
- WriteRegStr SHCTX "${PRODUCT_DIR_REGKEY}" "" "${PRODUCT_EXE}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "$ProductRootKey"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayName" "LyX ${PRODUCT_VERSION}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "UninstallString" "${PRODUCT_UNINSTALL_EXE}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayIcon" "${PRODUCT_EXE}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu" "$SMPROGRAMS\$StartmenuFolder"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLUpdateInfo" "${PRODUCT_INFO_URL}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_ABOUT_URL}"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "Publisher" "LyX Team"
- WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "HelpLink" "${PRODUCT_HELP_LINK}"
- WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoModify" 0x00000001
- WriteRegDWORD SHCTX "${PRODUCT_UNINST_KEY}" "NoRepair" 0x00000001
-
- ; create start menu entry
- SetOutPath "$INSTDIR\bin"
- CreateDirectory "$SMPROGRAMS\$StartmenuFolder"
- CreateShortCut "$SMPROGRAMS\$StartmenuFolder\${PRODUCT_NAME}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
- SetOutPath "$INSTDIR"
- CreateShortCut "$SMPROGRAMS\$StartmenuFolder\Uninstall.lnk" "${PRODUCT_UNINSTALL_EXE}"
-
- ; create desktop icon
- ${if} $CreateDesktopIcon == "true"
- SetOutPath "$INSTDIR\bin"
- CreateShortCut "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk" "${PRODUCT_BAT}" "" "${PRODUCT_EXE}"
+ IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\miktex\bin"
+ StrCpy $String $String "$Pointer" ; $String is now the part before "\miktex\bin"
+ Delete "$String\tex\latex\cv.cls"
+ RMDir /r "$String\tex\latex\lyx"
+ RMDir /r "$String\tex\latex\revtex"
+ RMDir /r "$String\tex\latex\hollywood"
+ RMDir /r "$String\tex\latex\broadway"
+ ExecWait "$LatexPath\initexmf --update-fndb"
${endif}
+
+ ; delete start menu folder
+ ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu"
+ RMDir /r "$0"
+ ; delete desktop icon
+ Delete "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk"
+ ; delete registry entries
+ DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
- ; register the extension .lyx
- ${CreateApplicationAssociation} "${PRODUCT_NAME}" "${PRODUCT_NAME}" "$(FileTypeTitle)" "${PRODUCT_EXE}" "${PRODUCT_BAT}"
- ${CreateFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}" "${PRODUCT_MIME_TYPE}"
-
- ; test if Python is installed
- ; only use an existing python when it is version 2.5 because many Compaq and Dell PC are delivered
- ; with outdated Python interpreters
- ReadRegStr $PythonPath HKLM "Software\Python\PythonCore\2.5\InstallPath" ""
- ${if} $PythonPath == ""
- StrCpy $PythonPath "$INSTDIR\bin"
- ${else}
- StrCpy $PythonPath $PythonPath -1 ; remove the "\" at the end
- ${endif}
+ ; run the installer of the old LyX version to clean up the third party products
+ WriteRegStr SHCTX "${PRODUCT_UNINST_KEY}" "RootKey" "Start" ; dummy entry to let the uninstaller start
+ Exec "${PRODUCT_UNINSTALL_EXE_OLD}"
- ; run LyX's configure script
- ; create a bat-file to start configure in a console window so that the user see the progress
- ; of the configuration and to have a signal when the configuration is ready to start LyX
- ; this is important when LyX is installed together with MiKTeX or when LyX is installed for the first
- ; time on a computer, because the installation of missing LaTeX-files required by LyX could last minutes
- ; a batch file is needed because simply calling ExecWait '"$PythonPath\python.exe" "$INSTDIR\Resources\configure.py"'
- ; creates the config files in $INSTDIR\bin
- StrCpy $1 $INSTDIR 2 ; get drive letter
- FileOpen $R1 "$INSTDIR\Resources\configLyX.bat" w
- FileWrite $R1 '$1$\r$\n\
- cd $INSTDIR\Resources\$\r$\n\
- "$PythonPath\python.exe" configure.py'
- FileClose $R1
- MessageBox MB_OK|MB_ICONINFORMATION "$(LatexConfigInfo)"
- ExecWait '"$INSTDIR\Resources\configLyX.bat"'
- Delete "$INSTDIR\Resources\configLyX.bat"
-
SectionEnd
+
; eof
;--------------------------------
Function CheckAppPathPreferences
- ; modify the preferences file for all users
+ ; replaces a string "$OldString" with "$NewString" in a file "$FileName"
; get folder names
!insertmacro AppPreSuff $AppPre $AppSuff
; AppPre and AppSuff are generated in the macro "AppPreSuff"
StrCpy $AppPath "$AppPre\$0\$AppSuff\${PRODUCT_SUBFOLDER}"
; read the preferences file to test if it exists
- FileOpen $R1 "$AppPath\preferences" r
+ FileOpen $R1 "$AppPath\$FileName" r
IfErrors doneA
FileClose $R1
; search for "$OldString" and replace it with "$NewString"
- ${LineFind} "$AppPath\preferences" "" "1:-1" "ReplaceLineContent" ; macro from TextFunc.nsh
+ ${LineFind} "$AppPath\$FileName" "" "1:-1" "ReplaceLineContent" ; macro from TextFunc.nsh ; calls Function ReplaceLineContent
doneA:
Goto loopPrefs
ready:
; now do the same for the last user name
StrCpy $0 $UserList
StrCpy $AppPath "$AppPre\$0\$AppSuff\${PRODUCT_SUBFOLDER}"
- FileOpen $R1 "$AppPath\preferences" r
+ FileOpen $R1 "$AppPath\$FileName" r
IfErrors doneB
FileClose $R1
- ${LineFind} "$AppPath\preferences" "" "1:-1" "ReplaceLineContent"
+ ${LineFind} "$AppPath\$FileName" "" "1:-1" "ReplaceLineContent"
doneB:
FunctionEnd
Abort
${endif}
- ; Ascertain whether the user has sufficient privileges to uninstall.
- SetShellVarContext current
-
- ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
- ${if} $0 == ""
- ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
- ${if} $0 == ""
- MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
- ${endif}
- ${endif}
-
- ; If the user does *not* have administrator privileges, abort
+ ; set registry root key
StrCpy $Answer ""
!insertmacro IsUserAdmin $Answer $UserName ; macro from LyXUtils.nsh
${if} $Answer == "yes"
SetShellVarContext all
${else}
- MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
- Abort
+ SetShellVarContext current
+ ${endif}
+
+ ; Ascertain whether the user has sufficient privileges to uninstall.
+ ; abort when LyX was installed with admin permissions but the user doesn't have administrator privileges
+ ReadRegStr $0 HKLM "${PRODUCT_UNINST_KEY}" "RootKey"
+ ${if} $0 != ""
+ ${andif} $Answer != "yes"
+ MessageBox MB_OK|MB_ICONSTOP "$(UnNotAdminLabel)"
+ Abort
+ ${endif}
+ ; abort when LyX couldn't be found in the registry
+ ${if} $0 == "" ; check in HKCU
+ ReadRegStr $0 HKCU "${PRODUCT_UNINST_KEY}" "RootKey"
+ ${if} $0 == ""
+ MessageBox MB_OK|MB_ICONEXCLAMATION "$(UnNotInRegistryLabel)"
+ ${endif}
${endif}
; Macro to investigate name of LyX's preferences folders to be able remove them
!insertmacro UnAppPreSuff $AppPre $AppSuff ; macro from LyXUtils.nsh
; test if Aspell was installed together with LyX
- ReadRegStr $0 HKLM "Software\Aspell" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ReadRegStr $0 SHCTX "Software\Aspell" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
SectionSetText 2 "Aspell" ; names the corersponding uninstaller section (has the index "2" as it is the third section in Uninstall.nsh)
StrCpy $AspellInstallYes "Aspell"
SectionSetText 3 "" ; hides the corresponding uninstaller section
${endif}
- ; ignore JabRef because this could only be installed with the complete installer version
+ ; test if JabRef was installed together with LyX
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "OnlyWithLyX"
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ SectionSetText 4 "JabRef" ; names the corersponding uninstaller section
+ StrCpy $JabRefInstalled "JabRef"
+ ${else}
SectionSetText 4 "" ; hides the corresponding uninstaller section
- StrCpy $JabRefInstalled ""
+ ${endif}
- MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2
+ ; question message if the user really wants to uninstall LyX
+ MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "$(UnReallyRemoveLabel)" IDYES +2 ; continue if yes
Abort
FunctionEnd
+; ----------------------------------
Function un.onUninstSuccess
HideWindow
FunctionEnd
+; ----------------------------------
; Uninstall sections
Section "un.LyX" un.SecUnProgramFiles
; delete LyX's installation folder
RMDir /r $INSTDIR
; delete start menu folder
- ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
+ ReadRegStr $0 SHCTX "${PRODUCT_UNINST_KEY}" "StartMenu"
RMDir /r "$0"
; delete desktop icon
Delete "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk"
; delete registry entries
DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
- DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
- DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
+ DeleteRegKey SHCTX "${PRODUCT_UNINST_KEY}"
+ DeleteRegKey SHCTX "${PRODUCT_DIR_REGKEY}"
DeleteRegKey HKCR "Applications\lyx.exe"
DeleteRegKey HKCR "Applications\lyx.bat"
${if} $5 == "True"
RMDir /r "${AiksaurusDir}"
${endif}
-; StrCpy $0 ""
-; ReadRegStr $0 HKLM "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
-; ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
-; ; unregister Aiksaurus
-; ReadRegStr $1 HKLM "Software\Aiksaurus" "Data Path"
-; RMDir /r "$1"
-; DeleteRegKey HKLM "SOFTWARE\Aiksaurus"
-; ${endif}
-
- ; ImageMagick
- StrCpy $0 ""
- ReadRegStr $0 HKLM "Software\ImageMagick" "OnlyWithLyX" ; special entry to test if it was installed with LyX
- ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
- ; unregister ImageMagick
- DeleteRegValue HKLM "SOFTWARE\Classes\Applications" "AutoRun"
- DeleteRegKey HKLM "SOFTWARE\ImageMagick"
- ${endif}
-
- ; Ghostscript and GSview
- StrCpy $0 ""
- StrCpy $5 ""
- ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ReadRegStr $0 SHCTX "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
- ; unregister Ghostscript
- DeleteRegKey HKLM "SOFTWARE\GPL Ghostscript"
- ; test if GSview is installed
- EnumRegValue $5 HKLM "Software\Ghostgum\GSview" 0
- ${if} $5 != ""
- ; unregister GSview
- MessageBox MB_ICONINFORMATION|MB_OK "$(UnGSview)"
- ReadRegStr $3 HKLM "Software\Ghostgum\GSview" "$5"
- ReadRegStr $4 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSview $5" "UninstallString"
- ExecWait "$4"
- ${endif}
+ ; unregister Aiksaurus
+ ReadRegStr $1 SHCTX "Software\Aiksaurus" "Data Path"
+ RMDir /r "$1"
+ DeleteRegKey SHCTX "SOFTWARE\Aiksaurus"
${endif}
+
+ ; the following can only be done with admin permissions
+ ${if} $Answer == "yes" ; if admin
- ; MiKTeX specific LyX setting
- DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL"
- DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY"
+ ; ImageMagick
+ ReadRegStr $0 SHCTX "Software\ImageMagick" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ ; unregister ImageMagick
+ DeleteRegValue SHCTX "SOFTWARE\Classes\Applications" "AutoRun"
+ DeleteRegKey SHCTX "SOFTWARE\ImageMagick"
+ ${endif}
- ; remove extension .lyx
- ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
- DeleteRegKey HKCR "${PRODUCT_NAME}"
+ ; Ghostscript and GSview
+ ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; special entry to test if it was installed with LyX
+ ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
+ ; unregister Ghostscript
+ DeleteRegKey HKLM "SOFTWARE\GPL Ghostscript"
+ ; test if GSview is installed
+ StrCpy $5 ""
+ EnumRegValue $5 HKLM "Software\Ghostgum\GSview" 0
+ ${if} $5 != ""
+ ; unregister GSview
+ MessageBox MB_ICONINFORMATION|MB_OK "$(UnGSview)"
+ ReadRegStr $3 HKLM "Software\Ghostgum\GSview" "$5"
+ ReadRegStr $4 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSview $5" "UninstallString"
+ ExecWait "$4"
+ ${endif}
+ ${endif}
+
+ ; MiKTeX specific LyX setting
+ DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL"
+ DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY"
+
+ ; remove extension .lyx
+ ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
+ DeleteRegKey HKCR "${PRODUCT_NAME}"
+
+ ${endif} ; end if Answer (if admin)
SetAutoClose true
Function UpdateModifiedFiles
- ; list with modified files
+ ; list with modified files for LyX 1.5svn xx-04-2007
SetOutPath "$INSTDIR\bin"
- File "${PRODUCT_SOURCEDIR}\bin\lyx.exe"
- File "${PRODUCT_SOURCEDIR}\bin\tex2lyx.exe"
- File "${PRODUCT_SOURCEDIR}\bin\pdfclose.exe"
- File "${PRODUCT_SOURCEDIR}\bin\pdfopen.exe"
- File "${PRODUCT_SOURCEDIR}\bin\PDFViewWin.exe"
+ File "${PRODUCT_SOURCEDIR}\bin\lyx.exe" ; always here
+ File "${PRODUCT_SOURCEDIR}\bin\tex2lyx.exe" ; always here
SetOutPath "$INSTDIR\Resources"
- File /r "${PRODUCT_SOURCEDIR}\Resources\fonts"
- File /r "${PRODUCT_SOURCEDIR}\Resources\locale"
- File "${PRODUCT_SOURCEDIR}\Resources\CREDITS"
- SetOutPath "$INSTDIR\Resources\bind"
- File "${PRODUCT_SOURCEDIR}\Resources\bind\aqua.bind"
- SetOutPath "$INSTDIR\Resources\images"
- File "${PRODUCT_SOURCEDIR}\Resources\images\dialog-show_mathdelimiter.xpm"
- File "${PRODUCT_SOURCEDIR}\Resources\images\dialog-show_mathmatrix.xpm"
- SetOutPath "$INSTDIR\Resources\images\math"
- File "${PRODUCT_SOURCEDIR}\Resources\images\math\frac.xpm"
- File "${PRODUCT_SOURCEDIR}\Resources\images\math\sqrt.xpm"
- File "${PRODUCT_SOURCEDIR}\Resources\images\math\cases.xpm"
- File "${PRODUCT_SOURCEDIR}\Resources\images\math\root.xpm"
- SetOutPath "$INSTDIR\Resources\layouts"
- File "${PRODUCT_SOURCEDIR}\Resources\layouts\europecv.layout"
- File "${PRODUCT_SOURCEDIR}\Resources\layouts\moderncv.layout"
- File "${PRODUCT_SOURCEDIR}\Resources\layouts\g-brief2.layout"
- File "${PRODUCT_SOURCEDIR}\Resources\layouts\beamer.layout"
- SetOutPath "$INSTDIR\Resources\templates"
- File "${PRODUCT_SOURCEDIR}\Resources\templates\g-brief2.lyx"
+ File /r "${PRODUCT_SOURCEDIR}\Resources\locale" ; always here
+ File "${PRODUCT_SOURCEDIR}\Resources\configure.py"
+ SetOutPath "$INSTDIR\Resources\doc"
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\Intro.lyx"
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\EmbeddedObjects.lyx"
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\TOC.lyx" ; must be here when another \doc file has been changed
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\Tutorial.lyx"
SetOutPath "$INSTDIR\Resources\doc\es"
- File "${PRODUCT_SOURCEDIR}\Resources\doc\es\EmbeddedObjects.lyx"
File "${PRODUCT_SOURCEDIR}\Resources\doc\es\Extended.lyx"
- SetOutPath "$INSTDIR\Resources\doc\de"
- File "${PRODUCT_SOURCEDIR}\Resources\doc\de\Extended.lyx"
- File "${PRODUCT_SOURCEDIR}\Resources\doc\de\UserGuide.lyx"
- SetOutPath "$INSTDIR\Resources\ui"
- File "${PRODUCT_SOURCEDIR}\Resources\ui\stdtoolbars.inc"
- File "${PRODUCT_SOURCEDIR}\Resources\ui\stdmenus.inc"
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\es\EmbeddedObjects.lyx"
+ File "${PRODUCT_SOURCEDIR}\Resources\doc\es\TOC.lyx" ; must be here when another \doc file has been changed
+ SetOutPath "$INSTDIR\Resources\layouts"
+ File "${PRODUCT_SOURCEDIR}\Resources\layouts\g-brief2.layout"
FunctionEnd