Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Vista and file access rights

    SDK Help
    0
    5
    396
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 30/04/2008 at 16:40, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R9-R10.5 
      Platform:   Windows  ; Mac  ;  Mac OSX  ; 
      Language(s) :     C++  ;

      ---------
      I have a user using my plugin on Windows Vista. He seems to be having access rights issues because my data files are in the "Program Files" folder (in my plugin folder more exactly). He recommends putting the data files in some "user" folder (whether or not this should be the "All Users" folder under "Documents and Settings" is beyond me - a little vague on the details he is). Not having Vista I don't know what differences exist and there is no way for me to test the issue or the efficacy of a solution.

      So, before you leave, Matthias, can you provide any information? I see that Cinema 4D prefs are loaded quite readily. Do I need to do something to appease Vista? Why would these files cause access problems? Do I need to set some attribute on the file (and how would that be accomplished)?

      Thanks,

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 01/05/2008 at 06:32, xxxxxxxx wrote:

        Under Vista file access rights are limited to read-only if the programm is under the "Program Files" folder. We are facing the same problems and working on a solution for this for future Cinema4D versions. Does your plugin write files in its own directory? If so you may need to move these files outside of the "Program Files" directory. Usally programs should use the user application folder.

        That's all I can say so far til I am back to work again.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 01/05/2008 at 17:01, xxxxxxxx wrote:

          Yes, my plugin reads/writes preferences, logs, and some other data into its own directory where installed.

          I see that there are two potential places to put my plugin data files on Vista:

          %systemdrive%\ProgramData\
          %Systemdrive%\Users<username>\

          Although ProgramData is a 'shared' application data storage (all users of the computer can access it), using this would probably be less hassle than employing Windows API calls to find <username>.

          Now the problem is determining %systemdrive%. GetSystemEnvironmentVariable() may be useful here. I did Java development to avoid OS-dependent API calls. And I didn't mind doing C4D plugin development for similar reasons - although I have had to make some OS API calls on MacOSX to get at file resources. I don't see a C4D SDK call that would retrieve the system drive where Windows is installed. I also have no idea how to determine which version of Windows is being used without employing OS API calls.

          Since Matthias is going to be away for a while, please, anyone respond with useful information regarding this.

          Thanks,

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

            On 02/05/2008 at 00:29, xxxxxxxx wrote:

            Okay. GetSystemEnvironmentVariable("UserProfile", result) works here. Using result.FindFirst("\\users\",..) (after doing a ToLower()) is enough to determine that this is Vista. I do a (GeGetCurrentOS() == OS_WIN) before that for clarity and brevity.

            After that is all validated (Windows, Vista), I can check for the existence of/create the necessary folders in the current user's folder in which to store the data and use that path instead of GeGetPluginPath() to get at them.

            It was a bit of work since GeGetPluginPath() is global whereas I needed to store the alternative (and the default for other systems) somewhere accessible to a myriad set of classes.

            Have fun! 😉

            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

              On 02/05/2008 at 12:28, xxxxxxxx wrote:

              You might want to look at and think about Get/SetWorldPluginData()... might simplify some things (you could even allocate some new IDs just for that use).   Though that wouldn't likely be useful for log-files, but you 'could' use it to store the folder/path, if not all the other data/preferences.

              1 Reply Last reply Reply Quote 0
              • First post
                Last post