tags:

views:

102

answers:

2

We've got a VB6 application that reads a simple text file with a .LIC file extension. When everything is working correctly, if the file exists in the same directory as the executable, it reads it. If not, it does other stuff.

I've got a customer with Windows 7 machines, and if he right-clicks the EXE and "Runs as Administrator" it "sees" the LIC file. If he runs the EXE as a basic user, the LIC file cannot be seen.

I've had enough issues with UAC to guess that UAC is running the application from a virtual directory of some sort and that's why the LIC file isn't seen. My customer swears he's turned UAC off.

Anyone have any pointers for me? It would be great if there was a way to tell UAC "let this app do what it wants in this directory". That's out of my expertise. I've been Googling till my fingers fall off, and I can't find the right answer.

Thanks!

A: 

It could also be permissions? If the user is not logged on as administrator, then your program may not have permissions to read the ".lic" file. Have you checked whether the user can open it in Notepad? Is it possible your code might be trying to open it with read/write permissions, which is even more likely to fail?

You may need to change your install so that it lowers the permissions on your apps installation directory.

MarkJ
+1  A: 

If you think virtualization is happening (which would cause it to look somewhere other than Program Files), give him a manifest file called foo.exe.manifest where foo is your executable name and have him put it in the same folder as the exe and the .lic file. This manifest should set the required execution level to asInvoker. This will suppress virtualization and so you can rule that out as part of the problem. He may then get access denied errors but that will help you sort out the problem.

Kate Gregory
I'm still working on this issue, but I'm pretty sure this is the issue. As much as I hate to admit it, I was unaware of this manifest requirement. I'm still working on this issue, but I'm pretty sure this is the issue. As much as I hate to admit it, I was unaware of this manifest requirement. I am surprised that Windows 7/Server 2008 doesn't prompt a messagebox on any new applications added that do not have a manifest with it. This would make more sense. There are a ton of "network admins" who know NOTHING of this manifest file being needed.
Jeff
There should also be an "auto-create" manifest utility for network admins trying to get apps to run on these new OS's without them having to turn UAC off to get legacy apps to run. Anyway, thanks Kate for getting me pointed in the right direction. Now that I know "what" to Google for, I'm finding tons of info. And I may be in touch with you Kate to pay for some consulting/mentoring on this issue if what I'm trying doesn't work.
Jeff