ganesh.0627
Posts: 11
Joined: Wed Aug 13, 2014 6:38 am

"change/Repair" does't run with the Admin privilege

Thu Sep 25, 2014 7:07 am

Hi,

I have installer with "run as Administrator" is checked in install parameters.

these are my findings
1) running the installer will have admin privilege.
2) "change/repair" via running the installer will have admin privilege
3) "change/repair" via control panel will not have admin privilege

please let me know is there any way so that i can have admin privilege even on "chaning/repairing" installation from control panel

Regards
Ganesh

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

Re: "change/Repair" does't run with the Admin privilege

Thu Sep 25, 2014 8:31 am

Hello Ganesh,

I'm afraid this is not possible. The "Run as administrator" option is proprietary to our EXE bootstrapper, therefore the installation will run elevated from the beginning only when started by the EXE setup. When launched from Control Panel you cannot force an elevation from the beginning. This is the default Windows Installer behavior.

Can you please share with us what are the reasons to start elevated from the beginning the maintenance operation from Control Panel? Maybe there is another workaround for your scenario.

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

ganesh.0627
Posts: 11
Joined: Wed Aug 13, 2014 6:38 am

Re: "change/Repair" does't run with the Admin privilege

Thu Sep 25, 2014 11:26 am

Hi Daniel,

We have C++ custom action which calls the lineRemoveProvider function(to remove an existing telephony service provider from the telephony system)
http://msdn.microsoft.com/en-us/library ... 85%29.aspx
Testcases
1) "change/repair" via running the installer
- This works fine as the lineRemoveProvider returns 0
2) "change/repair" via control panel.
- This fails as the lineRemoveProvider returns LINEERR_OPERATIONFAILED. This is failing because lineRemoveProvider needs the Admin privilege

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

Re: "change/Repair" does't run with the Admin privilege

Thu Oct 02, 2014 9:32 am

Hello,

I apologize for my delayed reply.

In order to achieve what you want you can configure your C++ custom action to run as deferred with no impersonation. Just go to "Custom Actions" page, select your custom action and enable its "When the system is being modified (deferred)" and "Run under the LocalSystem account with full privileges (no impersonation)" execution options. Please keep in mind that in order to be scheduled as deferred your custom action should be scheduled as a custom action with sequence after "Install Execution Stage -> Preparing" actions group.

As another approach, if your C++ custom action is not built as an EXE (i.e. a DLL), then you can build an EXE wrapper over your DLL custom action which will call your DLL and, afterwards you can launch your EXE wrapper using our "Launch file" predefined custom action. Lastly, you can enable the "Run As Administrator" option of your "Launch file" custom action.

If you have any questions let us know.

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

ganesh.0627
Posts: 11
Joined: Wed Aug 13, 2014 6:38 am

Re: "change/Repair" does't run with the Admin privilege

Thu Oct 09, 2014 7:12 am

Hi Daniel,

thanks for your feedback , i have tested running as deferred with no impersonation and it is working :)

Regards
Ganesha R

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

Re: "change/Repair" does't run with the Admin privilege

Thu Oct 09, 2014 7:35 am

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

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

thill
Posts: 111
Joined: Sat Jan 21, 2012 5:58 pm

Re: "change/Repair" does't run with the Admin privilege

Wed May 18, 2016 8:17 pm

Another question about this.

If Run As Administrator is required, and Repair is enabled, we add a "Repair" program group shortcut to execute the installer accordingly with Run As Administrator set on the shortcut.

However it fails if run from Programs & Features in Control Panel -- as you have explained in this thread.

Is there a way to have Repair enabled but NOT show that option in Programs & Features so the user has to use the program group shortcut?

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

Re: "change/Repair" does't run with the Admin privilege

Mon May 23, 2016 12:37 pm

Hello,

Yes, this can be done. Just go to "Product Details" page and check the "Disable Repair" option.

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

thill
Posts: 111
Joined: Sat Jan 21, 2012 5:58 pm

SOLVED Re: "change/Repair" does't run with the Admin privilege

Mon May 23, 2016 5:19 pm

Thanks Daniel - that works.

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

Re: "change/Repair" does't run with the Admin privilege

Tue May 24, 2016 9:36 am

You're always welcome.

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

Return to “Common Problems”