1

I have a VB6 legacy application that is normally installed in C:/Program Files/Application Name

This means that under Win7 and 8 it is subject to UAC Virtualization controls. As some users find the seeming absence of files confusing I would like to avoid the UAC Virtualization. If I were to install the application in another directory, such as

C:/My Application/AppName

which is separate from Program Files, would this avoid the UAC Virtualization or would it still occur?

Thank you

Clinton Reilly
  • 435
  • 1
  • 6
  • 10
  • 2
    Better to use "ProgramData" folder for your application eg. `C:\ProgramData\YourApplication\` – Bhavesh G Jan 14 '14 at 12:02
  • +1 Bhavesh. More explanations and code in [this question](http://stackoverflow.com/questions/4273424/where-should-i-store-application-specific-settings) – MarkJ Jan 14 '14 at 16:51
  • possible duplicate of [Prevent UAC Virtualization?](http://stackoverflow.com/questions/3181157/prevent-uac-virtualization) – MarkJ Jan 14 '14 at 16:53
  • See also this http://stackoverflow.com/questions/3469646/windows-7-uac-vb6-text-file-cant-be-seen-by-application – MarkJ Jan 14 '14 at 16:55

1 Answers1

2

Your best solution is to install the application in:

%LOCALAPPDATA%\ClintonSoft

e.g.

C:\Users\Clinton\AppData\Local\ClintonSoft

That is a folder that a user is allowed to modify.

Or you can turn off virtualization

You can opt-out of File and Registry Virtualization. You do this by adding an entry to your assembly manifest by indicating requestedExecutionLevel of asInvoker:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <assemblyIdentity 
            version="1.0.0.0"
            processorArchitecture="X86"
            name="client"
            type="win32"
    /> 

    <description>Clinton's Reilly Factor</description> 

    <!-- Disable file and registry virtualization -->
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker"/>
            </requestedPrivileges>
        </security>
    </trustInfo> 

</assembly>

Warning

By opting out of File and Registry virtualization , your application will fail with the exact same ACCESS_DENIED errors you would get on Windows XP.

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219