Registration File Vs User Prefs

  1. 9 months ago

    Martin F

    10 Feb 2019 Pre-Release Testers, Xojo Pro Kiama, Australia

    I use to store the Registration file for my program in the Application Support Folder and User Prefs in their Home folder on Mac and Windows (10 years back?).

    Somewhere a long the way that system broken down and I received complaints from customers that It requested that they enter the registration number every time they ran the program. So I am assuming the OSs changed along they way and I think that use to work for network installations as well.

    Before I jump in I was wondering are there preferred ways listers are using.

    Thanks
    Martin

    In every app I create I have three Methods in App:

    app.OpenPreferences 'creates the SQLite database and tables if they don't exist. ALTERs tables for new columns. Insert basic data
    app.GetPreferences 'reads the current preferences and sets up any global variables
    app.WritePreferences 'saves the current global variables for next launch

    I store the encrypted SQLite preferences file in the Application Support folder as 'MyAppName.SQLite'. If someone has a serious issue, you can tell them to delete this file and relaunch.

    Never store the preferences file with the Application, since OS's are increasingly making this area Read-Only.

  2. Beatrix W

    10 Feb 2019 Pre-Release Testers, Third Party Store Europe (Germany)

    Preferences on the Mac belong in the Preferences folder. However, I have had problems saving large amounts of data (some MBs) into a plist so I'm going to use an SQLite database in addition to a plist which will be in the Application Support folder.

    You need to get more information from your users why your registration scheme doesn't work.

  3. David C

    11 Feb 2019 Pre-Release Testers, Xojo Pro Answer Derby, ITM

    In every app I create I have three Methods in App:

    app.OpenPreferences 'creates the SQLite database and tables if they don't exist. ALTERs tables for new columns. Insert basic data
    app.GetPreferences 'reads the current preferences and sets up any global variables
    app.WritePreferences 'saves the current global variables for next launch

    I store the encrypted SQLite preferences file in the Application Support folder as 'MyAppName.SQLite'. If someone has a serious issue, you can tell them to delete this file and relaunch.

    Never store the preferences file with the Application, since OS's are increasingly making this area Read-Only.

  4. Jean-Yves P

    11 Feb 2019 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    what is the main difference(s) between application support and preferences folder ?
    what folder is for what usage ?

  5. @Jean-YvesPochez — According to Apple:

    Application Support:

    Contains all app-specific data and support files. These are the files that your app creates and manages on behalf of the user and can include files that contain user data.
    By convention, all of these items should be put in a subdirectory whose name matches the bundle identifier of the app. For example, if your app is named MyApp and has the bundle identifier com.example.MyApp, you would put your app’s user-specific data files and resources in the ~/Library/Application Support/com.example.MyApp/ directory. Your app is responsible for creating this directory as needed.
    Resources required by the app to run must be placed inside the app bundle itself.

    Preferences:

    Contains the user’s preferences. You should never create files in this directory yourself. To get or set preference values, you should always use the NSUserDefaults class or an equivalent system-provided interface.

    The main difference is that Preferences should not contain user data but only presentation settings

  6. Martin F

    11 Feb 2019 Pre-Release Testers, Xojo Pro Kiama, Australia

    Thanks for the clarification. Does anyone know if the Application Support Folder on Windows moved location in the past few years?

    and Beatrix, I think some of the Windows users had problems when I tried to fix the issue with the support folder by saving into the Application App folder which wouldn't work on network setups. At least that's what I think the issue was.

  7. Bob K

    11 Feb 2019 Pre-Release Testers, Xojo Pro, Third Party Store Kansas City

    @MartinFitzgibbons Does anyone know if the Application Support Folder on Windows moved location in the past few years?

    No, it's been consistent for a long time. The shortcut in Explorer is %appdata%.

or Sign Up to reply!