LB Booster
« Manifests »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:01am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Manifests  (Read 424 times)
Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

pierscintilla
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 30
xx 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
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls