Vista and access to Common Application Data folders
-
Hi, I am trying to come to grips with Vista UAC and am having problems understanding the following.... My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'. The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem. I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder. Can someone tell me what I am missing? Thanks...
Glen Harvy
-
Hi, I am trying to come to grips with Vista UAC and am having problems understanding the following.... My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'. The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem. I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder. Can someone tell me what I am missing? Thanks...
Glen Harvy
-
Hi, I am trying to come to grips with Vista UAC and am having problems understanding the following.... My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'. The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem. I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder. Can someone tell me what I am missing? Thanks...
Glen Harvy
With Vista you sometimes have to right click on the application and select run as administrator. This will run the program as the administrator without have to always to UAC off. Hope that helps.
Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com
-
Hi, I am trying to come to grips with Vista UAC and am having problems understanding the following.... My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'. The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem. I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder. Can someone tell me what I am missing? Thanks...
Glen Harvy
I have been telling my users to switch the UAC of and of course this solves their immediate problem. However, that doesn't solve the issue - why can't my program read the data directory :mad: After another couple of hours research it seems InstallAware isn't changing the permissions as I thought it was. This now seems to make everything fall into place for me. I have found this http://stackoverflow.com/questions/243995/setting-folder-permissions-on-vista[^] and as I already have InstallAware (which is running with sufficient privileges) run an update program then I will include the method and make sure the said directory is granted read/write access.
Glen Harvy
-
You might be missing a few Vista rants :) Anyway, turning UAC off solves the problem, so, the solution is turning UAC off. What do you need it for anyway?
harold aptroot wrote:
What do you need it for anyway?
When someone downloads my program to test it out, the last thing I want them to have to do is send me an email saying - it doesn't work :confused: I would think many would just uninstall it and I've lost a sale. If I know my program doesn't work then I need to tell my users how to bypass/fix the problem or fix it myself. I don't want to tell my prospective client that MS doesn't know what it is doing in regards to the UAC and please turn it off. What are they going to think about me :(
Glen Harvy
-
With Vista you sometimes have to right click on the application and select run as administrator. This will run the program as the administrator without have to always to UAC off. Hope that helps.
Matthew Vass QA Analyst mvass@hostmysite.com HostMySite.com
tech603 wrote:
right click on the application and select run as administrator
I never knew that - thanks - it is another option I can suggest until I get this issue resolved.
Glen Harvy
-
harold aptroot wrote:
What do you need it for anyway?
When someone downloads my program to test it out, the last thing I want them to have to do is send me an email saying - it doesn't work :confused: I would think many would just uninstall it and I've lost a sale. If I know my program doesn't work then I need to tell my users how to bypass/fix the problem or fix it myself. I don't want to tell my prospective client that MS doesn't know what it is doing in regards to the UAC and please turn it off. What are they going to think about me :(
Glen Harvy
-
Hi, I am trying to come to grips with Vista UAC and am having problems understanding the following.... My installer software (InstallAware) uses $ALLAPPDATA$ as a pointer to the environment variable 'common user data' which prior to Vista was c:\documents and settings\all users\application data\program name etc' . In Vista it becomes 'c:\programdata\program name etc'. The installer installs all the data files in either Vista and XP etc OK but when the user runs my program in Vista, my program says it can't access the data files. Disabling the UAC fixes the problem. I specifically use InstallAware to set permissions for all users to have read write access to the $ALLAPPDATA$ folder. Can someone tell me what I am missing? Thanks...
Glen Harvy
If it's just during the program run rather than the application install, you need to add an Application Manifest File and edit it to request the permissions in there. The user will be greeted with the UAC prompt each time, but that's life with Vista :mad: The recommendation is to make the program not require elevation, but as you know, that's not always possible/practical.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) -
If it's just during the program run rather than the application install, you need to add an Application Manifest File and edit it to request the permissions in there. The user will be greeted with the UAC prompt each time, but that's life with Vista :mad: The recommendation is to make the program not require elevation, but as you know, that's not always possible/practical.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)Thanks for your comments. I have made some progress:
DaveyM69 wrote:
you need to add an Application Manifest File
Actually, VS2008 adds it for you automatically and it defaults to 'asInvoker'. That's why my application runs OK when launched by the installer (by default the installer has elevated privileges) but not when the user (without elevated privileges) launches my application.
DaveyM69 wrote:
The recommendation is to make the program not require elevation, but as you know, that's not always possible/practical.
My application pops up it's own messagebox saying it can't access it's database. I included this ages ago well before Vista. I have determined that with Vista, it is because the UAC prevents access to the Common Application Data folder. The name of that folder is to me incongruous and lead me away from the fact that it cannot be read or accessed unless you have sufficient privileges. It's 'common' to all users accessing my application but not 'common' to all user privileges. Having discovered that fact, I later discovered that my Installer (InstallAware) fails to set privileges even if I do tell it to. Apparently you need to write additional scripts to get InstallAware to do it in Vista but InstallAware's help file and support generally lacks any specific information on how to do this. Earlier in this thread, you will read how I have discovered some code which I have now included in a program that runs at install time and therefor inherits InstallAware's elevated privileges. This code apparently sets the permissions successfully. Unfortunately I don't even own a copy of Vista so I can't personally test this. I am waiting for a tech savvy person I know who owns Vista to test it for me. If it works, I will post a small article because frankly, I don't see what all the fuss is about in regards to the UAC and Vista.
Glen Harvy
-
I have been telling my users to switch the UAC of and of course this solves their immediate problem. However, that doesn't solve the issue - why can't my program read the data directory :mad: After another couple of hours research it seems InstallAware isn't changing the permissions as I thought it was. This now seems to make everything fall into place for me. I have found this http://stackoverflow.com/questions/243995/setting-folder-permissions-on-vista[^] and as I already have InstallAware (which is running with sufficient privileges) run an update program then I will include the method and make sure the said directory is granted read/write access.
Glen Harvy
Check this out: http://www.snaponcode.com/post/2009/11/27/Setup-and-Deployment-Solution-in-Visual-Studio20083cscript-language3djavascript-src3dhttpsa12alphagodaddycomhosting_adsgd01js3e3cscript3e.aspx#comment[^] Here is the link that will help you write some code in setup project for read-write permissions. http://social.msdn.microsoft.com/Forums/zh/winformssetup/thread/8eeb0a7f-7fa4-4335-bee5-8c41d4665160[^] I hope this helps!