我正在使用 Flex 4.6 AIR 应用程序。当我点击它时有一个按钮,它会从服务器下载新版本的应用程序,并在我的系统(Windows 和 MAC)中已经安装 AdobeAIRInstaller 3.8 版时自动安装它。
当我将 Adobe AIR 版本从 3.8 更新到 3.9 时。安装过程在 windows pc 中运行良好,但在 mac 中,当我单击更新时,它会从服务器下载应用程序,但不会自动安装。
我的 XML 文件代码是
<?xml version="1.0" encoding="utf-8"?>
<update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
<versionNumber>1.2.9</versionNumber>
<url>File Path URL</url>
<description><![CDATA[
1. Test swf file secure.
]]></description>
</update>
更新代码如下
protected function btnUpdate_clickHandler(event:MouseEvent):void
{
NativeApplication.nativeApplication.addEventListener( Event.EXITING,
function(e:Event):void
{
var opened:Array = NativeApplication.nativeApplication.openedWindows;
for (var i:int = 0; i < opened.length; i ++)
{
opened[i].close();
}
});
appUpdater = new ApplicationUpdaterUI();
// Configuration stuff - see update framework docs for more details
appUpdater.updateURL = modellocator.appUpdateURL; // Server-side XML file describing update
appUpdater.isCheckForUpdateVisible = false; // We won't ask permission to check for an update
appUpdater.addEventListener(UpdateEvent.INITIALIZED, onUpdate); // Once initialized, run onUpdate
appUpdater.addEventListener(StatusUpdateErrorEvent.UPDATE_ERROR, onStatusUpdateError);
appUpdater.addEventListener(StatusUpdateEvent.UPDATE_STATUS, onStatusUpdate);
appUpdater.addEventListener(ErrorEvent.ERROR, onError); // If something goes wrong, run onError
appUpdater.initialize(); // Initialize the update framework
}
private function onStatusUpdate(event:StatusUpdateEvent):void
{
trace("Update Status");
}
private function onUpdate(event:UpdateEvent):void
{
appUpdater.checkNow(); // Go check for an update now
}
private function onStatusUpdateError(evt:StatusUpdateErrorEvent):void
{
showAlertMessage(resourceManager.getString('languages','msgInternetNotConnected'), "", "", 286, 142);
modellocator.timerClosePop = new Timer(5000);
modellocator.timerClosePop.addEventListener(TimerEvent.TIMER, removeErrorMessage);
modellocator.timerClosePop.start();
}
private function removeErrorMessage(event:TimerEvent):void
{
PopUpManager.removePopUp(messageAlertPopup);
modellocator.timerClosePop.stop();
}
private function onError(event:ErrorEvent):void
{
trace(event.toString());
}
请任何人告诉我为什么会这样。