2

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?

Community
  • 1
  • 1
Cel
  • 6,467
  • 8
  • 75
  • 110
  • Maybe you should consider going with ClickOnce. It has a good Per-User story with the ability to bootstrapp the NETFX. – Christopher Painter Jun 30 '12 at 14:26
  • @Christopher ive reviewed other strategies (clickonce, Wix Burn, obsolete-becoming vs setup and deployment, installshield, nsis) and the only fitting one for my overall requirements was dotnetinstaller (although nsis may fit too, i did not yet research that much) - so cant do due to other criteria... – Cel Jun 30 '12 at 15:13
  • Well, I know InstallShield has a way of telling it to elevate the prereqs but not the MSI (UI). I can't say I've used .NET installer enough to know how to make it do that. I figured ClickOnce might be a good choice because it's designed for the Per-User story that I usually avoid. You don't say what your criteria was so it's hard to say if you've come to the correct conclusion or not. One simple approach would be to change the requirements that the MSI only checks for .NET 4.0 and blocks if not present. – Christopher Painter Jun 30 '12 at 15:48

2 Answers2

1

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.

dB.
  • 4,700
  • 2
  • 46
  • 51
  • while this doesn't answer how to elevate the prerequisites only, which is the crux of the question, you do point out an unfruitful avenue, thanks! – Cel Mar 14 '13 at 10:54
1

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

Cel
  • 6,467
  • 8
  • 75
  • 110