Results 1 to 6 of 6

Thread: Folder in admin account

  1. #1
    Join Date
    Jul 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Folder in admin account

    Hi,

    I'am developing a qt program that should be used by all users of a computer, but I want all the files generated by it stored in the administrator account, so that all users have access to the same files.
    The problem is that accessing a folder in the administrator account from another users account requires a password !

    My question is if its possible to give qt the password for the admin account ? Or maybe is there another way for saving files in one common location ?

    thanks.

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

    Default Re: Folder in admin account

    Have your install procedure create a common directory with appropriate UNIX permissions (you might use the setgid or sticky bits). Somewhere under /var may be appropriate, or you could allow the system admin to determine a location that suits them and specify that to the program.

  3. #3
    Join Date
    Jul 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Folder in admin account

    thanks,

    sorry, I forgot to mention the program is intended for Windows users.
    I want the files to be accessible for the application but not for the user.

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

    Default Re: Folder in admin account

    I selected UNIX because your profile lists only UNIX/X11.

    The answer is the same though: create folder with appropriate permission in your installer. Windows has designated locations for global shared data (e.g. FOLDERID_ProgramData or FOLDERID_PublicDocuments in SHGetKnownFolderPath function). These are not available through Qt4's QDesktopServices but may be available through Qt5 QStandardPaths

    If the application can read or write the file then so can the user... the application runs with their privileges after all. You can slow down the user by maintaining obscurity about the location, prohibiting directory listing on the folder, encryption using an obscured embedded key etc.

  5. #5
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    474
    Thanks
    10
    Thanked 62 Times in 60 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Folder in admin account

    Hi, there is also a Windows Environment Variable "ALLUSERSPROFILE", which points to a common directory for all users.

    Ginsengelf

  6. #6
    Join Date
    Jul 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Folder in admin account

    thank you very much for the replies,
    Question answred

    mugi

Similar Threads

  1. How to open folder and file in place with admin status
    By Momergil in forum Qt Programming
    Replies: 2
    Last Post: 19th December 2011, 10:42
  2. how to share link of an video to my facebook account/twitter account
    By Anshuman in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 29th April 2011, 05:39
  3. Replies: 0
    Last Post: 13th October 2010, 04:27
  4. Replies: 1
    Last Post: 19th January 2010, 21:35

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.