Check whether your application is running: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Removed Modern UI dependence. Fixed some spelling.)
m (Adding new author and category links.)
Line 1: Line 1:
{|align=right
{{PageAuthor|saabz_500}}
|<small>Author: [[{{ns:2}}:saabz_500|saabz_500]] ([[{{ns:3}}:saabz_500|talk]], [[{{ns:-1}}:Contributions/saabz_500|contrib]])</small>
|}
<br style="clear:both;">


== Description ==
== Description ==
Line 24: Line 21:
For any queries mail me at :saabz_500@yahoo.co.uk
For any queries mail me at :saabz_500@yahoo.co.uk


[[{{ns:14}}:Code Examples]]
[[Category:Code Examples]]

Revision as of 11:56, 24 June 2005

Author: saabz_500 (talk, contrib)


Description

This example detects if the application you are uninstalling is running at the start of the uninstallation process.

The Example Script

/* Replace the values of the two defines below to your application's window class and window title, respectivelly. */
!define WNDCLASS "WindowClassOfYourApplication"
!define WNDTITLE "WindowTitleOfYourApplication"
 
Function un.onInit
  FindWindow $0 "${WNDCLASS}" "${WNDTITLE}"
  StrCmp $0 0 0 continueInstall
    MessageBox MB_ICONSTOP|MB_OK "The application you are trying to remove is running. Close it and try again."
    Abort
  continueInstall:
FunctionEnd

For any queries mail me at :saabz_500@yahoo.co.uk