Check whether your application is running

From NSIS Wiki
Revision as of 19:28, 9 April 2005 by ConversionBot (talk | contribs) (Wikipedia python library)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The Script

;If application is running during uninstallation,exe file is not removed !!
;This code checks for an instance of application and Prompts the user to close ;application before resuming uninstallation ..
 
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
  FindWindow $0 "WindowClassOfYourApplication" "WindowTitleOfYourApplication"  
  StrCmp $0 "0"  0 +3     ;if window active goto +3 
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +4   
  Abort
  MessageBox MB_ICONEXCLAMATION|MB_OK "Installer Found that Application you are trying to remove is running.Close it and try again!!"
  Abort
FunctionEnd
 
;For any queries mail me at :saabz_500@yahoo.co.uk

Page author: saabz_500