End a process with Inno Setup


So easy.
These two functions will ctry to close the process gt4t.exe at installation and uninstallation.
Notice tskill.exe is for Windows XP and taskkill.exe is for Windows 7.

[Code]
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
begin
ShellExec(‘open’,
‘taskkill.exe’,
‘/f /im gt4t.exe’,”,SW_HIDE,ewNoWait,ErrorCode);
ShellExec(‘open’,
‘tskill.exe’,
‘ gt4t’,”,SW_HIDE,ewNoWait,ErrorCode);
result := True;
end;
function InitializeUninstall(): Boolean;
var
ErrorCode: Integer;
begin
ShellExec(‘open’,
‘taskkill.exe’,
‘/f /im gt4t.exe’,”,SW_HIDE,ewNoWait,ErrorCode);
ShellExec(‘open’,
‘tskill.exe’,
‘ gt4t’,”,SW_HIDE,ewNoWait,ErrorCode);
result := True;
end;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s