2007-02-08 21:09:30 +00:00
|
|
|
/*
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
uninstall.nsh
|
|
|
|
|
|
|
|
Uninstall
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
Var FileAssociation
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# ----------------------------------
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
Section "un.LyX" un.SecUnProgramFiles
|
|
|
|
|
|
|
|
# LaTeX class files that were installed together with LyX
|
|
|
|
# will not be uninstalled because other LyX versions will
|
|
|
|
# need them and these few files don't harm to stay in LaTeX
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Binaries
|
2011-05-23 04:12:10 +00:00
|
|
|
#!insertmacro FileListLyXBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListQtBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListDll Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListMSVC Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListNetpbmBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListDTLBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListDvipostBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListPDFToolsBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListPDFViewBin Delete "$INSTDIR\bin\"
|
|
|
|
#!insertmacro FileListMetaFile2EPS Delete "$INSTDIR\bin\"
|
|
|
|
RMDir /r "$INSTDIR\bin"
|
2011-04-26 21:29:32 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Resources
|
2007-02-08 21:09:30 +00:00
|
|
|
RMDir /r "$INSTDIR\Resources"
|
|
|
|
|
2011-04-26 21:29:32 +00:00
|
|
|
# Python
|
|
|
|
RMDir /r "$INSTDIR\python"
|
2008-05-01 18:33:36 +00:00
|
|
|
|
|
|
|
# Components of ImageMagick
|
2011-05-23 04:12:10 +00:00
|
|
|
#!insertmacro FileListImageMagick Delete "$INSTDIR\imagemagick\"
|
|
|
|
#!insertmacro FileListMSVC Delete "$INSTDIR\imagemagick\"
|
|
|
|
RMDir /r "$INSTDIR\imagemagick"
|
2008-05-01 18:33:36 +00:00
|
|
|
|
|
|
|
# Components of Ghostscript
|
2011-05-23 04:12:10 +00:00
|
|
|
#!insertmacro FileListGhostscript Delete "$INSTDIR\ghostscript\"
|
|
|
|
#!insertmacro FileListMSVC Delete "$INSTDIR\ghostscript\"
|
|
|
|
RMDir /r "$INSTDIR\ghostscript"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# delete start menu folder
|
|
|
|
ReadRegStr $0 SHCTX "${APP_UNINST_KEY}" "StartMenu"
|
|
|
|
RMDir /r "$0"
|
|
|
|
#Delete "$SMPROGRAMS\${APP_NAME} ${APP_SERIES_NAME}.lnk"
|
|
|
|
# delete desktop icon
|
2007-02-08 21:09:30 +00:00
|
|
|
Delete "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
# remove file extension .lyx
|
|
|
|
ReadRegStr $0 SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" # special entry to test if they were registered by this LyX version
|
|
|
|
${if} $0 == "Yes${APP_SERIES_KEY}"
|
|
|
|
ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
|
|
|
|
${if} $R0 == "${APP_REGNAME_DOC}"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}13"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}14"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}15"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}16"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
|
|
|
|
${endif}
|
|
|
|
${endif}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Uninstaller itself
|
2007-02-08 21:09:30 +00:00
|
|
|
Delete "$INSTDIR\${SETUP_UNINSTALLER}"
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Application folder
|
2008-05-01 18:33:36 +00:00
|
|
|
SetOutPath "$TEMP"
|
2007-02-08 21:09:30 +00:00
|
|
|
RMDir "$INSTDIR"
|
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# Registry keys
|
2011-05-23 04:12:10 +00:00
|
|
|
DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
|
|
|
|
DeleteRegKey SHCTX "${APP_REGKEY}"
|
|
|
|
DeleteRegKey SHCTX "${APP_UNINST_KEY}"
|
|
|
|
DeleteRegKey HKCR "Applications\lyx.exe"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
# File associations
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-03-30 21:37:53 +00:00
|
|
|
${If} $FileAssociation == "${APP_REGNAME_DOC}"
|
2007-02-08 21:09:30 +00:00
|
|
|
DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_EXT}"
|
2008-03-30 21:37:53 +00:00
|
|
|
${EndIf}
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2008-04-05 19:12:37 +00:00
|
|
|
${If} $MultiUser.Privileges != "Admin"
|
2008-11-05 23:44:44 +00:00
|
|
|
${OrIf} $MultiUser.Privileges != "Power"
|
|
|
|
|
|
|
|
# Delete Postscript printer for metafile to EPS conversion
|
2008-04-05 19:12:37 +00:00
|
|
|
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
|
2008-11-05 23:44:44 +00:00
|
|
|
|
2008-04-05 19:12:37 +00:00
|
|
|
${EndIf}
|
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
#---------------------------------
|
|
|
|
# user preferences
|
|
|
|
Section "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
|
2007-02-08 21:09:30 +00:00
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
# remove LyX's config files
|
|
|
|
StrCpy $AppSubfolder ${APP_DIR_USERDATA}
|
|
|
|
Call un.DelAppPathSub # function from LyXUtils.nsh
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
SectionEnd
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# MiKTeX
|
|
|
|
Section "un.MiKTeX" un.SecUnMiKTeX
|
|
|
|
|
|
|
|
${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
|
|
|
|
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
|
|
|
|
ExecWait $1 # run MiKTeX's uninstaller
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# JabRef
|
|
|
|
Section "un.JabRef" un.SecUnJabRef
|
|
|
|
|
|
|
|
${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
|
|
|
|
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
|
|
|
|
ExecWait "$1" # run JabRef's uninstaller
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# Section descriptions
|
|
|
|
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
|
|
|
|
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END
|
|
|
|
|
|
|
|
#Section "un.User Preferences and Custom Files" un.SecUserFiles
|
|
|
|
#
|
|
|
|
# SetShellVarContext current
|
|
|
|
# RMDir /r "$APPDATA\${APP_DIR_USERDATA}"
|
|
|
|
#
|
|
|
|
#SectionEnd
|