AI_PROCESS_STATE with multiple DetectProcess custom actions - 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!

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

AI_PROCESS_STATE with multiple DetectProcess custom actions

How do I use AI_PROCESS_STATE with multiple DetectProcess custom actions?

Case1: For install, I want to detect if PROGRAM1 is running, and if so, report a message and not allow the install.

Case2: For uninstall, I want to detect if either PROGRAM1 or PROGRAM2 are running, and if either are running, I want to report an error message and not allow the uninstall.

And so is there anyway to differentiate between case-1 and case-2?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: AI_PROCESS_STATE with multiple DetectProcess custom actions

Hello davidsmith,

The usage of DetectProcess is described in details here.
In your particular case, you need to:
- condition one DetectProcess custom action to be executed only during an install/upgrade and one only during uninstall. Obviously you will have two DetectProcess custom actions if you are checking if two programs are running during uninstall.
- use the Edit Condition dialog. There is a list of predefined conditions there that will let you differentiate between uninstalls and installs.
- use the ErrorMessage custom action to conditionally stop the install/uninstall process.

Please note that the AI_PROCESS_STATE property is overwritten with each call to DetectProcess, thus you will need to store its value in a different property for subsequent use, before calling DetectProcess again.


Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
davidsmith
Posts: 59
Joined: Sun Jul 12, 2009 8:33 pm

Re: AI_PROCESS_STATE with multiple DetectProcess custom actions

I apologize for asking some really basic questions, but I'm so close to being done with my installer... I really appreciate the help.

..."thus you will need to store its value in a different property for subsequent use, before calling DetectProcess again"...

How do I save the AI_PROCESS_STATE between DetectProcess calls?
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: AI_PROCESS_STATE with multiple DetectProcess custom actions

Hi,
How do I save the AI_PROCESS_STATE between DetectProcess calls?
Follow these steps:
-- select the first DetectProcess custom action
-- right click on it -> New Custom Action -> Property Set with Formatted
-- a new custom action should appear in the sequence between the the two DetectProcess custom actions.

Property Set with Formatted predefined custom action it is explained here.

A new property can be defined in the Properties group from the Install Parameters page.

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

Return to “Common Problems”