3 Section "un.LyX" un.SecUnProgramFiles
7 ; delete LaTeX class files that were installed together with LyX
8 FileOpen $R5 "$INSTDIR\Resources\uninstallPaths.dat" r
9 FileRead $R5 $LatexPath
11 StrCpy $String $LatexPath
12 StrCpy $Search "miktex\bin"
14 Call un.StrPoint ; search the LaTeXPath for the phrase "miktex\bin" (function from LyXUtils.nsh)
15 ${if} $Pointer != "-1" ; if something was found
16 IntOp $Pointer $Pointer - 1 ; jump before the first "\" of "\miktex\bin"
17 StrCpy $String $String "$Pointer" ; $String is now the part before "\miktex\bin"
18 Delete "$String\tex\latex\cv.cls"
19 RMDir /r "$String\tex\latex\lyx"
20 RMDir /r "$String\tex\latex\revtex"
21 RMDir /r "$String\tex\latex\hollywood"
22 RMDir /r "$String\tex\latex\broadway"
23 ExecWait "$LatexPath\initexmf --update-fndb"
26 ; delete LyX's installation folder
28 ; delete start menu folder
29 ReadRegStr $0 ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "StartMenu"
32 Delete "$DESKTOP\LyX ${PRODUCT_VERSION}.lnk"
33 ; delete registry entries
34 DeleteRegKey HKCU "${PRODUCT_UNINST_KEY}"
35 DeleteRegKey ${PRODUCT_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
36 DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
37 DeleteRegKey HKCR "Applications\lyx.exe"
38 DeleteRegKey HKCR "Applications\lyx.bat"
41 !insertmacro FileCheck $5 "meanings.dat" "${AiksaurusDir}" ; macro from LyXUtils.nsh
43 RMDir /r "${AiksaurusDir}"
46 ; ReadRegStr $0 HKLM "Software\Aiksaurus" "OnlyWithLyX" ; special entry to test if it was installed with LyX
47 ; ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
48 ; ; unregister Aiksaurus
49 ; ReadRegStr $1 HKLM "Software\Aiksaurus" "Data Path"
51 ; DeleteRegKey HKLM "SOFTWARE\Aiksaurus"
56 ReadRegStr $0 HKLM "Software\ImageMagick" "OnlyWithLyX" ; special entry to test if it was installed with LyX
57 ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
58 ; unregister ImageMagick
59 DeleteRegValue HKLM "SOFTWARE\Classes\Applications" "AutoRun"
60 DeleteRegKey HKLM "SOFTWARE\ImageMagick"
63 ; Ghostscript and GSview
66 ReadRegStr $0 HKLM "SOFTWARE\GPL Ghostscript" "OnlyWithLyX" ; special entry to test if it was installed with LyX
67 ${if} $0 == "Yes${PRODUCT_VERSION_SHORT}"
68 ; unregister Ghostscript
69 DeleteRegKey HKLM "SOFTWARE\GPL Ghostscript"
70 ; test if GSview is installed
71 EnumRegValue $5 HKLM "Software\Ghostgum\GSview" 0
74 MessageBox MB_ICONINFORMATION|MB_OK "$(UnGSview)"
75 ReadRegStr $3 HKLM "Software\Ghostgum\GSview" "$5"
76 ReadRegStr $4 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\GSview $5" "UninstallString"
81 ; MiKTeX specific LyX setting
82 DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_AUTOINSTALL"
83 DeleteRegValue HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "MIKTEX_REPOSITORY"
85 ; remove extension .lyx
86 ${RemoveFileAssociation} "${PRODUCT_EXT}" "${PRODUCT_NAME}"
87 DeleteRegKey HKCR "${PRODUCT_NAME}"
93 ;---------------------------------
95 Section "un.$(UnLyXPreferencesTitle)" un.SecUnPreferences
97 ; remove LyX's config files
98 Call un.DelAppPathSub ; function from LyXUtils.nsh
102 ;---------------------------------
104 Section "un.Aspell" un.SecUnAspell
106 ${if} $AspellInstallYes == "Aspell" ; only uninstall Aspell when it was installed together with LyX
107 Call un.UninstAspell ; Function from Aspell.nsh
112 ;---------------------------------
114 Section "un.MiKTeX" un.SecUnMiKTeX
116 ${if} $MiKTeXInstalled == "MiKTeX" ; only uninstall MiKTeX when it was installed together with LyX
117 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MiKTeXDeliveredVersion}" "UninstallString"
118 ExecWait "$1" ; run MiKTeX's uninstaller
123 ;---------------------------------
125 Section "un.JabRef" un.SecUnJabRef
127 ${if} $JabRefInstalled == "JabRef" ; only uninstall JabRef when it was installed together with LyX
128 ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${JabRefVersion}" "UninstallString"
129 ExecWait "$1" ; run JabRef's uninstaller
134 ;---------------------------------
135 ; Section descriptions
136 !insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
137 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnAspell} "$(SecUnAspellDescription)"
138 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
139 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
140 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
141 !insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
142 !insertmacro MUI_UNFUNCTION_DESCRIPTION_END