11 # ----------------------------------
13 Section "un.LyX" un.SecUnProgramFiles
15 # LaTeX class files that were installed together with LyX
16 # will not be uninstalled because other LyX versions will
17 # need them and these few files don't harm to stay in LaTeX
20 #!insertmacro FileListLyXBin Delete "$INSTDIR\bin\"
21 #!insertmacro FileListQtBin Delete "$INSTDIR\bin\"
22 #!insertmacro FileListDll Delete "$INSTDIR\bin\"
23 #!insertmacro FileListMSVC Delete "$INSTDIR\bin\"
24 #!insertmacro FileListNetpbmBin Delete "$INSTDIR\bin\"
25 #!insertmacro FileListDTLBin Delete "$INSTDIR\bin\"
26 #!insertmacro FileListDvipostBin Delete "$INSTDIR\bin\"
27 #!insertmacro FileListPDFToolsBin Delete "$INSTDIR\bin\"
28 #!insertmacro FileListPDFViewBin Delete "$INSTDIR\bin\"
29 #!insertmacro FileListMetaFile2EPS Delete "$INSTDIR\bin\"
30 RMDir /r "$INSTDIR\bin"
33 RMDir /r "$INSTDIR\Resources"
36 RMDir /r "$INSTDIR\python"
38 # Components of ImageMagick
39 #!insertmacro FileListImageMagick Delete "$INSTDIR\imagemagick\"
40 #!insertmacro FileListMSVC Delete "$INSTDIR\imagemagick\"
41 RMDir /r "$INSTDIR\imagemagick"
43 # Components of Ghostscript
44 #!insertmacro FileListGhostscript Delete "$INSTDIR\ghostscript\"
45 #!insertmacro FileListMSVC Delete "$INSTDIR\ghostscript\"
46 RMDir /r "$INSTDIR\ghostscript"
48 # delete start menu folder
49 ReadRegStr $0 SHCTX "${APP_UNINST_KEY}" "StartMenu"
51 #Delete "$SMPROGRAMS\${APP_NAME} ${APP_SERIES_NAME}.lnk"
53 Delete "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
55 # remove file extension .lyx
56 ReadRegStr $0 SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" # special entry to test if they were registered by this LyX version
57 ${if} $0 == "Yes${APP_SERIES_KEY}"
58 ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
59 ${if} $R0 == "${APP_REGNAME_DOC}"
60 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}13"
61 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}14"
62 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}15"
63 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}16"
64 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
65 DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
68 ${if} $MultiUser.Privileges == "Admin"
69 DeleteRegKey HKCR "LyX.Document"
73 Delete "$INSTDIR\${SETUP_UNINSTALLER}"
80 DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
81 DeleteRegKey SHCTX "${APP_REGKEY}"
82 DeleteRegKey SHCTX "${APP_UNINST_KEY}"
83 DeleteRegKey HKCR "Applications\lyx.exe"
87 ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
89 ${If} $FileAssociation == "${APP_REGNAME_DOC}"
90 DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_EXT}"
93 ${If} $MultiUser.Privileges != "Admin"
94 ${OrIf} $MultiUser.Privileges != "Power"
96 # Delete Postscript printer for metafile to EPS conversion
97 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
101 # clean other registry entries
102 DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
103 DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
108 #---------------------------------
110 Section "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
112 # remove LyX's config files
113 StrCpy $AppSubfolder ${APP_DIR_USERDATA}
114 Call un.DelAppPathSub # function from LyXUtils.nsh
118 #---------------------------------
120 Section "un.MiKTeX" un.SecUnMiKTeX
122 ${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
123 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
124 ExecWait $1 # run MiKTeX's uninstaller
129 #---------------------------------
131 Section "un.JabRef" un.SecUnJabRef
133 ${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
134 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
135 ExecWait "$1" # run JabRef's uninstaller
140 #---------------------------------
141 # Section descriptions
142 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
143 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
144 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
145 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
146 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
147 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
149 #Section "un.User Preferences and Custom Files" un.SecUserFiles
151 # SetShellVarContext current
152 # RMDir /r "$APPDATA\${APP_DIR_USERDATA}"