-/*
+/*
uninstall.nsh
# ImageMagick
RMDir /r "$INSTDIR\imagemagick"
- 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}
# Components of Ghostscript
RMDir /r "$INSTDIR\ghostscript"
${endif}
${endif}
${if} $MultiUser.Privileges == "Admin"
- DeleteRegKey HKCR "LyX.Document"
+ DeleteRegKey HKCR "${APP_NAME}.Document"
${endif}
# Uninstaller itself
SetOutPath "$TEMP"
RMDir /r "$INSTDIR"
- # Registry keys
+ # Registry keys and values
+ DeleteRegValue SHCTX "subkey" "key_name"
DeleteRegKey SHCTX "${APP_REGKEY_SETUP}"
DeleteRegKey SHCTX "${APP_REGKEY}"
DeleteRegKey SHCTX "${APP_UNINST_KEY}"
- DeleteRegKey HKCR "Applications\lyx.exe"
+ DeleteRegKey HKCR "Applications\${BIN_LYX}"
+ DeleteRegValue HKCR "${APP_NAME}.Document\Shell\open\command" ""
+ DeleteRegValue HKCR "${APP_NAME}.Document\DefaultIcon" ""
+ ReadRegStr $0 SHCTX ${APP_REGFOLDER} "latestVersion"
+ ${If} $0 == ${APP_SERIES_KEY}
+ DeleteRegValue SHCTX ${APP_REGFOLDER} "latestVersion"
+ StrCpy $0 0
+ StrCpy $R0 ""
+ ${Do}
+ StrCpy $R1 $R0
+ EnumRegKey $R0 SHCTX ${APP_REGFOLDER} $0
+ IntOp $0 $0 + 1
+ ${LoopUntil} $R0 == ""
+ ${If} $R1 != ""
+ WriteRegStr SHCTX ${APP_REGFOLDER} "latestVersion" $R1
+ ${EndIf}
+ ${EndIf}
+ DeleteRegKey /ifempty SHCTX ${APP_REGFOLDER}
# File associations
ReadRegStr $FileAssociation SHELL_CONTEXT "Software\Classes\${APP_EXT}" ""
# remove LyX's config files
StrCpy $AppSubfolder ${APP_DIR_USERDATA}
Call un.DelAppPathSub # function from LyXUtils.nsh
+ # remove registry settings
+ DeleteRegKey HKCU "Software\${APP_NAME}\${APP_NAME}${APP_SERIES_NAME}"
SectionEnd
#---------------------------------
# MiKTeX
-Section /o "un.MiKTeX" un.SecUnMiKTeX
+Section "un.MiKTeX" un.SecUnMiKTeX
${if} $LaTeXInstalled == "MiKTeX" # only uninstall MiKTeX when it was installed together with LyX
ReadRegStr $1 SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\MiKTeX ${MiKTeXDeliveredVersion}" "UninstallString"
SectionEnd
-#---------------------------------
-# JabRef
-Section "un.JabRef" un.SecUnJabRef
-
- ${if} $JabRefInstalled == "Yes" # only uninstall JabRef when it was installed together with LyX
- ${If} $MultiUser.Privileges == "Admin"
- ${OrIf} $MultiUser.Privileges == "Power"
- ReadRegStr $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef" "UninstallString"
- IfSilent 0 +2
- ExecWait "$1 /S" # run JabRef's uninstaller
- ExecWait "$1" # run JabRef's uninstaller
- DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef"
- ${else}
- # in this case we cannot do anything due to a bug in the installer of jabRef 3.x
- ReadRegStr $1 HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef" "UninstallString"
- IfSilent 0 +2
- ExecWait "$1 /S" # run JabRef's uninstaller
- ExecWait "$1" # run JabRef's uninstaller
- DeleteRegKey SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\JabRef"
- ${endif}
- ${endif}
-
-SectionEnd
-
#---------------------------------
# Section descriptions
!insertmacro MUI_UNFUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnMiKTeX} "$(SecUnMiKTeXDescription)"
-!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnJabRef} "$(SecUnJabRefDescription)"
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnPreferences} "$(SecUnPreferencesDescription)"
!insertmacro MUI_DESCRIPTION_TEXT ${un.SecUnProgramFiles} "$(SecUnProgramFilesDescription)"
!insertmacro MUI_UNFUNCTION_DESCRIPTION_END