User Tag List

Results 1 to 8 of 8

Thread: Creating INI Files - C root path and Windows folder are off limits!!

  1. #1
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Paul_Boland's Avatar
    Join Date
    Jun 2006
    Location
    Waterford, Ireland.
    Posts
    2,739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Creating INI Files - C root path and Windows folder are off limits!!

    Hi Folks.

    I'm running Windows 8.1 64bit and I've just discovered that writing INI files to the Windows folder or the C root path is not working. I'm putting finishing touches on DigiGraph 3 and need to save the applications installed path to an INI file so the DigiGraph 3 Screensaver can access the users created screensaver presentation files. My first port of call was writing this to an INI file in the Windows folder but it doesn't work. Yes, I have ticked off for it to use the Application Directory folder and I have even specified the Windows path "C:\Windows\MyINIFile.ini", but the file didn't appear.

    Still needing a location that I could easily store and access this file, I decided to write the INI directly to the C root path. Again this did not work.

    My only solution has been to write my INI file to the MyDocuments folder. This worked fine but I'm not happy with it. What if a user has their MyDocuments folder set to be on the SkyDrive or wherever!?! I can write INI files into my own folders just fine but not into Windows or the C root and this is not good. Anyone got any ideas on how to sort this or do I just go ahead and use the MyDocuments folder?
    KnightTrek Productions
    http://www.knighttrek.com

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Paul_Boland's Avatar
    Join Date
    Jun 2006
    Location
    Waterford, Ireland.
    Posts
    2,739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did some research. The C root drive is locked down in Windows 7 and 8. You can create directories on it but not files. What a load of nonsense!

    So I've been looking around at my options and the File Object allows me to get the All Users folder. This returns c:\users\public. This would be great because this will be local on all computers but in the Fusion 2.5 help file is says not to use this command and to use the All Users Documents command instead. When I do this is is returning an invisible folder at c:\users\public\public documents. Is there a specific reason why I shouldn't use the All Users option? It would be ideal for me.
    KnightTrek Productions
    http://www.knighttrek.com

  3. #3
    Clicker Fusion 2.5 DeveloperInstall Creator Pro

    Join Date
    Sep 2006
    Posts
    517
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Paul,
    If MS is willing to organize a little bit the amount of files each software is producing, locking some folders and enforcing some kind of policy make sense. Data of applications have to go in Application Data or All Users Application Data. Both can be retrieved using File object.

    Personally nowadays I would recommend not using INI's property to set the filename, but instead to compute it with events. In addition of avoiding some annoying side effects, it allows to first check for a file beside the executable (portable mode) and then for a file in Application Data folder (current user folder or all users folder).
    ouly

  4. #4
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleUnicode Add-onInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Posts
    574
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Its not a great idea to use the root or windows directory anyway. It's definitely better to either use the all users/public user application data path or what you'll more likely to see with programs is the use of %ALLUSERSPROFILE%. This by default will return with "C:\ProgramData". Which is what I'd use if I ever had to store a config... ie %ALLUSERSPROFILE%\Program_name\config.ini

  5. #5
    Clicker Multimedia Fusion 2 DeveloperInstall Creator Pro
    Corlagon's Avatar
    Join Date
    Jul 2006
    Location
    a basement in Muenster
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    JFTR: The Windows directory has already been restricted to administrator accounts since Windows XP.

  6. #6
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    As Ouly says, use ApplicationDataDir Paul. That's the standard now, also ProgramData can be used.
    Want to learn Clickteam Fusion 2.5?




  7. #7
    Clicker Multimedia Fusion 2 Developer
    Jax's Avatar
    Join Date
    Jul 2006
    Location
    UK
    Posts
    702
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    When your program is running you should assume that you do not have permissions to write in any directory (not explicitly specified by the user) with the exception of the user directories. If you need such an INI file or registry key you should write it as part of the installer.

    For instance, an office's IT policy may prevent the user creating files or folders in any directory other than the user's home directory.

    (The All Users profile might be an exception but I can't actually find any guarantee that you can write to it from all accounts, so it may be that that can legitimately fail)

  8. #8
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Paul_Boland's Avatar
    Join Date
    Jun 2006
    Location
    Waterford, Ireland.
    Posts
    2,739
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for all the feedback. Seems using the Application Data folder is the way to go, just don't like writing to invisible folders because I can't see the file to make sure it's right but it shouldn't be an issue.

    Quote Originally Posted by ouly View Post
    Personally nowadays I would recommend not using INI's property to set the filename, but instead to compute it with events. In addition of avoiding some annoying side effects, it allows to first check for a file beside the executable (portable mode) and then for a file in Application Data folder (current user folder or all users folder).
    ouly
    Thanks, Ouly, but it wouldn't work for the screensaver. The INI file is storing the installation path of DigiGraph 3 so that the screensaver knows where it is and can access the screensaver presentation data that the user created at runtime. So I need to write this data somewhere that is common on all computers and have the screensaver read it and find the path and read the presentation data in question.

    Jax. I don't know how to write an INI file as part of an installer but I know Install Creator has that feature so I'll look into it.
    KnightTrek Productions
    http://www.knighttrek.com

Similar Threads

  1. Active Picture & Root Folder
    By ffomega in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th February 2011, 04:47 PM
  2. Install Creator Pro not uninstalling root folder
    By docmartin in forum Install Creator and Patch Maker
    Replies: 2
    Last Post: 18th December 2010, 07:14 AM
  3. I Need help extracting the root path from a string
    By BrashMonkey in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 27th September 2009, 07:39 AM
  4. Root Path File Example
    By drnebula in forum File Archive
    Replies: 0
    Last Post: 26th September 2009, 07:52 PM
  5. install files to the ROOT dir - how
    By tpeck in forum Install Creator and Patch Maker
    Replies: 4
    Last Post: 23rd September 2009, 03:42 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
  •