Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 796809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T22:41:51+00:00 2026-05-14T22:41:51+00:00

The question pretty much says it all. I have an app with an older

  • 0

The question pretty much says it all.

I have an app with an older component that doesn’t work right if runtime themes are enabled. But if I don’t enable them, the app always ends up messing with the virtual store.

Thanks!

Update:

Using Mark’s solution below, the application no longer writes to the Virtual Store. But, now it won’t access a tdb file (Tiny Database file) that it needs. This tdb file is the same file that was being written to the Virtual store. Any ideas on how I can give it access to the tdb file and still prevent writing the Virtual Store?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T22:41:52+00:00Added an answer on May 14, 2026 at 10:41 pm

    You need to add a manifest (resource) to your exe.

    In the manifest is an XML Resource with content similar to that below. The TrustInfo is the key section that causes the VirtualStore not to be used.

    This example has the Microsoft.Windows.Common-Controls assembly referenced which enables runtime themes. If you remove that from the manifest you can still keep the TrustInfo section.

    Vista uses the TrustInfo to decide that the application “knows” about the UAC restrictions and does not use the VirtualStore for that application

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity
        type="win32"
        name="Delphi 7"
        version="7.1.0.0" 
        processorArchitecture="*"/>
      <dependency>
        <dependentAssembly>
          <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            publicKeyToken="6595b64144ccf1df"
            language="*"
            processorArchitecture="*"/>
        </dependentAssembly>
      </dependency>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel
              level="asInvoker"
              uiAccess="false"/>
            </requestedPrivileges>
        </security>
      </trustInfo>
    </assembly> 
    

    Here is a page with more detail on how to create and use the manifest files:
    http://ruminatedrumblings.blogspot.com/2008/03/vista-uac-manifest.html

    And a Microsoft page on the Application Manifest Schema:
    http://msdn.microsoft.com/en-us/library/bb756929.aspx

    Of course once you do this you will no longer be able to write data to c:\program files\ or other protected locations with UAC turned on. That is why Microsoft created the virtual store in the first place. It is intended to keep old applications running that expected to be able to write to those (now protected) locations.

    You have a few different options:

    1: Change the file location

    Move the tdb file to a different location. This is the ideal case but can require the most code changes. See the question “Correct way to design around Windows UAC Limitations” for some suggestions. The Microsoft recommendation is to store data that the user does not name under the “Application Data” folder. I tried this but it makes it very hard for users to find the data to move it to a different computer. I have moved all of my user data, even if the user does not specifically save the file, to the My Documents folder. That way when they get a new computer they can just move “My Documents” (and most do anyway) and all of my application data will move as well.

    2: Change the permissions on the file to allow standard users to read/write the file. Either your installer could do this or you could updated it after the fact, but you will need to be running as administrator to make the change.

    3: Force your application to run as administrator. If you set the execution level be “requireAdministrator” as Sertac notes you will be able to write to the files, but then your users will get a UAC Elevation prompt every time they run your application.

    Also note that if you are upgrading users who have been running and saving data to the Virtual Store there is nothing that automatically moves that data to the new location. Once you add the manifest to your application it will start to see the files that are actually under c:\program files*. You may need to look for files in the virtual store and copy them to the new location for the user. Below is an example. In my case license files were stored under the install directory. After I upgraded my application I needed to look for the old license files and move them to the new location:

    procedure TResetMain.CopyVirtFiles();
    var
      VirtLicDir: string;
      NewLicDir: string;
      FileOp: TSHFileOp;
    
      TempPath : array[0..MAX_PATH] of Char;
    begin
    
    
      SHGetFolderPath(Application.Handle, CSIDL_LOCAL_APPDATA, 0, 0, TempPath);
      VirtLicDir := TempPath + '\VirtualStore\Program Files\My Company\Licenses';
    
      NewLicDir := GetMyConfigDir();
      if NewLicDir <> '' then
      begin
        NewLicDir := IncludeTrailingPathDelimiter(NewLicDir) + 'User Licenses';
      end;
    
      // If the Virtual license directory exists but not the new directory we
      // know this is the first time the updated application has been run
      // and we need to move the files to the correct location.
      if DirectoryExists(VirtLicDir) and Not DirectoryExists(NewLicDir) then
      begin
        ForceDirectories(NewLicDir);
    
        FileOp := TSHFileOp.Create(nil);
    
        FileOp.FileList.Add(VirtLicDir + '\*.*');
        FileOp.Destination := NewLicDir;
    
        FileOp.Action := faMove;
        FileOp.SHOptions := [ofFilesOnly, ofNoConfirmation, ofNoConfirmMKDir, ofRenameOnCollision, ofSilent];
        FileOp.Execute;
    
        FreeAndNil(FileOp);
      end;
    
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The question pretty much says it all. I have a joomla website and I
The question pretty much says it all. I have a window, and have tried
The question pretty much says it all. Is there any way to have the
The question pretty much says it all. What supported JVM GC should we use
The question pretty much says it all, I've been looking around for an answer
Pretty much as the question says, I have some code running on an interval:
Question pretty much says it all. Is there an equivalent for org.hibernate.Version.getVersionString() in EclipseLink?
The question pretty much says it all. Somewhere in my code i instantiated an
Question pretty much says it all. You can read entity association here , but
The question pretty much says it all. I'd like to be able to search

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.