Results 1 to 3 of 3

Thread: QStandardPaths and Windows' C:\ProgramData

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2012
    Posts
    5
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Windows Android

    Default QStandardPaths and Windows' C:\ProgramData

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QStandardPaths and Windows' C:\ProgramData

    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,
    _

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QStandardPaths and Windows' C:\ProgramData

    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.

Similar Threads

  1. Replies: 0
    Last Post: 10th October 2013, 07:04
  2. Replies: 2
    Last Post: 6th September 2010, 14:22
  3. Replies: 3
    Last Post: 12th July 2010, 06:25
  4. Windows focus / Windows Shutdown Problems
    By December in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2007, 14:10
  5. Replies: 10
    Last Post: 25th February 2007, 00:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.