davidsmith
Posts: 59
Joined: Sun Jul 12, 2009 8:33 pm

uninstall: detectprocess - if it is running, don't uninstall

Is there a way to stop an uninstall from running if detectprocess detects that a Windows process is running?
Bogdan
Posts: 2791
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: uninstall: detectprocess - if it is running, don't uninstall

Hi,

Yes this is possible. Follow these steps:

- go to Custom Actions page
- right click Uninstall → Show Standard Actions → Before File Installation → InstallInitialize
- right click InstallInitialize → Add Predefined Custom Action → DetectProcess
- right click InstallInitialize → New Custom Action → Error Message

“DetectProcess” should have the Expression field from the Execution Condition group set to this value:

Code: Select all

 (REMOVE="ALL") 
“Error Message” should have the Expression field from the Execution Condition group set to this value:

Code: Select all

 (REMOVE="ALL") AND (AI_PROCESS_STATE="Running") 
The links I provided above will help you understand how the two predefined custom actions work.

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

Return to “Common Problems”