igor@inovativatec.co wrote: Recently we followed the great KB7 (How To: Install SLPS Runtime Components) and performed all necessary changes on the application.
Thanks for the kind words!
igor@inovativatec.co wrote: However, I'm getting the following exception when the installer.VerifyInstalled() method is called on the application startup:
Slps.Licensing.StorageAccessCouldBeVirtualizedException: Licensing storage access could be virtualized per user as this application does not have a manifest with a requestedExecutionLevel. If this is desired, use PermutationInstaller.VerifyInstalledEvenIfRegistryWouldBeVirtualized instead of VerifyInstalled
What does this exception actually mean? I cannot really understand it
This exception is being thrown because the licensing runtime has detected that registry access is being virtualized due to UAC virtualization (see http://en.wikipedia.org/wiki/User_Account_Control). Proceeding could mean that registry writes could get diverted to a per-user store. This can lead to a variety of confusing behaviour (works for one user but not another, license administrator doesnt show license but app does find it etc.)
The recommended (and generally by far the easiest solution to this is to add an UAC manifest to your app by (in VS) using Project|Add Components
and selecting Application Manifest File - especially as this is required for Windows Logo Certification in any case. There are potential problems with doing this code if you have code trying to write to HKLM or Program Files without appropriate permissions.
Given your app is currently under development, this should be fine for you.
There is a workaround to inhibit this check, but that should really be a last resort.
igor@inovativatec.co wrote: Do I have to efectively install the application ( I use a setup and deployment project type on Visual Studio) in order to use this approach? As I´m still developing the application, do I have to bypass this verification at development time?
You should not need to do anything different in a development context - this is about your app's interaction with UAC due to the absence of a manifest file.
Note that this warning is not about the installation necessarily having succeeded or failed - merely that one can never be sure if the app is running with UAC virtualization as attempts to read the registry may actually be reading shadowed versions of the data.
The current runtime requires at least one installation of an SLPS protected application to have succeeded on a machine in order for the licensing and installation checks to work. Generally on a development machine, Code Protector will be installed. As CP is SLPS protected, you will thus not have to do an install step for your app during your development phase. (i.e., you wouldnt even need to do a single install of your MSI on your development machine. (This is also why the fact that a protected app works on a dev box can mislead one into thinking it should work on clean machines without an install step.)
(ASIDE: In the latest beta version of the runtime components, the message has been clarified slightly in light of some cleanup in this area:-
Slps.Licensing.StorageAccessCouldBeVirtualizedException: Licensing storage could be virtualized per user as this Application does not have an Application Manifest resource with a requestedExecutionLevel specified. To resolve this issue, please add an Application Manifest resource with a requestedExecutionLevel. To inhibit reporting of this problem, pass RuntimeInstaller.OptionsEnum.PermitRegistryVirtualization to PermutationInstallerBase's constructor prior to calling VerifyInstalled() to ignore the error.
ASIDE 2: There is also an associated StorageInstallationWouldBeVirtualizedException which is the same problem in a slightly different context)
I hope this answers the question - apologies for length of the post. Please revert if you need any further clarification.