PDA

View Full Version : Termination Function



NewsArchive
08-18-2011, 02:43 AM
If I do not use [Gently] the termination is successful.
If I use the [Gently] option, then %_SB_ERRORCODE = 1 and
it causes myprog.exe to crash.
I'm guessing it's because I'm using WinEvent

Any ideas how to get around this issue as I would prefer to use [Gently]?


Set Variable %IS_RUNNING% to FUNCTION:Detect Active
Application("myprog.exe") [File Name]
If %IS_RUNNING% Equals "1" Then
Terminate Application "myprog.exe" [Application File Name] [Gently]
If %_SB_ERRORCODE% Does Not Equal "0" Then
Display Message Box "Unable to Terminate Existing Process
%_SB_ERRORCOD..." -- "Warning"
Exit Installation(-1)
End
End

tia
John

NewsArchive
08-18-2011, 02:43 AM
Hi John,

> If I do not use [Gently] the termination is successful.
> If I use the [Gently] option, then %_SB_ERRORCODE = 1 and
> it causes myprog.exe to crash.
> I'm guessing it's because I'm using WinEvent
>
> Any ideas how to get around this issue as I would prefer to use [Gently]?

I assume your application does not handle the WM_CLOSE event correctly. The
installer posts the WM_CLOSE event and your application has to "process" it
to terminate itself.

Friedrich

NewsArchive
08-18-2011, 02:43 AM
Thanks Friedrich, I'll check it out tomorrow.

John Taylor