Difference between revisions of "Application Data Storage"

From den4b Wiki
Jump to navigation Jump to search
(General introduction and the standard storage location in the user profile directory)
 
(UAC and VirtualStore)
Line 21: Line 21:
  
 
<pre>C:\Users\UserName\Documents\den4b\AppName\</pre>
 
<pre>C:\Users\UserName\Documents\den4b\AppName\</pre>
 +
 +
== UAC and VirtualStore ==
 +
 +
Microsoft has introduced a concept of virtual storage, as a part of the User Account Control (UAC) system, for backward compatibly with legacy applications which attempt to save data in protected locations, such as "C:\Program Files". This feature was introduced in Windows Vista and is also present in later versions of Windows. For more information, see [https://docs.microsoft.com/en-us/previous-versions/bb756960(v=msdn.10) New UAC Technologies for Windows Vista].
 +
 +
This feature affects some older versions of den4b products, which always store user settings in the application executable folder. If the application was installed in a protected location, the actual saved content would be redirected to the so called ''VirtualStore'' location, usually without the application ever knowing the ''real'' path.
 +
 +
Type the following path into the address bar of File Explorer to access the root ''VirtualStore'' location:
 +
 +
<pre>%LOCALAPPDATA%\VirtualStore</pre>
 +
 +
==== Example of VirtualStore path ====
 +
 +
For example, if a legacy application was installed in:
 +
 +
<pre>C:\Program Files\AppName</pre>
 +
 +
And the application attempted to save a file in:
 +
 +
<pre>C:\Program Files\AppName\Settings.ini</pre>
 +
 +
The actual file would be transparently saved in:
 +
 +
<pre>C:\Users\UserName\AppData\Local\VirtualStore\Program Files\AppName\Settings.ini</pre>
 +
 +
Assuming a standard Windows installation with a username "UserName".

Revision as of 19:32, 17 December 2020

Introduction

Applications often require a dedicated location for storing the application data, such user settings, profiles and documents.

The choice of the storage location can vary wildly between different purposes, applications and operating system, but generally speaking they follow one of the two common conventions.

  1. Portable versions – Portable applications usually do not require any system specific installation or uninstallation routines, instead, they come in a form or an archive which you can unpack anywhere you like. All (or almost all) application data is stored in the same directory as the application executable file. This makes the application folder self-contained and portable.
  2. Installer versions – The application executable is normally installed in a system protected location (e.g. "C:\Program Files"), while the application data is stored in a separate user-accessible location dedicated by the operating system, such as the user profile directory (e.g. "C:\Users\User").

Where is my data

If you are using the installer version, your application data should be stored in the user profile directory.

Type the following path into the address bar of File Explorer:

%USERPROFILE%\Documents\den4b\

There, you should see one or more sub-folders, one per installed application.

In a standard Windows installation, for a username "UserName" and an application name "AppName", the fully resolved path should look like this:

C:\Users\UserName\Documents\den4b\AppName\

UAC and VirtualStore

Microsoft has introduced a concept of virtual storage, as a part of the User Account Control (UAC) system, for backward compatibly with legacy applications which attempt to save data in protected locations, such as "C:\Program Files". This feature was introduced in Windows Vista and is also present in later versions of Windows. For more information, see New UAC Technologies for Windows Vista.

This feature affects some older versions of den4b products, which always store user settings in the application executable folder. If the application was installed in a protected location, the actual saved content would be redirected to the so called VirtualStore location, usually without the application ever knowing the real path.

Type the following path into the address bar of File Explorer to access the root VirtualStore location:

%LOCALAPPDATA%\VirtualStore

Example of VirtualStore path

For example, if a legacy application was installed in:

C:\Program Files\AppName

And the application attempted to save a file in:

C:\Program Files\AppName\Settings.ini

The actual file would be transparently saved in:

C:\Users\UserName\AppData\Local\VirtualStore\Program Files\AppName\Settings.ini

Assuming a standard Windows installation with a username "UserName".