Posts filed in AIR


[AIR]AIRのFile.applicationStorageDirectory

AIRで「File.applicationStorageDirectory」の保存場所をメモ。

 

Mac OS X:
Macintosh HD/Users/[ユーザー]/Library/Preferences/[AIRアプリID]/Local Store/

Windows XP:
C:¥Documents and Settings¥[ユーザー]¥Application Data¥[AIRアプリID]¥Local Store¥

※[AIRアプリID]部分はapp.xmlで設定する「appId」で指定した文字列。

 

例えば、以下のコードの場合、

//file
var aFile:File=File.applicationStorageDirectory;
aFile = aFile.resolve("StorageTest/test.txt");
//stream
var aStream:FileStream=new FileStream();
aStream.open(aFile,FileMode.WRITE);
aStream.writeUTFBytes("StorageTest");
aStream.close();

「test.txt」が作られる場所は、
「[AIRアプリID]/Local Store/StorageTest/test.txt」となる。

そして、AIRアプリのインストーラーの「More Options」からアンインストールしても、データはそのまま残っている。Windowsで「プログラムの追加と削除」からでも残っている。

 

ついでに「File.applicationResourceDirectory」の場合は、
開発中は「bin」の中にあって、AIRとしてインストールされると、

Mac OS X:
([ユーザー]/Applicationsとかの)AIRアプリケーションを右クリックして「パッケージの内容を表示」→ Contents/Resourcesの中。

Windows XP:
C:¥Documents and Settings¥[ユーザー]¥Local Settings¥Application Data¥[AIRアプリ名]の中。
(「File.applicationStorageDirectory」と違ってLocal Settingsの中)

こちらは当然ながらアンインストールで消去される。

 

Related posts

[AIR]Adobe Air Betaへのアップグレード

MacでApolloからAirへのランタイムをアップグレードするのに、小1時間ばかりはまってしまった。
原因はただゴミ箱を空にしなかったから・・・

 

Apolloのランタイムをアンインストールすることは知っていたけど、MacでApolloのアンインストールが分からなかったので、取りあえずリリースノートも読まずにApollo alphaのランタイムを入れたままAirランタイムのインストーラを起動してみました。

そしたらインストーラが「/Library/Frameworks/Adobe Apollo.framework」を消してねって言うので、そのままゴミ箱に入れて、再びインストールを開始したら無事インストール完了。

 

で、Airのサンプル見るかー!と.airをダブルクリックするも、インストーラが動かない。何回やってもエラーダイアログばかり。いろいろやっているうちに「.air」がゴミ箱の中のapollo.appにひもづいたままだったので、もしやと思ってゴミ箱を空にしたら動いたー!

 

で、リリースノートを今になって見てみたら、きちんと書いてありました。

Air betaのアンインストールも書いてあるのでメモしとこう

AIR:Release Notes - Adobe Labs「Upgrading to Beta 1」

Before installing Adobe AIR Beta 1, please uninstall any previous versions of the runtime:

To uninstall the runtime on Windows:

  1. In the Windows Start menu, select Settings > Control Panel.
  2. Select the Add or Remove Programs control panel.
  3. Select “Adobe Apollo 1.0 Alpha1” to uninstall the Apollo runtime.
  4. Click the Change/Remove button.

To uninstall the runtime on Macintosh:

  1. Delete the /Library/Frameworks/Adobe Apollo.framework directory.
  2. Delete the /Library/Receipts/Adobe Apollo.pkg file.
  3. Empty the Trash.

Once you have installed Adobe AIR Beta 1, there is a new added application to uninstall the runtime on the Macintosh:

  • Double-Click the “Adobe AIR Uninstaller” from your <User>/Applications directory.

On Windows, users should continue to uninstall via Add/Remove Programs.

 

Airからインストール先がユーザーのLibraryになっているんですね。またアンインストーラも用意されたのですね。

それなら次は安心だ。

 

Related posts