CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2007
    Posts
    102

    UAC - Where to store data?

    Hi all,

    I am facing some problems with my software and the UAC.
    I have developped a medical application. Images can be imported and are a stored in a database (MS-Access). By default, my installer will create an "Images" folder in the "program files" under my software name. When a user import images, those images will be stored into that folder. I also have a folder to store the log files.

    I understood the philosophy of the UAC but then, what is the right location to store images and logs, since those must be accessed by all users, it cannot be store in a folder under a specific user. Then what is the proper way to avoid running my application with administrator privileges?

    Does someone knows the proper way? Create a folder on the root of the "C:¥" drive is a dirty solution for me.

    Thanks,

    madric

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: UAC - Where to store data?

    Try CSIDL_COMMON_APPDATA folder. See CSIDL for description.
    Victor Nijegorodov

  3. #3
    Join Date
    Feb 2007
    Posts
    102

    Re: UAC - Where to store data?

    Thank you VictorN!

    Actually, I was exploring this since an hour. But I am facing another problem. I need to read/write files in that folder and any user (administrators or standard) should be able to read/write those file. I am facing problem with file permission. When I create a file, I tried to set full permissions for all users but I didn't find yet the way to do this.

    I found one thread in codeguru, saying that I should use CreateFile function. But I have a hard time to find a sample code for this. It doesn't look that obvious. Could you tell me if CreateFile is the right direction? If yes, would you have by any change a link to a page where I could see a sample code?

    Thanks anyway,

    madric

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: UAC - Where to store data?

    Hi madric,
    I never did it myself (manage permissions...), so try to search for example somewhere like here
    Victor Nijegorodov

  5. #5
    Join Date
    May 2002
    Location
    Lindenhurst, NY
    Posts
    867

    Re: UAC - Where to store data?

    This link may help too:
    http://support.microsoft.com/kb/310294

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured