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
|
|
|
|
|
2012-11-12 00:31:00 +00:00
|
|
|
SectionIn RO
|
2011-05-23 04:12:10 +00:00
|
|
|
# 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
|
|
|
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"
|
2015-08-05 00:29:43 +00:00
|
|
|
ReadRegStr $0 SHCTX "Software\Classes\Python.File" "OnlyWithLyX" # test if it was registered by this LyX version
|
|
|
|
${if} $0 == "Yes${APP_SERIES_KEY}"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\Python.File"
|
|
|
|
${endif}
|
2008-05-01 18:33:36 +00:00
|
|
|
|
2012-11-16 00:21:47 +00:00
|
|
|
# ImageMagick
|
2011-05-23 04:12:10 +00:00
|
|
|
RMDir /r "$INSTDIR\imagemagick"
|
2012-11-16 00:21:47 +00:00
|
|
|
ReadRegStr $0 SHCTX "SOFTWARE\ImageMagick" "OnlyWithLyX" # test if it was installed together with this LyX version
|
|
|
|
${if} $0 == "Yes${APP_SERIES_KEY}"
|
|
|
|
WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" ""
|
|
|
|
DeleteRegKey SHCTX "Software\ImageMagick"
|
|
|
|
${endif}
|
2008-05-01 18:33:36 +00:00
|
|
|
|
|
|
|
# Components of Ghostscript
|
2011-05-23 04:12:10 +00:00
|
|
|
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 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
|
2012-11-16 00:21:47 +00:00
|
|
|
ReadRegStr $0 SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" # test if they were registered by this LyX version
|
2011-05-23 04:12:10 +00:00
|
|
|
${if} $0 == "Yes${APP_SERIES_KEY}"
|
|
|
|
ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
|
|
|
|
${if} $R0 == "${APP_REGNAME_DOC}"
|
2013-05-31 02:33:25 +00:00
|
|
|
#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}20"
|
2015-10-25 00:51:02 +00:00
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
|
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
|
2011-05-23 04:12:10 +00:00
|
|
|
${endif}
|
|
|
|
${endif}
|
2012-02-27 01:50:43 +00:00
|
|
|
${if} $MultiUser.Privileges == "Admin"
|
|
|
|
DeleteRegKey HKCR "LyX.Document"
|
|
|
|
${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"
|
2011-12-21 22:09:24 +00:00
|
|
|
RMDir /r "$INSTDIR"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2012-11-12 00:31:00 +00:00
|
|
|
${If} $MultiUser.Privileges == "Admin"
|
|
|
|
${OrIf} $MultiUser.Privileges == "Power"
|
|
|
|
# Delete Postscript printer for metafile to EPS conversion
|
|
|
|
ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
|
2008-04-05 19:12:37 +00:00
|
|
|
${EndIf}
|
2011-09-05 06:09:13 +00:00
|
|
|
|
|
|
|
# clean other registry entries
|
|
|
|
DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
|
|
|
|
DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
|
|
|
|
|
2012-11-11 17:07:55 +00:00
|
|
|
# delete info that programs were installed together with LyX
|
|
|
|
DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
|
|
|
|
DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
|
2008-04-05 19:12:37 +00:00
|
|
|
|
2007-02-08 21:09:30 +00:00
|
|
|
SectionEnd
|
|
|
|
|
2011-05-23 04:12:10 +00:00
|
|
|
#---------------------------------
|
|
|
|
# user preferences
|
2012-07-02 23:42:30 +00:00
|
|
|
Section /o "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
|
2012-07-02 23:42:30 +00:00
|
|
|
Section /o "un.MiKTeX" un.SecUnMiKTeX
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
|
2012-11-11 17:07:55 +00:00
|
|
|
ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
|
2011-05-23 04:12:10 +00:00
|
|
|
ExecWait $1 # run MiKTeX's uninstaller
|
|
|
|
${endif}
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# JabRef
|
|
|
|
Section "un.JabRef" un.SecUnJabRef
|
|
|
|
|
2012-11-12 00:31:00 +00:00
|
|
|
${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
|
|
|
|
${If} $MultiUser.Privileges == "Admin"
|
|
|
|
${OrIf} $MultiUser.Privileges == "Power"
|
|
|
|
ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
|
2014-02-19 00:23:31 +00:00
|
|
|
IfSilent 0 +2
|
|
|
|
ExecWait "$1 /S" # run JabRef's uninstaller
|
2012-11-12 00:31:00 +00:00
|
|
|
ExecWait "$1" # run JabRef's uninstaller
|
|
|
|
${else}
|
|
|
|
# in this case we can only read the start menu location and then start the linked uninstaller
|
|
|
|
ReadRegStr $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "StartMenu"
|
2015-10-25 00:51:02 +00:00
|
|
|
StrCpy $1 "$1\Uninstall JabRef "${JabRefVersion}".lnk"
|
2012-11-12 00:31:00 +00:00
|
|
|
ExecShell "" "$1" # run JabRef's uninstaller
|
|
|
|
${endif}
|
2011-05-23 04:12:10 +00:00
|
|
|
${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
|