The last blog entry about script packages and elevation prompted Don Jones to ask if we consider adding a template to PrimalScript or even a manifest builder.
Truth is, manifests are so simple that this hardly seems necessary. Here is the manifest file I usually use as a template:
ftp://ftp.sapien.com/manifest.xml
There really are only three places to change to adapt this to whatever you do:
In the assemblyIdentity node you should insert the name of your executable you are planning to create.
<assemblyIdentity
processorArchitecture=”x86″
version=”5.1.0.0″
type=”win32″
name=”yourexecutablename.exe”/>
The description node gets brief note what your application is about:
<description>MANIFEST DESCRIPTION</description>
Last but not least the requestedExecutionLevel gets the elevation setting your file requires.
Set the level to “requireAdministrator” if you need admin privileges. The application will not execute if that permission level cannot be acquired.
<requestedExecutionLevel
level=”requireAdministrator”
uiAccess=”false”/>
Other settings for the level attribute are “AsInvoker” and “HighestAvailable”.
Here is what these values mean:
AsInvoker – the executable runs with the same privileges the current user has. There will be no UAC prompt and no attempt to elevate.
HighestAvailable – For Administrators: when run the executable will open a UAC prompt offering the opportunity to run elevated but allowing it to continue to run as a limited user if the user does not know or does not wish to elevate the executable.
For non-privileged users there is no UAC prompt to elevate.
requireAdministrator – the executable will cause a UAC elevation prompt offering the opportunity to run elevated. If the user cannot provide credentials for an Administrator account elevation will fail and the executable will not be run.
As for the rest of the file, just leave it alone. It’ll be fine.
Maybe we can update the script packager for PrimalScript 2009 to generate the manifest from your settings. Use the comments to let us know.