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"
28 ReadRegStr $0 SHCTX "Software\Classes\Python.File" "OnlyWithLyX" # test if it was registered by this LyX version
29 ${if} $0 == "Yes${APP_SERIES_KEY}"
30 DeleteRegKey SHCTX "Software\Classes\Python.File"
34 RMDir /r "$INSTDIR\imagemagick"
35 ReadRegStr $0 SHCTX "SOFTWARE\ImageMagick" "OnlyWithLyX" # test if it was installed together with this LyX version
36 ${if} $0 == "Yes${APP_SERIES_KEY}"
37 WriteRegStr SHCTX "SOFTWARE\Classes\Applications" "AutoRun" ""
38 DeleteRegKey SHCTX "Software\ImageMagick"
41 # Components of Ghostscript
42 RMDir /r "$INSTDIR\ghostscript"
44 # delete start menu folder
45 ReadRegStr $0 SHCTX "${APP_UNINST_KEY}" "StartMenu"
48 Delete "$DESKTOP\${APP_NAME} ${APP_SERIES_NAME}.lnk"
50 # remove file extension .lyx
51 ReadRegStr $0 SHCTX "${APP_DIR_REGKEY}" "OnlyWithLyX" # test if they were registered by this LyX version
52 ${if} $0 == "Yes${APP_SERIES_KEY}"
53 ReadRegStr $R0 SHCTX "Software\Classes\${APP_EXT}" ""
54 ${if} $R0 == "${APP_REGNAME_DOC}"
55 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}13"
56 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}14"
57 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}15"
58 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}16"
59 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}20"
60 #DeleteRegKey SHCTX "Software\Classes\${APP_EXT}21"
61 DeleteRegKey SHCTX "Software\Classes\${APP_EXT}"
62 #DeleteRegKey SHCTX "Software\Classes\${APP_REGNAME_DOC}"
65 ${if} $MultiUser.Privileges == "Admin"
66 DeleteRegKey HKCR "LyX.Document"
70 Delete "$INSTDIR\${SETUP_UNINSTALLER}"
77 DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
78 DeleteRegKey SHCTX "${APP_REGKEY}"
79 DeleteRegKey SHCTX "${APP_UNINST_KEY}"
80 DeleteRegKey HKCR "Applications\lyx.exe"
83 ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
85 ${If} $FileAssociation == "${APP_REGNAME_DOC}"
86 DeleteRegKey SHELL_CONTEXT "Software\Classes\${APP_EXT}"
89 # clean other registry entries
90 DeleteRegKey SHCTX "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\${APP_NAME}.exe"
91 DeleteRegKey SHCTX "SOFTWARE\${APP_REGKEY}"
93 # delete info that programs were installed together with LyX
94 DeleteRegValue SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "OnlyWithLyX"
95 DeleteRegValue SHCTX "SOFTWARE\MiKTeX.org\MiKTeX" "OnlyWithLyX"
97 # for texindy the path to the perl.exe must unfortunately be in Windows' PATH variable
98 # so we have to remove it now
99 ${if} $MultiUser.Privileges != "Admin"
100 ${andif} $MultiUser.Privileges != "Power"
101 # call the non-admin version
102 ${un.EnvVarUpdate} $0 "PATH" "R" "HKCU" "$INSTDIR\Perl\bin"
104 ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR\Perl\bin"
109 #---------------------------------
111 Section /o "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
113 # remove LyX's config files
114 StrCpy $AppSubfolder ${APP_DIR_USERDATA}
115 Call un.DelAppPathSub # function from LyXUtils.nsh
119 #---------------------------------
121 Section /o "un.MiKTeX" un.SecUnMiKTeX
123 ${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
124 ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
125 ExecWait $1 # run MiKTeX's uninstaller
130 #---------------------------------
132 Section "un.JabRef" un.SecUnJabRef
134 ${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
135 ${If} $MultiUser.Privileges == "Admin"
136 ${OrIf} $MultiUser.Privileges == "Power"
137 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "UninstallString"
139 ExecWait "$1 /S" # run JabRef's uninstaller
140 ExecWait "$1" # run JabRef's uninstaller
142 # in this case we can only read the start menu location and then start the linked uninstaller
143 ReadRegStr $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef ${JabRefVersion}" "StartMenu"
144 StrCpy $1 "$1\Uninstall JabRef "${JabRefVersion}".lnk"
145 ExecShell "" "$1" # run JabRef's uninstaller
151 #---------------------------------
152 # Section descriptions
153 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
154 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
155 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
156 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
157 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
158 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END
160 #Section "un.User Preferences and Custom Files" un.SecUserFiles
162 # SetShellVarContext current
163 # RMDir /r "$APPDATA\${APP_DIR_USERDATA}"