persistent AddonPreferences

I’m using AddonPreferences to store some system-dependent settings (like working directory, installation dir of 3rd party app) for my plugin. It works great.
Only problem is that when I disable and re-enable the addon, they are gone.

How can I make the settings “persistent”?

This is how they work, they get removed if you disable the addon.

Is it a good idea to export settings on a file? For example in this script Blender\2.70\scripts\addons\add_curve_sapling there is an operator called ExportData that writes to a file.

Otherwise another alternative would be to use Properties and let Blender store them in the RNA.

You can either store stuff in the current .blend, or write to an external file. The latter is not bad at all, just make sure the correct path is used (the addon’s dir, or maybe bpy.utils.user_resource(‘CONFIG’)) - make sure it it writeable!

I didn’t want to use Properties to store them in the RNA, because I share my files with people on other PCs (with other paths and other configurations). So I explicitly don’t want the configuration to be stored in the blend file, but on my pc.
Now I load the settings from bpy.utils.user_resource(‘CONFIG’)), and that seems to work fine. Thanks!