lekfir
Posts: 130
Joined: Sun Feb 15, 2009 5:26 pm

Terminate Process At the Beginning Of Uninstall

Hi,
1. What is the most initial step to run the Terminate Process in order to run it at teh beginning of Uninstalll?
2. Where can I find explanations, what is the meaning of each step in the custom action. For example: Before Initialization, InstallIlitialize...
3. What is the last step in the Install Custom Action that I can run a vbscript? I want to run a script After Driver installation.

Thanks!
MindTooth
Posts: 37
Joined: Mon Aug 17, 2009 12:40 am

Re: Terminate Process At the Beginning Of Uninstall

May this help you out?

Birger :)
lekfir
Posts: 130
Joined: Sun Feb 15, 2009 5:26 pm

Re: Terminate Process At the Beginning Of Uninstall

No, since it explains how to stop a process at the beginning of the installation.
I want it to close my process when Uninstall starts...
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Terminate Process At the Beginning Of Uninstall

Hi,
1. What is the most initial step to run the Terminate Process in order to run it at teh beginning of Uninstalll?
Please note that all Standard Actions are included in the MSI. It is their Execution Condition that determines if they are executed.
You can place the Terminate Process custom action under the "Before Initialization->Begin" Standard Action. Just make sure the Execution Condition is set to REMOVE = "ALL" .
2. Where can I find explanations, what is the meaning of each step in the custom action. For example: Before Initialization, InstallIlitialize...
After setting a Standard Action to be visible in the sequence, simply select it and a description of its function will be displayed in the right pane, under "Action Description".
Also, here is a list of all the Standard Actions and their description.
3. What is the last step in the Install Custom Action that I can run a vbscript? I want to run a script After Driver installation.
You can place your vbscript anywhere in the sequence, just make sure it has access to the installer properties. To do that, you can use the Action Data field as explained here.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
lekfir
Posts: 130
Joined: Sun Feb 15, 2009 5:26 pm

Re: Terminate Process At the Beginning Of Uninstall

Thanks!
When I place the Terminate Process at the InstallExecuteSequence->Begin step it successfully stops my process but when I place it in the InstallExecuteSequence->InstallInitialize step,
it doesn't stop my process.
The only different I see is that I can't set the Deferred with no impersonation option in the InstallInitialize step.
What is the meaning for that?
Is that means that sometimes this step will fail to stop the process?

Thanks!
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Terminate Process At the Beginning Of Uninstall

Hi,
The only different I see is that I can't set the Deferred with no impersonation option in the InstallInitialize step.
What is the meaning for that?
A deferred custom action can run only during the installation script execution(when the installation progress is shown). The deferred actions should be the only ones that make changes on the local machine. Custom Actions before InstallInitialize and after InstallFinalize cannot be deferred and they must be Immediate. Note that deferred custom actions do not have access to installer properties. Here are more details on this subject.
Is that means that sometimes this step will fail to stop the process?
No, the custom action should run all the time. Please send us the verbose log file and the .aip file to support at advancedinstaller dot com ,with the custom action scheduled under the InstallInitialize phase, so we can investigate it.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TTbeelivio
Posts: 9
Joined: Fri Mar 13, 2020 1:39 pm

Re: Terminate Process At the Beginning Of Uninstall

Hello all,

I am experiencing problems with terminate process custom action on UNINSTALL.

What i have here is one Terminate Process in - Wizzards Dialog Stage - before Searches and the
second Terminate process which i transferred to - Install Executtion Stage - using Shift pressed as described in the https://www.advancedinstaller.com/user- ... ocess.html documentation.

When i try to uninstall from Add-Remove Programs on Win10 while the program is running - the process is not killed(available in task manager)
but uninstalled properly while asking for a reboot before uninstalling (even if i did set it in install parameters -leftside menu to always surpress reboot and checked the Run As Administrator).

Note: I tried running the Powershell Inline Script custom action running this command:

Code: Select all

Stop-Process -Name "PrismeSyncAgent" -Force
without success.

Any idea how should I proceed ?

Thanks
Catalin
Posts: 7606
Joined: Wed Jun 13, 2018 7:49 am

Re: Terminate Process At the Beginning Of Uninstall

Hello Timotej,

Please note that the reboot message appears during the "InstallValidate" standard action - "Preparing" action group.

Therefore, to avoid that message, please schedule your custom action before the "Preparing" action group.

On a second note, when uninstalling from Control Panel, as you could notice, the UI sequence is skipped as the uninstall process is launched with basic UI. Therefore sharing the custom aciton between the two stages is a good practice.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
TTbeelivio
Posts: 9
Joined: Fri Mar 13, 2020 1:39 pm

Re: Terminate Process At the Beginning Of Uninstall

Hello again Catalin,

this is my setup displayed in this image link:

Image https://prnt.sc/rlbxna

which is exactly what you propose
Therefore, to avoid that message, please schedule your custom action before the "Preparing" action group.
Any other idea why uninstalling using UI (add remove programs) does not terminate the running process ?

Thanks
Catalin
Posts: 7606
Joined: Wed Jun 13, 2018 7:49 am

Re: Terminate Process At the Beginning Of Uninstall

Hello Timotej,

I have tested that scenario and everything was working fine on my end. This is quite strange.

First of all, have you tried manually running that command from outside of Advanced Installer. If so, does it work as expected (i.e. it terminates the process)?

You have stated previously that you have checked the "Run as administrator" option (this will make your setup run elevated, implying that your script will also run elevated, so this is good).

Could you please give me some more details about what type of process we are talking about here? Is the process a service, or is it like a simple executable (i.e. notepad.exe)?

Additionally, have you tried using our predefined "Stop process" custom action? If so, could you please let me know if the outcome was the same?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”