problem in auto-uninstalling old application before installing new application
Hi,
I am trying http://nsis.sourceforge.net/archive/...b.php?page=385
to Auto-uninstall old application before installing new application.
My Script looks like this
--------
Function .onInit
System::Call 'kernel32::CreateMutexA(i 0, i 0, t "1234") i .r1 ?e'
Pop $R0
StrCmp $R0 0 +3
MessageBox MB_OK "Installer is already running. Press OK to exit"
Abort
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" \
"UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"${APPNAME} is already installed. $\n$\nClick `OK` to remove the \
previous version or `Cancel` to cancel this upgrade." \
IDOK uninst
Abort
uninst:
ClearErrors
ExecWait '$R0 _?=$INSTDIR' ;Do not copy the uninstaller to a temp file
IfErrors no_remove_uninstaller
Goto uninstaller
;components page, make sure all sections are uninstalled.
no_remove_uninstaller:
done:
FunctionEnd
Section Uninstall
uninstaller:
;Remove from registry...
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
; Delete self
Delete "$INSTDIR\uninstall.exe"
SectionEnd
--------------------
This script is not working because of some problem in uninstaller section.
I have written an uninstaller section seperately and i want control to jump to that section for uninstallation.
what is the problem there??