11 # ----------------------------------
13 Section "un.LyX" un.SecUnProgramFiles
16 # LaTeX class files that were installed together with LyX
17 # will not be uninstalled because other LyX versions will
18 # need them and these few files don't harm to stay in LaTeX
21 RMDir /r "$INSTDIR\bin"
24 RMDir /r "$INSTDIR\Resources"
27 RMDir /r "$INSTDIR\python"
30 RMDir /r "$INSTDIR\imagemagick"
31 ReadRegStr $0 SHCTX "SOFTWARE\ImageMagick" "OnlyWithLyX" # test if it was installed together with this LyX version
32 ${if} $0 == "Yes${APP_SERIES_KEY}"
33 WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" ""
34 DeleteRegKey SHCTX "Software\ImageMagick"
37 # Components of Ghostscript
38 RMDir /r "$INSTDIR\ghostscript"
40 # delete start menu folder
41 ReadRegStr $0 SHCTX "${APP_UNINST_KEY}" "StartMenu"
44 Delete "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
46 # remove file extension .lyx
47 ReadRegStr $0 SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" # test if they were registered by this LyX version
48 ${if} $0 == "Yes${APP_SERIES_KEY}"
49 ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
50 ${if} $R0 == "${APP_REGNAME_DOC}"
51 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}13"
52 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}14"
53 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}15"
54 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}16"
55 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}20"
56 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}" enable this for LyX 2.1 final!
57 #DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
60 ${if} $MultiUser.Privileges == "Admin"
61 DeleteRegKey HKCR "LyX.Document"
65 Delete "$INSTDIR\${SETUP_UNINSTALLER}"
72 DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
73 DeleteRegKey SHCTX "${APP_REGKEY}"
74 DeleteRegKey SHCTX "${APP_UNINST_KEY}"
75 DeleteRegKey HKCR "Applications\lyx.exe"
78 ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
80 ${If} $FileAssociation == "${APP_REGNAME_DOC}"
81 DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_EXT}"
84 ${If} $MultiUser.Privileges == "Admin"
85 ${OrIf} $MultiUser.Privileges == "Power"
86 # Delete Postscript printer for metafile to EPS conversion
87 ExecWait '$PrinterConf /q /dl /n "Metafile to EPS Converter"'
90 # clean other registry entries
91 DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
92 DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
94 # delete info that programs were installed together with LyX
95 DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
96 DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
100 #---------------------------------
102 Section /o "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
104 # remove LyX's config files
105 StrCpy $AppSubfolder ${APP_DIR_USERDATA}
106 Call un.DelAppPathSub # function from LyXUtils.nsh
110 #---------------------------------
112 Section /o "un.MiKTeX" un.SecUnMiKTeX
114 ${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
115 ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
116 ExecWait $1 # run MiKTeX's uninstaller
121 #---------------------------------
123 Section "un.JabRef" un.SecUnJabRef
125 ${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
126 ${If} $MultiUser.Privileges == "Admin"
127 ${OrIf} $MultiUser.Privileges == "Power"
128 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
130 ExecWait "$1 /S" # run JabRef's uninstaller
131 ExecWait "$1" # run JabRef's uninstaller
133 # in this case we can only read the start menu location and then start the linked uninstaller
134 ReadRegStr $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "StartMenu"
135 StrCpy $1 "$1\Uninstall JabRef 2.8.lnk"
136 ExecShell "" "$1" # run JabRef's uninstaller
142 #---------------------------------
143 # Section descriptions
144 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
145 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
146 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
147 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
148 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
149 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
151 #Section "un.User Preferences and Custom Files" un.SecUserFiles
153 # SetShellVarContext current
154 # RMDir /r "$APPDATA\${APP_DIR_USERDATA}"