启动Adobe AIR应用程序多次 [英] starting an Adobe AIR application multiple times

查看:158
本文介绍了启动Adobe AIR应用程序多次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Adob​​e AIR运行时prevents多个实例。它是安全通过任意改变的发布者ID绕过这个限制?有谁知道Adobe计划允许在空气中2.0的多个并发实例?

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?

推荐答案

我们成功地实现了一个黑客绕过这个限制,在一个纯净的空气的方式,而不必更改发行商ID(这需要多个证书,我认为)。

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).

正如你所知道,空气是通过使用一个唯一的应用标识符实施其互斥。该标识符是使用应用程序ID,并且发布者标识符(从签发应用证书中提取)计算

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).

在AIR应用程序的安装目录下,有(或/股/使用Linux)一个META-INF文件夹。这META-INF文件夹中包含的AIR文件夹,其中包含一个的application.xml文件。此文件包含一个< ID /> 标签,它定义了应用程序标识符,它采用的是互斥标识符的计算。如果您的应用程序可以在安装文件夹的写,你可以使用文件 API在运行时对其进行编辑,随意修改< ID /> 标记,允许同一应用程序的多个进程同时运行。

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 the File 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.

这是有一些讨厌的副作用,如创建在 File.applicationStorageDirectory 文件夹,每次一个新的文件夹。但是,使用的LocalConnection ,可通过重复使用同一标识多次通过记录哪些是免费的可以重复使用减少这种。此外,共享对象存储在此文件夹中,因此无法使用(或在每次创建新实例时,被复制,尽管的LocalConnection同步)。

This is having some annoying side effects, like creating a new folder in the File.applicationStorageDirectory folder every time. But using a LocalConnection, 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 though LocalConnection).

据我所知,Adobe公司不打算删除此本地限制。它为多平台化的目的实施,特别是在MacOS,这里的码头正在这更复杂(这不是很容易与坞启动同一应用程序的两倍)。

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).

该负责人的方式来做到这一点是赶上了 InvokeEvent.INVOKE 事件,做的东西像打开一个新的窗口。而且也没有改变这种行为计划AIR 2.0。

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.

这篇关于启动Adobe AIR应用程序多次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆