The most you can do with standard Visual Studio download is to check the value of the AdminUser property. The predefined client prerequisite of the .NET Framework 4.0 uses a similar condition. You can find its manifest in this folder:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\DotNetFX40Client
This should also be supported by the bootstrapper manifest generator.
But, and this is big, in new versions of Windows all users can get administrator privileges through promotion. Thus, from the point of view of the installer, any user is considered as an administrator, even if he does not.
Thus, this approach is practically useless for Vista or higher.
You can try creating your own bootable EXE boot file that processes the prerequisites and verifies user rights. But you are likely to encounter the same problem.
In my experience, the best approach is to allow each installer to lift himself if necessary. Most of them have built-in mechanisms for this, especially from Microsoft.
If you are having problems with this approach, I am sure that they are not caused by privileges. Most likely, your precondition is configured incorrectly (for example, an incorrect command line).
source share