CloseApplication or StopProcess fails - 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!

ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

CloseApplication or StopProcess fails

When my feature is installed, the "StartServices" install action has an "EXE with working directory" custom action that starts one of the installed applications using the action data "[#myapp.exe] start". When I uninstall the feature, I need to close or terminate the application. I've tried adding a "CloseApplication" or "StopProcess" custom action with the action data "[#myapp.exe]" to the "StopServices" install action with a condition of "REMOVE="ALL"", but the application is never closed or terminated. The installer log file reports the following:

Code: Select all

MSI (s) (68:B0) [15:54:34:002]: Doing action: AI_DATA_SETTER_1
Action 15:54:34: AI_DATA_SETTER_1. 
Action start 15:54:34: AI_DATA_SETTER_1.
MSI (s) (68:B0) [15:54:34:012]: PROPERTY CHANGE: Adding CustomActionData property. Its value is '"G:\myapp.exe"'.
Action ended 15:54:34: AI_DATA_SETTER_1. Return value 1.
MSI (s) (68:B0) [15:54:34:012]: Doing action: CloseMyApp
Action 15:54:34: CloseMyApp. 
Action start 15:54:34: CloseMyApp.
MSI (s) (68:A4) [15:54:34:023]: Invoking remote custom action. DLL: G:\WINDOWS\Installer\MSIC8.tmp, Entrypoint: StopProcess
Action ended 15:54:34: CloseMyApp. Return value 1.
Same return code if I use CloseApplication.

Any suggestions?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: CloseApplication or StopProcess fails

Hi,

Please note that "[#myapp.exe]" will resolve to the entire path of install for the file "myapp.exe". The predefined custom actions you have used don't need the entire path:

1) "Close Application" custom action requires only the name of the EXE, here you can read more.

2) "Terminate Process" custom action requires only the name of the process. The following How To gives you more details.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

Re: CloseApplication or StopProcess fails

I did read both of those pages, but it is not clear from those that you shouldn't specify the path. I will try them again as you suggest.
ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

Re: CloseApplication or StopProcess fails

I retried both "CloseApplication" and "StopProcess" with the parameter "myapp.exe" and neither worked, reporting the same "Return value 1" in the log.

Any more suggestions?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: CloseApplication or StopProcess fails

Hi,

Can you please create a verbose log and send it along the aip file to support at advancedinstaller dot com so we can investigate this behavior?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ash_microsec
Posts: 38
Joined: Thu Dec 16, 2010 9:35 am
Location: Emsworth

Re: CloseApplication or StopProcess fails

Hi Bogdan, thanks for your reply. After trying different settings, I've got it to work. The only combination of settings that worked for me was "StopProcess" function name, "MyApp.exe" action data (without quotation marks), "Deferred with no impersonation" execution option.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: CloseApplication or StopProcess fails

Hi,

The "Deferred with no impersonation" execution option is important for systems from Vista onwards. This makes the custom actions to run with admin rights under the SYSTEM user account.
This could have made the custom action to fail before, if the other settings were correct.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”