Consultor Eletrônico



Kbase P168616: How to handle files stored in Windows VirtualStore when UAC is active
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/06/2010
Status: Unverified

GOAL:

How to handle files stored in Windows VirtualStore when UAC is active

GOAL:

How to find the location of the VirtualStore

FACT(s) (Environment):

Windows
OpenEdge 10.x

FIX:

Windows VirtualStore is being used when the User Account Control is active and when attempts are being made
to write into the Windows protected directories, such as %programfiles%, %programdata%, %systemdrive%, or %systemroot%.
When the logged-in user is not part of the Administrator group, or if the Administrator account
is being used with higher security settings for the UAC, then access to these directories will
be intercepted by the operating system and redirected to the appropriate directory within the VirtualStore location.
However, this might represent problems in case where the application requires access
to one of protected directories, as the file will not be located at the expected place.

In order to find required file, an ABL program can use operating system environment
variables to construct path to VirtualStore and add that to the SEARCH function, e.g. :

DEFINE VARIABLE cVSpath AS CHARACTER NO-UNDO.

cVSpath = OS-GETENV("LOCALAPPDATA") + "\VirtualStore\Program Files\MyDir\".

PROPATH = cVSpath + "," + PROPATH.

An example would be a WebClient application which by default installs application
directory into %programfiles%\WebClientApps .
Another approach is to avoid altogether installation of application under one of the protected
directories. An example is to choose WebClient application installation directory such as "C:\WebClientApps"
in which case virtualization redirect to the VirtualStore will not be used.