jes
Posts: 34
Joined: Mon Oct 23, 2017 12:51 pm

To stop the uninstallation of the application, if the process is running

Mon Oct 23, 2017 1:31 pm

Hi,

Could somone please help me to solve the below scenario:

Task: To stop the uninstallation of the application, if the process is runnng/if the application is open.

Description:
I have a program, which is installed and currently open and the corresponding application.exe is listed in the Task Manager-Processes.
Now when user tries to uninstall the same application, it should stop the uninstallation,since the application is open.

Here, by checking AI_PROCESS_STATE, we can find whether the .exe is in running or in stopped state.
But, how can we stop the uninstalltion after detecting the application is open?


Thanks in advance.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: To stop the uninstallation of the application, if the process is running

Tue Oct 24, 2017 9:56 am

Hi and welcome to Advanced Installer forums.

In order to stop the uninstallation when your application is running, you can add a "Display error message" which will be executed only on uninstall based on the "AI_PROCESS_STATE" property.

Let me know if this helped, otherwise give me more details about your scenario.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jes
Posts: 34
Joined: Mon Oct 23, 2017 12:51 pm

Re: To stop the uninstallation of the application, if the process is running

Tue Oct 24, 2017 1:03 pm

Thank you for the response.

[img]C:\Users\jesny\Desktop\IMG_24102017_172503_0.png[/img]

By doing the above steps, we are getting a user interface like above at the time of uninstallation.
if we are selecting any of the options, the application got uninstalled.
and what we need is, the application should not uninstall if that application is in open/running state.

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: To stop the uninstallation of the application, if the process is running

Tue Oct 24, 2017 1:08 pm

Hi,

Your screenshot was not uploaded correctly and unfortunately I do not fully understand the problem. Can you please re-upload it? Don't you want to display anything to the user, just stop the uninstallation?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jes
Posts: 34
Joined: Mon Oct 23, 2017 12:51 pm

Re: To stop the uninstallation of the application, if the process is running

Tue Oct 24, 2017 1:14 pm

hi,

I just need to inform the user that, "The application is in running state and hence the uninstallation cannot be continued. Please close the application and try uninstalling again", once the user clicks OK for the message, the uninstallation should stop and application should remain.

I have given "AI_PROCESS_STATE=Running" as the condition for "Display error message"custom action, but still, the application gets uninstalled after displaying the attached image (which is not the way I want my application to work)action.

thank you.
Attachments
IMG_24102017_172503_0.png
IMG_24102017_172503_0.png (19.46KiB)Viewed 9456 times

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: To stop the uninstallation of the application, if the process is running

Wed Oct 25, 2017 8:52 am

Hi,

This dialog is automatically displayed by Windows Installer when it detects the application running. Unfortunately, the "Display error message" custom action is not allowed that earlier in sequence, sorry for the wrong suggestion.

In order to achieve what you need you can implement the steps described in the "how to Abort the Install on message box response" thread which debates a similar problem.

Let me know if you have any question.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jes
Posts: 34
Joined: Mon Oct 23, 2017 12:51 pm

Re: To stop the uninstallation of the application, if the process is running

Wed Oct 25, 2017 10:23 am

Hi,

Thanks !!!
Its working :)

Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: To stop the uninstallation of the application, if the process is running

Wed Oct 25, 2017 10:47 am

You're welcome. I'm glad you got this working.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Feature Requests”