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-11-28 01:04:57 +00:00
|
|
|
#DeleteRegKey SHCTX "Software\Classes\${APP_EXT}21"
|
2016-04-12 23:31:42 +00:00
|
|
|
DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
|
2015-11-28 01:04:57 +00:00
|
|
|
#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
|
|
|
|
2016-05-30 23:22:12 +00:00
|
|
|
# Registry keys and values
|
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"
|
2016-05-30 23:22:12 +00:00
|
|
|
DeleteRegValue HKCR "LyX.Document\Shell\open\command" ""
|
|
|
|
DeleteRegValue HKCR "LyX.Document\DefaultIcon" ""
|
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
|
|
|
|
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
|
2015-11-16 03:04:11 +00:00
|
|
|
DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
|
|
|
|
|
|
|
|
# for texindy the path to the perl.exe must unfortunately be in Windows' PATH variable
|
|
|
|
# so we have to remove it now
|
|
|
|
${if} $MultiUser.Privileges != "Admin"
|
|
|
|
${andif} $MultiUser.Privileges != "Power"
|
|
|
|
# call the non-admin version
|
|
|
|
${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\Perl\bin"
|
|
|
|
${else}
|
|
|
|
${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\Perl\bin"
|
|
|
|
${endif}
|
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
|
2016-05-30 23:22:12 +00:00
|
|
|
# remove registry settings
|
|
|
|
DeleteRegKey HKCU "Software\LyX\LyX${APP_SERIES_NAME}"
|
2007-02-08 21:09:30 +00:00
|
|
|
|
|
|
|
SectionEnd
|
2011-05-23 04:12:10 +00:00
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# MiKTeX
|
2016-11-27 14:33:51 +00:00
|
|
|
Section "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
|
|
|
|
|
|
|
|
#---------------------------------
|
|
|
|
# Section descriptions
|
|
|
|
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
|
|
|
|
!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
|