Results 1 to 4 of 4

Thread: VB6 - ProgData.Path to fix the App.Path problem

Threaded View

  1. #1

    Thread Starter
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Lightbulb VB6 - ProgData.Path to fix the App.Path problem

    Lots of people are still struggling with old VB6 programs that run afoul of App Compat file virtualization in current versions of Windows.

    It looks like these programs need a quicker fix than a thorough review and rewrite. Here's another idea to help do this.


    ProgData.Path

    First, we add a Class called ProgData with a Property named Path. Then we change any path-building logic in the program that uses App.Path to use ProgData.Path instead.

    What ProgData.Path returns is a new path within CommonAppData (ProgramData) named the same as the installed application's path within Program Files (Programs).

    For:
    C:\Program Files\FuddCo\FuddApp
    We get back the folder expanded from:
    {CSIDL_COMMON_APPDATA}\FuddCo\FuddApp

    ProgDFix.exe

    To make this work, we need to relocate the writeable files from Program Files to the new ProgData.Path folder after creating it and setting security to allow all-user read/write/delete access.

    ProgDFix.exe can do this for you. Just run it once after installation and it will move those files and deal with the security settings for you. Note that to accomplish this ProgDFix.exe runs elevated, which is why you'd want to do it as a last step in your install if possible.


    Attachment

    The attached archive has all of the necessary code and some example files to play with. This is described in the included ProgData.rtf document.

    I hope it helps somebody.
    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by dilettante; Sep 3rd, 2011 at 05:40 AM. Reason: reposted archive, small code changes to add Documents property, updated documentation

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width