Kill process with a message box - 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!

MBonevil
Posts: 45
Joined: Fri Jan 22, 2010 4:48 pm

Kill process with a message box

Hi,

When uninstalling my application, I want to ask the user to be able to kill two process (If Yes, kill 2 process.... if No, stop the uninstall).

1) How I can ask the user about the process?
2) If the user answer Yes, how I can kill the process? (It's possible to have on the same machine: C:\app 2.0\process.exe and C:\app 3.0\process.exe ... I just want to kill the process related to the current uninstall)
3) If the user answer No, how I can stop the uninstall?
4) If I kill the process, I do not want to see the MsiRMFilesInUse dialog. (during my test, if I kill the process, the MsiRMFilesInUse dialog show up even if the related process are killed).

Best regards,

Martin
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Kill process with a message box

Hi Martin,
1) How I can ask the user about the process?
You can use a Detect Process custom action to determine whether your process is running or not. However it can not differentiate between processes with the same image name, so it would be best if you wrote your own custom action for this purpose. Use a predefined Message Box custom action to prompt the user for a course of action. Or perhaps create a new windows installer dialog from the Dialogs page and conditionally display that.

I am afraid differentiating between processes with the same image name is not supported. You can try using the taskkill command line utility as a custom action to further differentiate between the processes. You might be interested in the window title filter if your app's titlebar differs between versions (because of including the version number in the title).
4) If I kill the process, I do not want to see the MsiRMFilesInUse dialog. (during my test, if I kill the process, the MsiRMFilesInUse dialog show up even if the related process are killed).
Make sure you detect and terminate the process before the InstallValidate standard action which detects files in use.

Let me know if this helped.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”