ClearErrors
ExecWait '"cmd" /C ""%SystemRoot%\System32\tasklist" /NH /FI "IMAGENAME eq @CPACK_NSIS_MUI_FINISHPAGE_RUN@" | "%SystemRoot%\System32\find" /I /C "@CPACK_NSIS_MUI_FINISHPAGE_RUN@""' $0
IntCmp $0 1 notRunningInUninstall
MessageBox MB_OK|MB_ICONEXCLAMATION "@CPACK_NSIS_MUI_FINISHPAGE_RUN@ is running. Please close it first from the application menu and restart the installation." /SD IDOK
Abort

notRunningInUninstall:

## Application

DeleteRegKey HKLM "SOFTWARE\IM Providers\@APPLICATION_NAME@"
DeleteRegKey HKLM "SOFTWARE\@APPLICATION_VENDOR@\@APPLICATION_NAME@"
DeleteRegValue HKLM "SOFTWARE\RegisteredApplications" "@APPLICATION_NAME@"

## Handlers

DeleteRegKey HKCR "@APPLICATION_NAME@.sip"
DeleteRegKey HKCR "@APPLICATION_NAME@.sip-@EXECUTABLE_NAME@"
DeleteRegKey HKCR "@APPLICATION_NAME@.sips"
DeleteRegKey HKCR "@APPLICATION_NAME@.sips-@EXECUTABLE_NAME@"
DeleteRegKey HKCR "@APPLICATION_NAME@.@EXECUTABLE_NAME@-config"
DeleteRegKey HKCR "@APPLICATION_NAME@.tel"
DeleteRegKey HKCR "@APPLICATION_NAME@.callto"

