Saving license files

  • Hello:

    I'm currently trying to implement a licensing solution into one of my
    applications, and I have some questions about certain implementation
    and the best way to store the license information.

    During the day I work with a number of computers (Windows and Macs),
    which includes installing and configuring software.  In the Windows
    world, it generally seems that once a piece of software has been
    installed and registered on a machine, anyone can launch the program.

    However, on the Mac-side of things, I've been noticing that not all
    programs work this way, and they will only be registered for the one
    user who entered in the registration info.  This is not for all
    applications, though.

    Any suggestions on what would be a good method on saving license/
    registration info?  I'm leaning towards saving a license file in /
    Library/Application Support/MyProduct/.  Can anyone (including
    Standard users) save to that location, or should there be a back-up
    method that should just save a copy to their Home ~/Library/
    Application Support/MyProduct/, just in case?

    Granted, I imagine that a lot of computers have just one user, but in
    some cases (say, a family computer where each person has their own
    account), there might be multiple users, and each person might want to
    use a particular application, but it can get pretty annoying after
    awhile to have to register the application for each and every user.

    Regards,

    Chad Armstrong
  • On Dec 19, 2007, at 7:25 PM, Chad Armstrong wrote:

    > I'm leaning towards saving a license file in /Library/Application
    > Support/MyProduct/.  Can anyone (including Standard users) save to
    > that location, or should there be a back-up method that should just
    > save a copy to their Home ~/Library/Application Support/MyProduct/,
    > just in case?

    I believe only admin users can write to /Library. The most correct
    thing is probably to just save in the home directory. If that's
    totally unworkable, you could also use ~Shared, but this should really
    be a last resort. I think it's bad form.

        - Scott
  • You should write to /Library/Application Support and ask for admin
    privs when needed and set the permissions correctly.

    --
    ==========================================
    SD

    WARNING: Programming may be habit forming.
  • On 19 Dec 2007, at 19:25, Chad Armstrong wrote:

    > I'm leaning towards saving a license file in /Library/Application
    > Support/MyProduct/.  Can anyone (including Standard users) save to
    > that location, or should there be a back-up method that should just
    > save a copy to their Home ~/Library/Application Support/MyProduct/,
    > just in case?

    Only admin users can write there. Allowing an admin to register for
    the entire machine, or a user to register themselves, seems like a
    good solution. (I haven't gotten around to this myself...)

    David Dunham    A Sharp, LLC
    Voice/Fax: 206 783 7404    http://a-sharp.com
    "People seem to misinterpret complexity as sophistication" -- Niklaus
    Wirth
  • I found a

    > I'm leaning towards saving a license file in /Library/Application
    > Support/MyProduct/.  Can anyone (including Standard users) save to
    > that location, or should there be a back-up method that should just
    > save a copy to their Home ~/Library/Application Support/MyProduct/,
    > just in case?

    I found an apple tech note saying this path.

    /Users/Shared/Library/Preferences.

    This location was recommended by Apple Sample code.

    http://developer.apple.com/samplecode/CFPrefTopScores/

    CFPreferences by design only allows write access to the
    kCFPreferencesAnyUser domain by a user with admin privileges. But
    occasionally developers have had the need to store user preferences
    that are both readable and writable by all users (without
    authorization). Currently the only location that meets this
    requirement is the </Users/Shared> directory. This sample
    demonstrates how to use Core Foundation API's to access (globally
    readable and writable) preferences in this location.

    --
    Thomas Myers - ITA,Inc.
    (585)889-9119
    5 Wood Sorrel                mailto:<tmyers...>
    Rochester, NY 14624          http://www.itainc.com

    C/C++, Photoshop Plug-Ins, Filemaker, Filemaker Plug-ins, Visual
    Basic, Real Basic, SCSI, Firewire, USB, Applescript, XML, TWAIN,
    Quicktime, Mac/Win cross platform solutions.
  • On Dec 19, 2007 10:25 PM, Chad Armstrong <edenwaith...> wrote:

    > Any suggestions on what would be a good method on saving license/
    > registration info?  I'm leaning towards saving a license file in /
    > Library/Application Support/MyProduct/.  Can anyone (including
    > Standard users) save to that location, or should there be a back-up
    > method that should just save a copy to their Home ~/Library/
    > Application Support/MyProduct/, just in case?

    Everyone can *read* /Library, but only admin users can *write* there.

    My recommendation:
    1) Give the user the choice of "Register for all users on this Mac"
    and "Register for me only"
    2) If they choose "for all users", then save the registration under
    "/Library" (asking for admin credentials if required), and if not,
    save the information under "~/Library".
    3) Then, when your program looks for the saved registration
    information, just use the standard search paths provided by
    NSSearchPathForDirectoriesInDomains, and use the first one
    encountered.

    > Granted, I imagine that a lot of computers have just one user, but in
    > some cases (say, a family computer where each person has their own
    > account), there might be multiple users, and each person might want to
    > use a particular application, but it can get pretty annoying after
    > awhile to have to register the application for each and every user.

    In this situation, an admin user (Mom, Dad, a Lab administrator, etc.)
    would register it once, choosing to register it for all users, and
    nobody else will ever be asked for registration information.

    --
    Clark S. Cox III
    <clarkcox3...>
previous month december 2007 next month
MTWTFSS
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            
Go to today