Dears,
I have noticed error 16828 when I tried to update AIR application.
Steps to reproduce (AIR 2.5.1):
1. Prepare AIR
2. Prepare Native windows installer (*.exe)
3. Install application from native windows installer
4. Run application updater
5. Download new application air file and start install
6. You will get 16828 error.
Does anybody know how to solve this problem?
I know (too late) that updating native application with build-in updater (air.update.ApplicationUpdaterUI) is not possible and I have to use NativeApplicationUpdater library.
Unfortunately we have many users with installed Windows native application with buggy updater class. Each time when they tried to update they will get this an error with so misleading error description.
thanks in advance
Adam
Hi Adam,
Have you gotten any help with this yet? Error 16828 comes out to be "Cannot update application, usually because the application is running in the AIR Debug Launcher (ADL)." So, it sounds like your app is still running. Would it be possible to exit the app as soon as the update process is started?
Chris
I am also running into this problem.
I found the following statement in the AS3 Reference materials. "The AIR update framework is only supported in the desktop profile. It is not supported for extended desktop applications (applications installed with a native installer), and it is not supported on the mobile profile (iPhone applications written with ActionScript 3.0). Check the Updater.isSupported property at runtime to see if the update framework is supported."
Does this mean that it is not possible to automatically update from within an air application installed from a flash compiled exe?
Thanks,
Brad
Hi Brad,
The built in AIR Updater Framework does not have support for native applications (built using native installers and the extended desktop profile.) However, should be able to implement this functionality yourself by either using the separate NativeApplicationUpdater API built by Piotr Walczyszyn or having your app determine when an update is available, download then launch the installer using the native process api.
I'd also like to recommend checking out and voting for the feature request for this issue on our ideas.adobe.com site.
Thanks,
Chris
Hi, Brad
I was able to run .exe renewal in accordance with "extendedDesktop"
The principle of the following
<Code>
airFile = File.applicationStorageDirectory.resolvePath(folderUpdate + '/updateCode.exe');
private function StartUpdate () : void {
...
var npsi : NativeProcessStartupInfo = new NativeProcessStartupInfo();
npsi.executable = airFile;
var nativeProcess : NativeProcess = new NativeProcess();
nativeProcess.start(npsi);
Reboot.CloseApp();
...
}
Close Apllication function
public static function CloseApp () : void {
var mgr:ProductManager = new ProductManager("airappinstaller");
NativeApplication.nativeApplication.exit();
}
</Code>
Run .exe through the console and close the application. If you do not close the updates will not start because of the running application.
Everything works, but for me the way the data is not suitable.
Another disadvantage is that the way to run an application can only Windows.
Assuming we're talking about updating a native installer AIR app, please see this ADC doc for more details:
Updating Adobe AIR applications packaged with a native installer
Hi Chris,
Thanks for the link. I’m working in Flash Professional, and as far as I can tell the SWC developed by Piotr Walczyszyn is incompatible. I started reading about using flex compiled SWCs in Flash and didn’t reach a conclusion one way or the other (there were varying opinions on the subject) but it seems it might be easier to download the executable and launch the installer per Brad’s comment. I don’t need to worry about version control as that is being handled on the server side—I’m being passed a code when an update is available.
I’m curious to hear your thoughts re the SWC.
Best,
C.S.
Hi C.S.,
I hate to admit it, but I'm not very familiar with Flash Professional. I've done all my work using Flash Builder. I'd recommend posting over on the Flash Pro boards to see if anyone can confirm the swc issue.
Chris
Hi,
Using some of Voksel's code above. I got an updater working. For my app, I'm passed the parameter that tells the application when there is an update so I'm not doing anything with that but the rest is working. If someone wants the sample files, I'll make them available.
import flash.events.Event;
import fl.events.ComponentEvent;
import fl.controls.ComboBox;
import fl.data.DataProvider;
import flash.desktop.NativeProcess;
var fileName:String = fileName = "AIR_updater.exe"
var urlString:String;
var urlReq:URLRequest;
var urlStream:URLStream;
var fileData:ByteArray = new ByteArray();
/////**************************************** GET VERSION ********************************************
/////***************************************************************** ********************************
var appVersion:String;
getAppVersion()
function getAppVersion():void {
var appXml:XML = NativeApplication.nativeApplication.applicationDescriptor;
var ns:Namespace = appXml.namespace();
appVersion = appXml.ns::version[0];
version_tf.text = appVersion
}
urlString = "http://someAddress.com/SomeDirectory/AIR_updater.exe";
path_tf.text = urlString
downLoad_btn.addEventListener(MouseEvent.CLICK, downloadFile)
function downloadFile(evt:Event):void {
downLoad_btn.visible = false
urlReq = new URLRequest(urlString);
urlStream = new URLStream();
urlStream.addEventListener(Event.COMPLETE, loaded);
urlStream.load(urlReq);
}
function loaded(event:Event):void {
urlStream.readBytes(fileData, 0, urlStream.bytesAvailable);
writeAirFile();
}
function writeAirFile():void {
var file:File = File.applicationStorageDirectory.resolvePath(fileName);
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
fileStream.writeBytes(fileData, 0, fileData.length);
fileStream.close();
path_tf.text = "The file is written.";
StartUpdate();
}
var airFile:File = File.applicationStorageDirectory.resolvePath(fileName);
function StartUpdate () : void {
var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();
npsi.executable = airFile;
var nativeProcess:NativeProcess = new NativeProcess();
nativeProcess.start(npsi);
path_tf.text = "startingUpdate. Closing application";
CloseApp();
}
/////Close Apllication function
function CloseApp () : void {
var mgr:ProductManager = new ProductManager("airappinstaller");
NativeApplication.nativeApplication.exit();
}
North America
Europe, Middle East and Africa
Asia Pacific