shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Question regarding the TerminateProcess

Hi,

I have a question regarding the Custom Action ->"TerminateProcess"

-Does this terminate the process running in user context, or will it terminate processes running in other user contexts too.

Consider the following scenario
- win-user1 opens the outlook.exe
- switches user(i.e fast user switching) to win-user2
- now win-user2 opens the outlook.
- Now, if win-user2 runs the setup, would it terminate all outlook processes? or would it terminate outlook process belonging to win-user2?

Regards,
Rohan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

Hi Rohan,

As I mentioned on the Termintaing the process problem thread, the "Terminate process" custom action will stop the processes running under all the users if it is executed with administrator privileges or it will stop only the current user's process if it is executed without administrator rights.

A custom action inherits the administrator rights from the package that launches it. So, we can consider three cases about how admin rights are set for a package and inherited by a custom action:
1. If the "Run as administrator" option is set for a package, the UAC will prompt at the beginning of the installation and all the custom action will inherit the admin rights.
2. If the the "Run as administrator" option is not set for the package, but the package is installed "per-machine", the UAC will prompt when the "Install Execution Sequence" starts (on the Progress dialog) and all the custom actions added on the "Install Execution Stage" will inherit admin rights.
3. If the the "Run as administrator" option is not set for the package and the package is installed "per-user", the UAC will not prompt for that package and no custom action will inherit admin rights.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Question regarding the TerminateProcess

Thanks. I have a setup which has "Run as administrator"(per-machine) in which I also do a "TerminateProcess".

While uninstalling, it seems to be terminating only the current user's process. Any idea about this?

If you need logs(or the aip file), I could send the same to you.

Regards,
Rohan
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

Hi Rohan,

I'm not sure why this happens. Can you send me the AIP file and also describe the uninstallation process (is the user that does the uninstallation admin, are the other users admins, too, what process do you try to stop)?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Question regarding the TerminateProcess

Reproduction steps
- Login as admin1(some administrative windows user)
- Extract the zip file in some folder
- Open the sample.aip file
- Now build the "TELES_BUILD"

- Now install the setup
- After the installation, open the Notepad
- Switch the user(i.e Fast user switching, not logoff) to say admin2
- Open the notepad
- Switch the user(i.e Fast user switching, not logoff) back to admin1
- Now uninstall(control panel->add remove->DesktopControl)
- After the uninstall, you could see the Notepad.exe still running for the admin2

Note: In the actual setup, I am terminating some other C++ excutable called as PalService.exe
Attachments
UCSoftphone.zip
(285.2 KiB) Downloaded 546 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

Hi Rohan,

I tested your package and, indeed, I reproduced the behavior. It seems that is not enough for the custom action only to inherit the administrator privileges from the package, but is should also run under the LocalSystem account ("deferred" with "no impersonation").

So, to make it behave as you need, you can place it under the "Preparing" action group and set the "deferred" with "no impersonation" options for it.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Question regarding the TerminateProcess

Thanks. It worked :-)
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

You're welcome. I'm glad I could help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Question regarding the TerminateProcess

Hi,

I guess last change has changed some behavior of my setup. Can you please help me to fix the same?

Note: I am not 100% sure whether it is the last change, but something done in last two days has changed this behavior.

Current Problem
- I have supported 3 features in my setup
- During the installation, I deselect TSP and Addin
- I could see that TSP and Addin is being installed(though I have deselected these)

Reproduction Steps
- Extract the zip
- Open the aip file
- Now build the "Teles_Build"
- Run the Setup
- Deselect TSP and Addin
- You could see the TSP files in C:\Program Files\TELES AG\DesktopControl\TSP

Can you please help me with this??

Regards,
Rohan
Attachments
UCSoftphone.zip
(285.58 KiB) Downloaded 601 times
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

Hi Rohan,

This problem seems to happen because of an Advanced Installer issue which was discussed on the Feature "install based on condition" broken with AI 10.5 thread. Can you try to implement the steps described in that post and see if it works?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
shetty_rohan
Posts: 363
Joined: Fri Dec 07, 2012 5:28 am
Location: Bangalore, India
Contact: Website

Re: Question regarding the TerminateProcess

Thank Eusebiu, I have just removed UpdateFeatureInstallState_1, and it started working fine.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Question regarding the TerminateProcess

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

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

Return to “Building Installers”