I’m having an issue with a 3rd party component I have to interop with from C# or C++ but have no control over.
Here’s the situation:
The 3rd party component is a piece of software that writes data to the ‘Program Files’ folder. In Win7, this means that for users without admin access, this data will be written in the virtualized Program Files folder in there profile. I need to read that data through an API provided in a bundled .dll.
When running the 3rd party tool with admin rights and a box with UAC disabled (effectively allowing write access to c:\Program Files), I can read the data from that folder using standard interop (LoadLibrary/GetProcAddress in C++ or P/Invoke in C#). To be clear, in this case both the 3rd party software and my tool using the .dll are writing/reading from C:\Program Files (verified with Process Monitor from sysinternals).
Here’s the problem: on a system with UAC enabled, the 3rd party software writes to the virtualized folder, but my tool still reads from C:\Program Files, so I can’t read the data. Please note that I have no control over this, since I can’t directly read this data, I must go through the 3rd party .dll! So I guess my question is at this point: what can I do to make my program behave like the 3rd party component, i.e. force it to read from the VirtualStore when running with limited privileges? Or should I go about this differently?
There are 2 possible solutions for this scenario
We went with the second option as the 3rd party tool did not provide a scriptable way to change the installation folder 🙁