DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY

Description

By default, this option is enabled. When it is active, BoxedApp intercepts all Windows Registry operations, redirecting them to its virtual registry.

This allows applications to read and write registry values transparently within a sandboxed virtual environment instead of modifying the actual system registry.

If you disable this option, BoxedApp will stop intercepting registry calls. All registry operations will then be handled directly by the operating system, effectively turning off the virtual registry.

Example

void main()
{
  BoxedAppSDK_Init();
 
  // Disable the virtual registry
  BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY, FALSE);
 
  // Registry operations will now affect the real Windows registry
  HKEY hKey;
  RegCreateKeyEx(
      HKEY_CURRENT_USER,
      _T("Software\\RealApp"),
      0,
      NULL,
      0,
      KEY_WRITE,
      NULL,
      &hKey,
      NULL);
  RegCloseKey(hKey);
 
  // Re-enable the virtual registry
  BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY, TRUE);
}
begin
BoxedAppSDK_Init();
 
// Disable the virtual registry
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY, false);
 
// Registry operations will now affect the real system registry
with TRegistry.Create do
try
  RootKey := HKEY_CURRENT_USER;
  OpenKey('Software\RealApp', True);
  WriteString('Key', 'Value');
finally
  Free;
end;
 
// Re-enable the virtual registry
BoxedAppSDK_EnableOption(DEF_BOXEDAPPSDK_OPTION__ENABLE_VIRTUAL_REGISTRY, true);
end;

Remarks

When this option is enabled, BoxedApp:

  • Intercepts registry-related functions such as RegCreateKeyEx, RegSetValueEx, and RegQueryValueEx.
  • Redirects all registry operations into a virtual registry stored in memory.
  • Enables seamless virtualization of COM registration and other registry-dependent functionality.

Disabling this option is useful when debugging or when you need to allow certain operations to reach the real system registry.

See Also