STOPPROCESS does not work on XP - 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!

stamhaney
Posts: 4
Joined: Wed Nov 28, 2012 6:59 am

STOPPROCESS does not work on XP

I am using an Enterprise Advanced Installer 9.6.1. I have added a Custom Action Stop Process, using which I want to terminate the process if it is running during uninstallation. The custom action works fine on Windows 7 and provides a warning message that the process is running and to click "ok" to stop it. If you press "ok", the process is terminated. However this does not happen on XP. On XP, if the process is running, the uninstaller does not provide a warning message, and does not stop the process. The files are moved however! When I checked the logs, I get a return code of 1 from StopProcess. The StopProcess custom action is inserted after the "Preparing" stage and also after Mainternance typelg. Can you please help?
Thanks
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: STOPPROCESS does not work on XP

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I've tested your scenario, but I cannot reproduce the behavior. Can you attach a sample which reproduce the behavior so we can investigate it? Also, can you run the related custom action as deferred with no impersonation and tell us if the behavior still persist?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stamhaney
Posts: 4
Joined: Wed Nov 28, 2012 6:59 am

Re: STOPPROCESS does not work on XP

Hi Daniel,

Thanks for your quick response. I am trying to attach the installer. As the size is 2 MB+ (as a RAR) , I cannot attach to this post as the limit seems to be 2 MB, are there any other options?

Shashank
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: STOPPROCESS does not work on XP

Hello Shashank,

You can send us the .AIP (project file) and its corresponding installation package to support at advancedinstaller dot com so we can investigate them.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: STOPPROCESS does not work on XP

Hello Shashank,

Please keep in mind that you should not use in the "Action Data" field, for a "Detect process" or "Terminate process" custom action, a formatted file referrence like this:

Code: Select all

[#MyFile.exe]
because at runtime this will be expanded to its full path (e.g. "C:\Program Files\Your Company\Your Application\MyFile.exe").

You should use in the "Action Data" field only the name (e.g. MyFile.exe, not its file path) of the process you want to detect or stop.

Also, if you want to run a custom action only if the "AI_PROCESS_STATE" property is set to "Running", then you should use a condition like this:

Code: Select all

AI_PROCESS_STATE = "Running"
Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stamhaney
Posts: 4
Joined: Wed Nov 28, 2012 6:59 am

Re: STOPPROCESS does not work on XP

Hi Daniel,

I updated the installer with the fixes you have suggested and observed the following:
1) When I use the formatted reference [#MyFile.exe] in the "Action Data" field , I get a warning message box from Advance Installer, mentioning that the process is running and will be stopped if I press OK. The process gets killed on pressing OK (Windows 7 only)

2) However when I use only the file name, MyFile.exe in the "Action Data" field, I did not get any warning message box, but the process was killed (Windows XP and Windows 7)

The fix does kill the process on XP, but is it possible that, if the process is running on XP and Windows 7, Advance Installer will display a warning message box on uninstallation, mentioning that the process is running and if OK is pressed, it will be stopped? Can this functionality be achieved?

Regards

Shashank
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: STOPPROCESS does not work on XP

Hello Shashank,
The fix does kill the process on XP, but is it possible that, if the process is running on XP and Windows 7, Advance Installer will display a warning message box on uninstallation, mentioning that the process is running and if OK is pressed, it will be stopped? Can this functionality be achieved?
Unfortunately, we don't have predefined support for this. In order to achieve this you can create your own custom action which will display a warning message and will set a property (e.g. MY_PROP) based on user interaction.

Here's the step to proceed:
- Go to "Custom Actions" page and add a "Detect process" custom action with sequence, scheduled after "Install Execution Stage -> Searches" action group, like this:
  • Action Data: MyProc.exe
- Add your warning custom action after the above custom action using the following condition:

Code: Select all

AI_PROCESS_STATE = "Running"
- Add a "Terminate process" custom action, scheduled after your warning custom action, like this:
  • Action Data: MyProc.exe
    Condition: MY_PROP
- Build and run your project.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stamhaney
Posts: 4
Joined: Wed Nov 28, 2012 6:59 am

Re: STOPPROCESS does not work on XP

Ok. It would be great if Advanced Installer incorporates this in a release :)

Thanks a lot for your help.

Regards

Shashank
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: STOPPROCESS does not work on XP

Hello Shashank,

Thank you for your suggestion. I have added this improvement on our TODO list and it will be available in a future version of Advanced Installer.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”