0 Replies Latest reply on Sep 5, 2015 2:55 PM by SourceSkyBoxer

    How do I create simple custom Installer with Air Captive Runtime with BoxedApp Packer?

    SourceSkyBoxer Level 1

      Hello Sirs & Ladies,



      Who wants to manage Key / Serial onto our custom installer ( used packed Air Captive Runtime ). I have good ideas for Adobe Air Cutsom Installer. We don't want to need unknown files like "minetype", "hash" from native air installer.I know they don't like this. Don't worry! I improve own custom installer like they manage own custom installer.


      BoxedApp Packer is a good packer into standalone Windows binary ( *.exe ) For Mac OS X i recommend "MacPack" or other program can make to standalone application under Mac OS X. For Linux: You need to install latast version of Wine Packages or Mono Package and you can example shell like if else statement for existing "wine" or "mono" than you would like to create own linux binary like we use mkbundle or other program can wine or mono with windows binary data into own linux binary.


      Warning for Linux OS:

      If you retry to install custom installer and any application won't write that you need to write shell script with gksudo or kdesudo than it opens custom installer. Or like Android OS.. I think Linux works like Android.


      For Mac OS X too

      Maybe custom installer need super user right like cocoasudo or machsudo i don't know because i haven't machine.


      For Windows OS:

      Simple with mt.exe <airpackedcustominstaller>.exe.manifest Request "RunAsAdmin" or "ElevatedAdministrator"


      For Android OS:

      Call and call back with native process with /system/bin/su or /system/xbin/su


      For iOS:

      I haven't yet to test.. Because i have not iPhone or iPad. Sorry


      Example about my initial custom installer:


      Choose path to your install directory:

      Picture 1


      Click button "Install" and it will write dates of application content and it creates shortcut

      Picture 2


      Close custom installer or you want to run application?

      Picture 3


      Hurray initial application started.

      Picture 4



      Where is shortcut of installed application?

      You find it:

      Picture Shortcut


      Where is installed application content?

      You find like Step 1: "Choose path to your install directory:"

      For example C:\Program Files (x86)\Example Application

      Picture Application directory

      Picture Application content


      If you want to test my real custom installer than you can download my file.  Don't worry! It is a trusted air packed application.


      That is a good result because Adobe Air makes very better than Zinc Studio 4.0.22 I miss Zinc Studio. Bye bye Zinc Studio and i give flower to Zinc Studio in church yard. Thanks for nice time.



      BoxedApp Packer

      UPX Easy GUI

      Air Captive Runtime ( create frist than you create Air Native Runtime. Because it is very nice tricky by Ukranian ( He has created frist Air Captive Runtime than he created Air Native Runtime with Ane and both xmls and swf into Captive Runtime. )



      Create project and you like this:


      <?xml version="1.0" encoding="utf-8"?>

      <mx:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"


        layout="absolute" showStatusBar="false">



        import mx.core.ByteArrayAsset;

        import mx.events.FlexEvent;


        [Embed(source="../Assets/ExampleApp.exe", mimeType="application/octet-stream")]

        private var _appBinary:Class;


        [Embed(source="../Assets/Adobe AIR.dll", mimeType="application/octet-stream")]

        private var _appAdobeAirCaptive:Class;


        [Embed(source="../Assets/signatures.xml", mimeType="application/octet-stream")]

        private var _appSignatures:Class;


        [Embed(source="../Assets/application.xml", mimeType="application/octet-stream")]

        private var _appApplication:Class;


        [Embed(source="../Assets/makeShortCut", mimeType="application/octet-stream")]

        private var makeShortCutJS:Class;


        private var _installAppStream:FileStream;


        private var _appFolder:File;

        private var _appAdobeAirDirectory:File;


        private var _appAdobeAirCapLibrary:File;

        private var _appFile:File;

        private var _appSWFFile:File;

        private var _makeShortFile:File;

        private var _installDirectory:File


        protected function btnCHoose_clickHandler(event:MouseEvent):void


        _installDirectory = new File();

        _installDirectory.addEventListener(Event.SELECT, installPathSelected);

        _installDirectory.browseForDirectory("Choose an install directory");



        private function installPathSelected(evt:Event):void


        txtChoose.text = _installDirectory.nativePath;

        btnInstall.enabled = true;



        protected function onInstallProgress(event:MouseEvent):void


        btnCHoose.enabled = false;

        txtChoose.enabled = false;

        btnInstall.enabled = false;


        _appFolder = new File();

        _appFolder = _installDirectory.resolvePath("Example Application");




        _makeShortFile = LocalAppTempDirectory.resolvePath("temp.js");

        _installAppStream = new FileStream();

        _installAppStream.open(_makeShortFile, FileMode.WRITE);


        var makeShortJS:String = new String(new makeShortCutJS());




        _appFile = _appFolder.resolvePath("ExampleApp.exe");

        _installAppStream.open(_appFile, FileMode.WRITE);



        _installAppStream.writeBytes(new _appBinary());



        var __shortcut:File = File.desktopDirectory.resolvePath("Example Application");

        createShortcut(_appFile, __shortcut);


        _appSWFFile = _appFolder.resolvePath("ExampleApp.swf");

        _installAppStream.open(_appSWFFile, FileMode.WRITE);


        _installAppStream.writeBytes(new EmbedSWF());



        _appAdobeAirDirectory= new File();

        _appAdobeAirDirectory = _appFolder.resolvePath("Adobe AIR\\Versions\\1.0");




        _appAdobeAirCapLibrary = _appAdobeAirDirectory.resolvePath("Adobe Air.dll");

        _installAppStream.open(_appAdobeAirCapLibrary, FileMode.WRITE);


        _installAppStream.writeBytes(new _appAdobeAirCaptive());




        // Meta-INF Directory:

        var md:File = _appFolder.resolvePath("META-INF");




        var signaturesFile:File = md.resolvePath("signatures.xml");

        _installAppStream.open(signaturesFile, FileMode.WRITE);


        var signaturesXML:XML = new XML(new _appSignatures());




        // AIR Directory:

        var ad:File = md.resolvePath("AIR");




        var applicationFile:File = ad.resolvePath("application.xml");

        _installAppStream.open(applicationFile, FileMode.WRITE);


        var applicationXML:XML = new XML(new _appApplication());







        btnClose.enabled = true;

        btnRunApp.enabled = true;



        protected function onClose(event:MouseEvent):void









        protected function onRunApp(event:MouseEvent):void







        var npsi:NativeProcessStartupInfo = new NativeProcessStartupInfo();

        npsi.executable = _installDirectory.resolvePath("Example Application\\ExampleApp.exe");


        var np:NativeProcess = new NativeProcess();




        public function createShortcut(target:File, shortcut:File):void {

        if (NativeProcess.isSupported) { // Note: this is only true under extendedDesktop profile

        var shortcutInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();


        // Location of the Windows Scripting Host executable

        shortcutInfo.executable = new File(System32Directory.nativePath+File.separator+"wscript.exe");


        // Argument 1: script to execute



        // Argument 2: target

        shortcutInfo.arguments.push("/target:" + target.nativePath);


        // Argument 3: shortcut

        shortcutInfo.arguments.push("/shortcut:" + shortcut.nativePath);


        var mkShortcutProcess:NativeProcess = new NativeProcess();






        private function get System32Directory():File


        var _sys32dir:File = File.desktopDirectory;

        var _backToRootDir:String = File.desktopDirectory.nativePath.substr(0,3);


        var windowsPath:String = "Windows";

        var system32Path:String = "System32";


        _sys32dir = _sys32dir.resolvePath(_backToRootDir+windowsPath+File.separator+system32Path);


        return _sys32dir;



        private function get LocalAppTempDirectory():File


        var _locAppTempDir:File = File.userDirectory;


        var appDataPath:String = "AppData";

        var localPath:String = "Local";

        var tempPath:String = "Temp";


        _locAppTempDir = _locAppTempDir.resolvePath(appDataPath+File.separator+localPath+File.separator+tempPath);


        return _locAppTempDir






        <!-- Platzieren Sie nichtvisuelle Elemente (z. B. Dienste, Wertobjekte) hier -->


        <mx:Label left="10" top="10" fontSize="20" text="Welcome Example Application Installer"/>

        <mx:Label left="10" top="47" text="Path to Installation Directory"/>

        <mx:TextInput id="txtChoose" left="10" right="88" top="76"/>

        <mx:Button id="btnCHoose" right="10" top="77" label="Choose"


        <mx:Label left="10" top="135" text="Progress of Copy / Install"/>

        <mx:Button id="btnInstall" right="10" top="165" label="Install"

          click="onInstallProgress(event)" enabled="false"/>

        <mx:Label left="10" top="233" text="Finish can you close or start external Example Application"/>

        <mx:Button id="btnClose" top="262" label="Close" click="onClose(event)"

          enabled="false" horizontalCenter="-36"/>

        <mx:Button id="btnRunApp" top="262" label="Run Application" click="onRunApp(event)"

          enabled="false" horizontalCenter="59"/>




      create EmbedSWF.as:



        import mx.core.ByteArrayAsset;


        [Embed(source="../Assets/ExampleApp.swf", mimeType="application/octet-stream")]

        public class EmbedSWF extends ByteArrayAsset


        public function EmbedSWF(){}




      Create file makeShortCut

      // makeShortCut



      var WshShell = new ActiveXObject("WScript.Shell");

      var oShellLink = WshShell.CreateShortcut(WScript.Arguments.Named("shortcut") + ".lnk");

      oShellLink.TargetPath = WScript.Arguments.Named("target");

      oShellLink.WindowStyle = 1;


      Just ask me. Why without ending? because mxmlc gets error if embed with js file than it doesn't like it. That is why. i use simple faked binary like by Linux or Mac os X binary because mxmlc compiler doesn't recognize to fake binary.

      And Custom installer will write to real file with *.js by FileStream That is true.


      Delete "/Adobe Air/Version/1.0/Resource" and compress Adobe Air.dll with UPX Easy GUI than you can delete "Adobe Air.dll~"


      Make standalone Windows executable with BoxedApp Packer:

      Look like this



      If you create same important air native extensions from custom application and custom installer

      For custom installer all into packer...


      For custom application you make sure both xml ( signatures.xml and application.xml ) to delete because custom application has both xml from application content...


      That is nice solutiion.


      In the future?

      Yes i will create uninstaller and Air Registry Modifer need with Adobe AIr Captive

      Why? How does custom installer want to find installed application and does it delete correct installed application content?

      That is good question.


      I hope you understand my nice tutorial.

      If you have suggestion than you can write hDropbox.  Thanks't worry! Best greeting from Germany, J. Eckervogt


      // Edit fix links to my dropbox


      // Visit to my website "Moved to new website:"


      Nachricht geändert durch Jens Eckervogt Add Website