Archive: Is RequestExecutionLevel a COMPILE-TIME directive?


Is RequestExecutionLevel a COMPILE-TIME directive?
I tried using RequestExecutionLevel in .onInit but the compiler gave me this error:

Error: command RequestExecutionLevel not valid in Function
Does this mean that RequestExecutionLevel is a COMPILE-TIME directive?

If so, what can I do to implement a pretty unique installer that "Requests ExecutionLevel" based on whether the logged in user has Administrator privileges?

I would like to implement this somewhat "smart" installer that changes its behavior based on the account type (i.e. admin vs. limited). Is this possible without resorting to write the installer entirely in win32 C or C++?

It creates an embedded XML manifest for Vista and later in the .exe, specifying what privileges are required.

You can look into multiuser.nsh; look in the C:\Program Files\NSIS\Docs\MultiUser folder for usage instructions.


redxii, thanks for your answer. I know how to use RequestExecutionLevel and I have been using it successfully in quite a few installers. I just want to confirm my understanding that it is a compile-time directive and that there is no way to tell Vista something like this:

"for the full set of features my installer requires Admin privileges but if you happen to run in a limited account you can still run this installer - for a reduced set of features."
Originally posted by redxii
It creates an embedded XML manifest for Vista and later in the .exe
So does that mean that RequestExecutionLevel is a COMPILE-TIME directive?


Thanks!

yes, it is compile time