Author |
Topic: Manifests (Read 423 times) |
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Manifests
« Thread started on: Aug 23rd, 2014, 11:22am » |
|
There's an ongoing thread at the LB forum about application manifests, which don't seem to be very well understood. Every compiled LBB executable contains a manifest which provides the following features that LB 4.04 (ordinarily) doesn't:
The application is declared to be 'UAC aware' which specifically means that file-system and registry virtualisation is disabled.
Virtualisation is a technique used by Windows to improve compatibility with programs designed to run on versions prior to Vista. Specifically, programs of that kind often expect to have admin privileges, allowing them, for example, to write to the C:\Program Files\ tree. In Vista and later, programs (usually) run without admin rights so if no special measures were taken those old applications would fail.
The virtualisation workaround means that if the program attempts to write to C:\Program Files - or to protected parts of the registry - those writes appear to succeed. But in fact they are redirected by Windows to a copy of the registry/folder and when the program exits the changes it thinks it has made haven't actually happened!
With the manifest automatically added by LBB, the program 'sees' the real file system and registry, and can write to the 'protected' areas only if it has admin privileges (e.g. has been run 'elevated', see below).
The application is declared to be compatible with all versions of Windows up to and including 8.1. What this means is that Windows won't apply any automatic 'compatibility shims'.
For example, the GetVersion and GetVersionEx APIs may by default 'lie' to the calling application by returning not the true version number but an earlier version. This is obviously unhelpful if, for example, you want to report the version of Windows to the user.
With the manifest automatically added by LBB, the true version number is returned, up to Windows 8.1 at least. As noted above, in Windows Vista and later programs don't normally run with admin privileges, so you cannot write to C:\Program Files\ or certain registry locations (when compiled with LB 4.04 such writes will appear to succeed, but won't actually do anything; when compiled with LBB the writes will fail).
If you really do need to write to such locations (for example your application is an installer, or includes an automatic 'update' feature) it will need admin rights. One way of acquiring those is to run the program 'elevated', either by right-clicking and selecting 'Run as administrator' or by using the runas shell command (in both cases a UAC prompt will appear).
But you may feel that this is not user-friendly. What if you want your application to prompt for elevation automatically without being 'run as administrator'. In principle you can achieve that by modifying the manifest - but LBB at present doesn't support that (you may be able to achieve a similar effect by supplying a side-by-side manifest with your application, but that's a bit messy).
I could, in principle, modify LBB to provide the option of compiling an executable which automatically prompts for elevation; that would be convenient if the program was an installer. Would you like me to add that feature to LBB?.
The next update to LBB is due for release soon, so it would be helpful to receive your feedback as soon as possible.
Richard.
|
|
Logged
|
|
|
|
pierscintilla
New Member
member is offline
Gender:
Posts: 30
|
|
Re: Manifests
« Reply #1 on: Aug 26th, 2014, 11:37am » |
|
"I could, in principle, to modify LBB Shops provide the option of compiling an executable Which automatically prompts for elevation"
Characteristic very interesting and useful!!
Pier
|
|
Logged
|
|
|
|
|