Install .NET 4 Prerequisite Elevated but Application MSI perUser

686 Views Asked by At

using dotNetInstaller 2.1.528

msi is always elevated with administrator_required

Elevating both Prerequisite and MSI

As detailed in the links below, when using dotNetInstaller bootstrapper: Under the “Runtime” section set the “administrator_required” to “True” this will allow dotNetInstaller to elevate components

  • So installing .NET 4 prerequisite starts to work when administrator_required is true, even if user does not run the installer with "Run as Administrator".

  • But now the msi is run with elevated privileges as well! Even though it is built for per user / non-elevated installs and running the msi directly installs it fine without any elevation (built with WiX).

dotNetInstaller: UAC Elevation on Install http://code.dblock.org/dotnetinstaller-uac-elevation-on-install

Configuring dotNetInstaller 2.0 to install custom prerequisites and then run a custom exe with elevated privileges. http://geekswithblogs.net/JaydPage/archive/2011/03/31/configuring-dotnetinstaler-2.0-to-install-custom-prerequisites-and-then-run.aspx

How to Elevate Only Prerequisite but Not MSI?

My .msi is per user not per machine and if the .NET 4 prerequisite is already installed then there is no need for elevation at all.

  • And the unnecessary elevation of (per-user) msi has the further effect of requiring elevation for uninstall.

  • How to achieve selectivity - elevate .NET 4 installer, but not the application msi?

2

There are 2 best solutions below

0
Cel On BEST ANSWER

Turns out selective elevation of prerequisites is not supported at the moment, and the answer lies in developing that feature in dotNetInstaller source code ...

1
dB. On

The prerequisites should elevate themselves at installation. There's no way to have the process de-elevate itself somehow or spawn a child that is less elevated than itself.