Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 14 of 14
  1. #1
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292

    TextFile.Write* on Vista

    I want to know if the TextFile.Write* require administrator privileges to write to the source folder and that happens to be in the Program Files folder (it's Programs in Vista, I think)?

  2. #2
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    You have to have full administrator privileges to write to the Program Files folder on Vista. It's best just not to bother. You can create a folder on the C:\ drive and write all you want to it.
    Dermot

    I am so out of here

  3. #3
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    Or in the _TempFolder. I guess I'll use the temporary folder instead.

  4. #4
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Yep! _TempFolder is the best place if the files are not permanent.
    Dermot

    I am so out of here

  5. #5
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    It is somewhat permanent, though. Hmm, does the registry actions support /r/n? If they do, then I can use the registry to store the data, which should be available for normal users. Or does it ask the user if he wishes to allow the application to write a file? If not, then Microsoft has gone a bit too far with security :(

  6. #6
    Join Date
    May 2006
    Posts
    5,380
    the securty in vista only reflects the holes in securty in xp, you can never have to much securty

    write the file to a folder in the users my docs folder, that should be ok (but i dont have vista yet so i might be wrong)

    but as far as i am aware, the registry and program folder are protected areas, but my docs isent (plz, vista users correct me if i am wrong)
    Open your eyes to Narcissism, Don't let her destroy your life!!

  7. #7
    Join Date
    May 2005
    Posts
    1,115
    When installing your application, run this:

    Code:
    xcacls "path to the installation folder" /G Users:F /Y
    Never know what life is gonna throw at you.
    (Based on a true story.)

  8. #8
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Yes you can write to the users My Docs folder so that is fine as long as the files are only for that user. If they are to be written to by anyone that logs on then it won't work. Each user will have seperate files.

    I spent 3 days trying all different methods and the only one that was reliable and easy was to have my installer create a folder on the C: drive and use that for any files I needed to write to etc. Each user needed to access the same files so I had to have one central place. I tested it as an admin with UAC on and off and as a limited user and it works fine.

    As for the registry, I have given up on that now because of Vista. Just as easy to save settings etc. in a text or ini file.
    Dermot

    I am so out of here

  9. #9
    Join Date
    May 2006
    Posts
    5,380
    handy to know, thanks Dermot, i'll bear that in mind when making my apps from now on to avoid the vista issue
    Open your eyes to Narcissism, Don't let her destroy your life!!

  10. #10
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    Quote Originally Posted by Dermot View Post
    Yes you can write to the users My Docs folder so that is fine as long as the files are only for that user. If they are to be written to by anyone that logs on then it won't work. Each user will have seperate files.

    I spent 3 days trying all different methods and the only one that was reliable and easy was to have my installer create a folder on the C: drive and use that for any files I needed to write to etc. Each user needed to access the same files so I had to have one central place. I tested it as an admin with UAC on and off and as a limited user and it works fine.

    As for the registry, I have given up on that now because of Vista. Just as easy to save settings etc. in a text or ini file.
    That's the reason I made this statement a ways back and some poo-pooed my comment:

    http://www.indigorose.com/forums/sho...74&postcount=9

    Intrigued

  11. #11
    Join Date
    Apr 2007
    Location
    Mar Sara
    Posts
    292
    Quote Originally Posted by Intrigued View Post
    That's the reason I made this statement a ways back and some poo-pooed my comment:

    http://www.indigorose.com/forums/sho...74&postcount=9

    Thank you Intrigued, in that topic I found post (By Eagle) which said that the current Application Data isn't locked. I wonder if the Application Data for all users isn't locked, too?

  12. #12
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Quote Originally Posted by Desolator View Post
    Thank you Intrigued, in that topic I found post (By Eagle) which said that the current Application Data isn't locked. I wonder if the Application Data for all users isn't locked, too?
    I thought that was the perfect solution but when I tried logged in as a limited user, it did not work. It is stored in a folder named ProgramData. When you login as a limited user, you can't even see this folder. You can only see it when logged in as an administrator.
    Dermot

    I am so out of here

  13. #13
    Join Date
    Nov 2003
    Location
    Myrtle Beach, SC
    Posts
    155
    Many of you may know of this tool which can be of assistance with Vista UAC issues, but others may not.

    Microsoft Application Compatibility Toolkit 5.0 is a free tool from M$. It includes a utility named Standard User Analyzer. With SUA you choose an app to run, then launch it. SUA will monitor all activity from that app and reports tons of privilege info (if you choose detailed info from the view menu) after you exit the app. Its accompanying RTF file explains usage and the generated reports.

    Also, the first time you run it, you'll be prompted to DL another free M$ product that's required: Application Verifier.

    You actually get far more info than just acceptable directories that you can work in; but, it can help you pinpoint every issue that you'd have with a Standard User on Vista.
    Last edited by CyberRBT; 04-27-2007 at 01:27 AM.

  14. #14
    Join Date
    May 2005
    Posts
    1,115
    Quote Originally Posted by bule View Post
    When installing your application, run this:
    xcacls "path to the installation folder" /G Users:F /Y
    Forget that... it will replace the permissions, not add them;
    Instead, use this approach and you will have a write permissions
    for normal users withing your folder wherever it would be:

    Code:
    xcacls "path to the installation folder"  /G SYSTEM:F Users:RCW Administrators:F "Power Users":F Everyone:RX /Y
    Simply run this command when you are installing your software.
    http://www.ss64.com/nt/xcalcs.html
    Never know what life is gonna throw at you.
    (Based on a true story.)

Similar Threads

  1. Vista Compatibility Issue
    By jrak in forum AutoPlay Media Studio 6.0
    Replies: 5
    Last Post: 03-12-2007, 02:01 AM
  2. Have Vista yet?
    By Adam in forum AutoPlay Media Studio 6.0
    Replies: 8
    Last Post: 02-14-2007, 09:45 PM
  3. Setup does not run on Vista with UAC Off
    By pww in forum Setup Factory 7.0
    Replies: 6
    Last Post: 01-31-2007, 01:29 AM
  4. Vista Gold-RTM - confirm functions
    By Eagle in forum Setup Factory 7.0
    Replies: 10
    Last Post: 12-21-2006, 01:08 PM

Posting Permissions

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