PDA

View Full Version : My xml function does not works in some operating systems



athulms
27th September 2011, 05:35
I have created a program to create an xml at the installed folder when the application starts.
It works in windows xp without failure. When i try it in windows 7 ultimate it does not works. But it works in all other versions of windows7
what is the reason?

ChrisW67
27th September 2011, 07:08
The answer hasn't changed since the first time you asked.

In general, you cannot write to the installation folder of a program (under "Program Files") on any flavour of Windows 7 without first butchering the permissions. You certainly should not rely on that working unless your application runs with Admin rights.

If your application does not carry a manifest then directory virtualization will be used to give the program the appearance of working: the created files will go into another (per-user) location and only virtually exist in the restricted location. Other users will not see the virtualized files. See Scenario 2 here (http://support.microsoft.com/kb/927387). For much more on this try here (http://windowsteamblog.com/windows/b/developers/archive/2009/08/04/user-account-control-data-redirection.aspx).

QDesktopServices can help find suitable locations to store information. On Windows you can use the SHGetKnownFolderPath function to find locations not available through QDesktopServices.