Adobe air runtime prevents more than one instance of an air application to be started at the same time. Is it safe to circumvent this restriction by arbitrarily changing the publisher ID? Does anyone know if Adobe plans to allow multiple concurrent instances in Air 2.0?
相关问题
- Should I wait for Flash Player 10.1 or go with Fla
- How to load flex swf from flash?
- Displaying two fullscreen windows on two monitors
- Setting Page Title from a SWF
- Security Sandbox Violation
相关文章
- as3 ByteArray to Hex (binary hex representation)
- getElementById not working in Google Chrome extens
- Libraries for text animation in Flex / Actionscrip
- How to upload BitmapData to a server (ActionScript
- Persistent connections between Flash client and Ja
- How to embed a swf file into html code?
- Web player to use with SHOUTcast
- Flash CS4 + SQLITE
Just made a quick class to implement Tyn's solution. Simply call.
MultipleInstanceAirApp.changeMetaInfId(stage);
You don't really need the stage part, but I use it to change the position of the window when I test. Anyway, enjoy!
Would it help if you encapsulate the logic of your application as a class that could run in a window and allow the user to create multiple instances of that window, within one app ? would that help ?
What is the main reason you would need multiple applications ?
We successful implemented a hack to circumvent this limitation, in a pure AIR way, without having to change the publisher id (which needs multiple certificates, I think).
As you know, AIR is implementing its Mutex by using a unique application identifier. This identifier is calculated using the application id, and the publisher identifier (extracted from the certificate that signed the application).
In the installation directory of an AIR application, there is a META-INF folder (or in /share/ using Linux). This META-INF folder contains an AIR folder, which contains an "application.xml" file. This file contains a
<id />
tag that defines the application identifier, which is used in the calculation of the mutex identifier. If your application can write in the installation folder, you can use theFile
API to edit it at runtime, randomly changing the<id />
tag, allowing multiple processes of the same application to be run at the same time.This is having some annoying side effects, like creating a new folder in the
File.applicationStorageDirectory
folder every time. But using aLocalConnection
, you can minimize this by reusing the same identifier multiple times by logging which ones are free to be reused. Also,SharedObject
are stored in this folder, so cannot be used (or have to be copied every time a new instance is created, and synchronized thoughLocalConnection
).As far as I know, Adobe isn't planning to remove this native limitation. It was implemented for multi-platforming purposes, specifically on MacOS, where the dock is making that more complicated (it's not very easy to start the same application twice with the dock).
The official way to do that is to catch the
InvokeEvent.INVOKE
event, and do stuff like opening a new window. And there's no change planned for AIR 2.0 in this behaviour.Air Application duplicator will help you in this part. Using this you can run multiple instance of same AIR application.
https://github.com/chrisdeely/AirAppDuplicator
Its just simply copying your app directory with new name and new application id.
This will break auto update, be warned.