Close Borland Delphi With User Approval: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author and download links, and changed format of some pages.)
m (Updated author links.)
Line 1: Line 1:
{|align=right
|<small>Author: [[{{ns:2}}:amlsydney|amlsydney]] ([[{{ns:3}}:amlsydney|talk]], [[{{ns:-1}}:Contributions/amlsydney|contrib]])</small>
|}
<br style="clear:both;">
== Description ==
== Description ==
Here is a function for anyone who needs to install components into Borland Delphi and therefore requires it to be NOT RUNNING... but of course we do not want to force Delphi to exit without saying at least something to the user...
Here is a function for anyone who needs to install components into Borland Delphi and therefore requires it to be NOT RUNNING... but of course we do not want to force Delphi to exit without saying at least something to the user...
Line 26: Line 30:
FunctionEnd
FunctionEnd
</highlight-nsis>
</highlight-nsis>
Page author: [[User:amlsydney|amlsydney]]

Revision as of 23:15, 29 April 2005

Author: amlsydney (talk, contrib)


Description

Here is a function for anyone who needs to install components into Borland Delphi and therefore requires it to be NOT RUNNING... but of course we do not want to force Delphi to exit without saying at least something to the user...

; -----------------------------------------------------------------------------
Function CloseDelphiWithUserApproval
; Inspired by [[Detect & Close Winamp]]
; -----------------------------------------------------------------------------
Push $5
 
loop:
  FindWindow $5 "TAppBuilder"
  IntCmp $5 0 done
 
  MessageBox MB_RETRYCANCEL|MB_ICONSTOP 'The Borland Delphi IDE may not be running during this installation.$\r$\nClose the IDE manually now, or press Retry for automatic closing of Delphi, or press Cancel to cancel the installation entirely.'  IDCANCEL BailOut
 
  SendMessage $5 16 0 0
  Sleep 1000
Goto loop
 
BailOut:
  Abort
 
done:
Pop $5
FunctionEnd