CommonAppData on Windows 10 systems
CommonAppData on Windows 10 systems
Using GetSystemInfo and using CommonAppData to get the path will result in <sysdrive>\ProgramData
This works fine on windows 7 systems, but it seems this is changed since windows 10. If you put files in <sysdrive>\ProgramData they will only be available for writing for the user that have installed it or users with admin rights.
Googling this issue it looks like the \ProgramData folder is ment for static appdata files in Windows 10. Changable files should be put in <sysdrive>\Users\Public\AppData\
As far as I know Hollywood cant tell whitch WIndows version its running on, so as a workaround I must make a separate executable to use on WIndows 10 systems. And set it to use <systemdrive>\Users\Public\AppData\ instead of <CommonAppData>
I try GetEnv("os") to determine the windows version, but returns Windows_NT on both Win7 and 10.
This works fine on windows 7 systems, but it seems this is changed since windows 10. If you put files in <sysdrive>\ProgramData they will only be available for writing for the user that have installed it or users with admin rights.
Googling this issue it looks like the \ProgramData folder is ment for static appdata files in Windows 10. Changable files should be put in <sysdrive>\Users\Public\AppData\
As far as I know Hollywood cant tell whitch WIndows version its running on, so as a workaround I must make a separate executable to use on WIndows 10 systems. And set it to use <systemdrive>\Users\Public\AppData\ instead of <CommonAppData>
I try GetEnv("os") to determine the windows version, but returns Windows_NT on both Win7 and 10.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: CommonAppData on Windows 10 systems
I think what you're looking for is "AppData", not "CommonAppData", i.e.
This will return a location you can write to.
Code: Select all
p$ = GetSystemInfo().AppData
Re: CommonAppData on Windows 10 systems
"AppData" points to C:\Users\UserName\AppData\Roaming, and I can read/write to files put here. But other users will not have access to this folder.
Writable common application data is in C:\Users\Public\AppData\ on windows 10 systems, but there seems not to be a pointer to it.
If I could find a method to tell me whether the program is running on Windows 10 or newer, I could have a way to work abound this. Now my workaround is to create a separate executable for use on Windows 10 systems.
Writable common application data is in C:\Users\Public\AppData\ on windows 10 systems, but there seems not to be a pointer to it.
If I could find a method to tell me whether the program is running on Windows 10 or newer, I could have a way to work abound this. Now my workaround is to create a separate executable for use on Windows 10 systems.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: CommonAppData on Windows 10 systems
Says who? I don't even have an "AppData" folder in C:\Users\Public on my Windows 10 system.
"CommonAppData" from GetSystemInfo() returns C:\ProgramData on both my Windows 7 and my Windows 10 system. There is no difference. This is the folder Microsoft recommends for, well, common app data Hollywood just returns the value of CSIDL_COMMON_APPDATA.
But I think there are quite some design issues about this folder because other people are confused as well, see here: https://stackoverflow.com/questions/221 ... rogramdata
However, I haven't seen any official reference to C:\Users\Public\AppData as a folder for appdata for all users... if you have one, let me know... so as it stands, C:\ProgramData seems to be the only folder for application data for all users...
Re: CommonAppData on Windows 10 systems
It seemes to be an issue for many win 10 users.
https://answers.microsoft.com/en-us/win ... 64647176af
116 people have answered that they have the same question. Only a few people is happy with the proposed solution. OP replies, and I find his reply very much describes the same experience I have. Sadly the thread is closed without further replies.
On the company Windows 10 pc's I checked, the C:\Users\Public\AppData folder was present, and there was even a \Local\MicroSoft\Windows entry in there already. However, I see that it is not present on another private Pc with a recent win10 installation.
But that doesent change so much on my part, I just use C:\Users\Public and let my program create the needed folders in there, and it will work for all users.
https://answers.microsoft.com/en-us/win ... 64647176af
116 people have answered that they have the same question. Only a few people is happy with the proposed solution. OP replies, and I find his reply very much describes the same experience I have. Sadly the thread is closed without further replies.
On the company Windows 10 pc's I checked, the C:\Users\Public\AppData folder was present, and there was even a \Local\MicroSoft\Windows entry in there already. However, I see that it is not present on another private Pc with a recent win10 installation.
But that doesent change so much on my part, I just use C:\Users\Public and let my program create the needed folders in there, and it will work for all users.
- airsoftsoftwair
- Posts: 5433
- Joined: Fri Feb 12, 2010 2:33 pm
- Location: Germany
- Contact:
Re: CommonAppData on Windows 10 systems
Yeah, I'm afraid that this is a Windows issue, not a Hollywood one. So you need to find some way to work around it
Re: CommonAppData on Windows 10 systems
Is there a way for Hollywood to detect whitch Windows version it is running on?
Re: CommonAppData on Windows 10 systems
Code: Select all
DebugPrint(ReadRegistryKey(#HKEY_LOCAL_MACHINE,
"Software/Microsoft/Windows NT/CurrentVersion/CurrentVersion"))
; 5.0 Win2000
; 5.1 Win XP
; 5.2 Win XP 64bit/2003 server
; 6.0 Vista / 2008 Server
; 6.1 Win 7 / 2008 Server
; 6.2 Win 8 / 2012 Server
; 6.3 Win 8.1 / 2012 Server
; 10.0 Win 10
think of what happened in pas with "C:\" its my hard disk
Christos
Re: CommonAppData on Windows 10 systems
Thanks for the info about the ReadRegistryKey command. Although on my Windows 10 Home laptop the currentversion will report 6.3 and not 10.0plouf wrote: ↑Sun Jan 03, 2021 5:48 pmHowever you are aprroching your problem wrong, as Andreas said as long as the OS suggest a specific path for "common data" you should use the suggested method, for current AND future compatibilityCode: Select all
DebugPrint(ReadRegistryKey(#HKEY_LOCAL_MACHINE, "Software/Microsoft/Windows NT/CurrentVersion/CurrentVersion")) ; 5.0 Win2000 ; 5.1 Win XP ; 5.2 Win XP 64bit/2003 server ; 6.0 Vista / 2008 Server ; 6.1 Win 7 / 2008 Server ; 6.2 Win 8 / 2012 Server ; 6.3 Win 8.1 / 2012 Server ; 10.0 Win 10
think of what happened in pas with "C:\" its my hard disk
As stated earlier the data I put inside "CommonAppData" ended up as not writable for anyone but the current user, and "AppData" is the appdata for the current user and not ideal when I want the program data to be available for other users on the same computer.
So my approach may be wrong, but at least it is working for me.
Re: CommonAppData on Windows 10 systems
using google search, found the following conversation
https://stackoverflow.com/questions/310 ... m-registry
explains why if you get "6.3" you should double check using the new variables
CurrentMajorVersionNumber and
CurrentMinorVersionNumber
if it works for you, please post result for future help, since i have not handy win10 atm to check
https://stackoverflow.com/questions/310 ... m-registry
explains why if you get "6.3" you should double check using the new variables
CurrentMajorVersionNumber and
CurrentMinorVersionNumber
if it works for you, please post result for future help, since i have not handy win10 atm to check
Christos