PDA

View Full Version : QStandardPaths and Windows' C:\ProgramData



zethon
20th December 2013, 19:39
I have an app that is designed to run on Windows and MacOSX. I've been polishing it up and getting installers on both platforms ready but I've run into a snag and I'm not sure what the best design decision is.

The app is an executable, a couple libraries and some configuration files. Here's where it gets hairy. There are configuration files that I want to be installed in the "All User space", basically these files will be used regardless of what user on the machine is running the app.

My first thought was on Windows to put these in C:\ProgramData\[Organization]\[App]\ The first place I looked was QStandardPaths, but it turns out that none of the enums there point to this! It would seem that ProgramData is the 'logical' place to put files that should be "user agnostic" but why then does Qt have nothing built in to grab this folder? Is there a better place they should go? And also, what would the equivalent folder on the Mac-side be and how would I grab that?

anda_skoa
21st December 2013, 10:20
It those files are installed with your application, wouldn't it make most sense to have them relative to the application?
I.e. relativen to QCoreApplication::applicationDirPath()?

Does the list of ConfigLocation contain any non-user-local directories on Windows?

Cheers,
_

ChrisW67
21st December 2013, 20:05
If those files are shared and writable then putting them under Program Files with your application in un-Windows behaviour. You would need to also change the permissions a user has to write in these locations and run the risk that some 'helpful' anti-virus software will restore the permissions from time to time. If they are shared but not writable (or created and written only by the installer) then the application dir is not a bad place.