我在Flex 4.6 AIR应用程序中工作。当我点击它时有一个按钮,它从服务器下载新版本的应用程序,并在我的系统中安装了AdobeAIRInstaller版本3.8(Windows和MAC)时自动安装它。
当我将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());
}
请有人告诉我为什么这样做。
答案 0 :(得分:0)
刚刚继续更新最新版本的Adobe Air(&gt; = 3.9.0.1210)正在修复Mac OS X中的ApplicationUpdaterUI()问题。