Custom Actions - Terminate running process - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

chen
Posts: 18
Joined: Mon Nov 26, 2007 6:02 pm

Custom Actions - Terminate running process

I am evaluating your software now. I created a script to install certain plug-in for Microsoft products. Before I can install/uninstall, I need to make sure that the processes for these products are terminated.

I have followed the example shown in http://www.advancedinstaller.com/user-g ... n-dll.html to create a custom dll to kill all the processes

I have insert the custom action as the first custom action in Install sequence at InstallExecuteSequence, But the installer seem to never call the dll.

Here is a code snipret for dll:

UINT __stdcall KillOfficeApps(MSIHANDLE hInstall)
{
::MessageBox(0, _T("Checking..."), _T(MSG_BOX_TITLE), MB_ICONSTOP);
int appRunning = DoKillApps();

if(appRunning <= 0)
{
::MessageBox(0, _T("There are no instances running."), _T(MSG_BOX_TITLE), MB_ICONSTOP);
return 0;
}
else
{
::MessageBox(0, _T("There are still instances of apps."), _T(MSG_BOX_TITLE), MB_ICONSTOP);
// fail the installer
return 1;
}
}

Did I do something wrong?

Thanks,

P.
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

Have you added the name of the function that should be exported ("KillOfficeApps") to the module-definition (.DEF) file? What settings (Execution Properties, Execution Condition etc) have you used for the Custom Action?

In order to get more information about this issue, you could create a verbose log during the installation using either the "Project -> Run and Log" option in AI or the following command-line:

Code: Select all

msiexec /I package.msi /L*V C:\package.log
If you still encounter problems, please send a simple test-case (AIP, CA DLL etc) that reproduces this issue to support at advancedinstaller dot com.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/
chen
Posts: 18
Joined: Mon Nov 26, 2007 6:02 pm

Looks like I forgot to modify the DEF with the name changes in DLL.

Thanks for the hint.

P.

Return to “Common Problems”