I installed the windows installer software first time and it was installed properly. If I manually uninstall the software from control panel->Add/Remove Programs then it is installing without showing any error message.
In the Section "Uninstall", I wrote the below code
Section "Uninstall"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Test"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Test\EMR"
DeleteRegKey HKLM "SOFTWARE\Test\EMR"
DeleteRegKey HKLM "SOFTWARE\Test"
; Remove files and uninstaller
Delete $INSTDIR\EMR_4.0.1.nsi
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$INSTDIR\Test\EMR\*.*"
; Remove directories used
RMDir "$INSTDIR\Test\EMR"
RMDir "$INSTDIR\Test"
RMDir "$INSTDIR"
RMDir /r /REBOOTOK $INSTDIR
SectionEnd
Please help me to resolve the error.
It is hard to tell what is really going on based on your description but it is most likely one of two things:
or
RequestExecutionLevel
attribute.