Working with AIR, files and XML configuration: tips & tricks

In last months I worked so hard with Flex, AIR and files. I’d like to share with you some tips that I think could save your time when you work on it.

 1. Don’t copy, write or do anything else with File.applicationDirectory. In Windows Vista, when you install an AIR application in Program folder, you can’t copy or update a file becuase Microsoft policy don’t allow to work on files in this directory and in all subdirectories.
If you try to make it, it fails silently so stop to execute the code immediately.

2.  You can’t set an <installFolder> different of Program or Application folder. If you try to set a different path like ../ or anything else in AIR configuration xml, when you create .air file, procedure fails with an error.
So you can only set Program folder (Windows) or Application folder (Mac) or a subdirectory like: Applications/myAirAppDir/

3. Attribute <programMenuFolder> is ONLY for Windows.
When you set this attribute you can choose path of Start/Programs menu. It’s optional attribute.

4. Remember to set <name> attribute without special chars.
If you try to make it, or you accidentally copy this attribute in the same XML configuration file, it fails with an error.

5. You can’t install AIR applications in a computer if you don’t have system privileges.

I hope that those suggestions could help in your daily development.

Advertisements