AIR file too big, breaks during installation - actionscript-3

A client is having me convert an HTML5 video web application that I've already built into an AIR app.
The end users are going to need this to work with no internet access, so I MUST include a LOT of video files with the installer. This works fine on my machine, but my client can't install it because the .air file is too large and they don't have enough RAM. We'll need this installed on a number of laptops that aren't super powerful.
My SDK is up to date and we're using AIR 3.1.
Has anyone else run into a similar situation? Is there any workaround? For instance could I either include both the installer and the .air in a zipped folder, then have the installer move the video files to the appropriate location, or use AS to have the installer download the files (they will have internet access when installing).

I'd recommend you not to include heavy video files into your application. Downloading assets from web is a descent idea, I use same technique for several museum touchscreen apps.
So here's workflow: on startup app tries to connect to "assets server" and request list of files to download. It can be list of all the files, or list of files that have been updated/added since timestamp that you pass with your request. Then you download them to File.applicationStorageDirectory. Not to have mess in that directory I put all of them to "cache" subdirectory.
In case there's no internet connection for some reason when you install that app, you can have all that "cache" folder on your memory-stick/externalHD so you can manually perform that downloading process.
If you use Greensock's LoaderMax: I've written a simple URLStreamLoader that extends LoaderItem, handy for downloading files. Can share that.

The problem is quite obvious: the Adobe AIR provided installer for deploying your application is lacking.
However, Adobe recently released a new feature for deploying Adobe AIR apps: "runtime captive bundle" (Windows or OSX).
Which means 2 important things:
You receive an .exe which no longer requires an user to have Adobe AIR runtime installed (and no more incompatibilities when targeting multiple Adobe AIR runtimes).
You are no longer provided with an installer, and you have to find your own (which solves your problem halfway).
Target bundle when "compiling", and then just use a better installer (Windows or OSX) - think you are just deploying a normal application (worked for me:) ). There are too many installers arround to mention.
Your installer of choice + bundle compiling, together solve your offline installation requirement and the memory exhausting issue.
Packaging a captive runtime bundle for desktop computers

Related

Unity3D cannot open Assets from Web page

I have installed Unity3D 5.1.0f3 Personal on Ubuntu. I have not installed Wine for Ubuntu.
When I tried to open link: Open in Unity, on the page https://www.assetstore.unity3d.com/en/#!/content/25794. I've got error:
The address wasn't understood
Firefox doesn't know how to open this address, because one of the
following protocols (com.unity3d.kharma) isn't associated with any
program or is not allowed in this context.
You might need to install other software to open this address.
Can someone help me to resolve the problem. My browsers are Firefox and Chrome.
Thank you!
You can open a project (new if necessary) and import the asset using the Unity editor.
Unity3D is beta in Linux, does not work the schema to store.
I was having the same issue, but you should be able to get around this by opening the Asset Store in the Unity editor and downloading the asset from there
1.5 years later. I'm using Unity on Linux as well. The protocol is still not understood, but there's no Asset Store in Unity itself either (Window ยป Asset Store button does nothing). Unity will not recognise that here's a Unity Hub installed, even though it was installed by Unity Hub, and the My Assets window therefore only ever shows an error. It seems there's no way to get Assets into Unity on Linux.
If you are using a newer version of Unity, you can click Add to My assets on Browser Asset Store then install them via the Package Manager.
Open a New or Existing Project -> Window -> Package Manager, then by selecting "My Assets" in the source drop down will show all assets that you have added on the browser.

How to bundle jre with .exe file created from .jar

I created .exe file from .jar file .Now my client demands to run the application without installing jre in the sytem.I have heard that with bundled jre it is possible ...but i dont know how to bundle jre with .exe file..
The JavaFX is working on this. Here are the up-coming features in Java SE 7 u10:
https://blogs.oracle.com/talkingjavadeployment/entry/packaging_improvements_in_jdk_7#3
https://blogs.oracle.com/talkingjavadeployment/entry/packaging_improvements_in_jdk_7
I have used VMware ThinApp to do exactly what you are trying to do. It does cost money, but works extremely well. It allows you to roll up all the dependencies your application uses into a single executable that can then run on vanilla installations of Windows. It can be used for a lot more than just Java, and it does so by recording the changes you make to a system after installing your application + the JRE for example, and then wraps up all of those changes. It certainly simplifies application deployment, since the applications are now portable. I've even used it to roll up Visual C++ redistributables, and .NET as well. This certainly increases the size of the executable, but it's also convenient knowing the application will run successfully. See more info at http://www.vmware.com/products/thinapp/overview.html.
The open source Launch4j allows you to produce an exe with an embedded JRE. This SO article also discusses this topic. Caveat: I've had very good success with Launch4j, but never used the embedded JRE feature.

How to create updater for AIR application bundled with captive runtime?

What would be the logic of updating mechanism for AIR application with captive runtime?
Application should be distributed for Windows and Mac.
I got stuck here:
Note that this does not necessarily mean that you need to implement your own auto-update mechanism. If you use a commercial tool to create your installer, it may include auto-update mechanisms that you can leverage. On the other hand, if you do need to write your own update mechanism, you should find the URLStream, File, and NativeProcess APIs handy in implementation.
after reading it at: http://www.adobe.com/devnet/air/articles/air3-install-and-deployment-options.html
Is it something like (for Windows, after app is installed with some .exe or .msi installer):
upon starting app, check for new version
if there is new version, download it
overwrite existing app files and AIR runtime files
It should be forced update, before starting app.
How to overwrite running app? Or to make another app (updater) for replacing files, and after that start main app with NativeProcess?
For Windows I use the Native Application Updater
http://code.google.com/p/nativeapplicationupdater/
and WinRAR SFX archive (.exe) to auto update my captive runtime apps.
Native Application Updater will check the version, download your new exe, close your app and run that new exe.
In the SFX options:
I use absolute path, something like: %USERPROFILE%\AppData\Local\com\thenewkid\appname\
Under "Modes" you can select "Hide All" in Silent Mode. Under "Setup" you get it to run your application.exe after extraction.
You can keep the update size low by removing the Adobe AIR folder until a new version of the SDK becomes available (i.e. just had to push a larger update out recently for 3.3)
For MAC I use Installer. It isn't as silent as the Windows Updater as the user will have to click through a couple installer prompts but it allows you to put it in their home directory so administrative privileged aren't required which is what I find the most useful aspect of captive runtime.
Basically, you should have your app point to some XML file on your server which will contain things like newest version number, path to new files on server etc.
You can use a separate app to do the restart but keep in mind that since you are using Captive Runtime this will mean another 40-60MB just for the updater (unless you use some non-recommended hacks).
It would probably be better to just prompt the user to restart after you download the update.
The trick is not to overwrite the EXE but instead to overwrite the SWF (and any other files that need updating). From what I can tell, the EXE is simply a pointer to the XML manifest and the SWF.
You should not be updating AIR runtimes file every time - only for critical updates (since they are large files).
For the restarting of AIR in captive runtime this works for me on Mac (have not checked for Windows yet) (Note: UpdateAutoTest was the name of my app):
var appLauncher:File;
appLauncher = new File(File.applicationDirectory.nativePath).parent.parent.resolvePath("Contents").resolvePath("MacOS").resolvePath("AutoUpdateTest");
var npInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo;
npInfo.executable = appLauncher;
var _args:Vector.<String> = new Vector.<String>;
//_args.push("-a");
//_args.push();
npInfo.arguments = _args;
var np:NativeProcess = new NativeProcess;
np.addEventListener(NativeProcessExitEvent.EXIT, npExitHandler);
np.start(npInfo);
exit();
There is no need to overwrite. Have the user download your new package and launch it. AIR will know that package is already installed as a previous version and will prompt the user if he wants to update.
So the workflow is : check if there is a newer package, alert the user there is one, have him download and launch it. Air will manage the updating.

JavaFx 2 applicaton does not run when i run it through HTML page

I have downloaded the javafx 2 samples and want to run in from its HMTL. For example there is one javafx application called BrickBreaker. For the specific sample the following files exist : BrickBreaker.jar, BrickBreaker.jnlp and BrickBreaker.html
When double clicking on jar or jnlp the application runs as expected but when i click on the html the application does not run. Instead i get the message "View the conectes of the page. Please install javaFX"
Why is that happening ? ( i have the javafx installed as the application runs when choosing the jar and jnlp files). My guess is that the html should be called from within the context of a webserver meaning that i should deploy my application first to a server and call the url from my explorer. For example if using glassfish i should call the url http://localhost:8080/Brickbraker
The problem is that i don't know how to deploy the javafx application in the server.
i tried to copy paste all the above three files in the autodeploy folder but it didnt worked...
Could you please help me?
Thanks in advance
EDIT: some more info - I have installed JDK 7 and JavaFX SDK 2.0.2
No, JavaFX is client technology, you don't need Glassfish to run it. JavaFX should run in browser the same way as Java plugins do.
If you can't run an application directly from html file it means your browser doesn't recognize you have runtime installed.
There can be next reasons for that:
JavaFX runtime is actually not installed (check in Windows Control Panel)
pure java plugin is not installed (you can check on java.com)
javafx runtime is 32bit and you are using 64bit browser (or vice versa)
you are using not supported browser (e.g. Safari)
you are using not supported system (at this moment, January 2012, only Windows supports runtime)

Run AIR app without AIR runtime files

I've made an AIR app with Flash Builder 4. Works great but I want to run the app without installing it. So..... when I install the app, I copy the files from program files and paste it on a CD and give it to somebody. He runs it on another computer without AIR runtime with as result that it doesn't work.
How can I bypass this? Like some launcher/setup that installs AIR runtime for the client if it aint installed. If it is installed, run the AIR app.
Thanks.
Creating an AIR Badge would be a good option.
The idea is you pass a link to the client, the AIR Badge check if
AIR is installed. If it is, installs your app, otherwise installs AIR
first.
There's a pretty good AIR Badger tutorial on the Adobe Developer Connection site. AIR Badger is an AIR App Grant Skinner wrote to make the setup easier.
Also check out the new AIR Launchpad, which is another AIR app that helps you get started with all sort of AIR related functions, including install badge.
Unfortunately the AIR Badger works online.
You cannot bypass AIR install. Maybe have a third party utility(batch script/etc.) that looks for air related files/.air filetype associations and based on that launches an AIR installer you supply on CD or the app itself.
On osx you have the mdls command that displays information about a file. You could check for kMDItemKind:
mdls -name kMDItemKind /path/to/yourApp.air
If it prints "com.adobe.air.InstallerPackage", then air should be installed, otherwise it will just print "Document".
There should be something similar for windows command prompt that checks registry file type associations.
After you've done that check, install AIR first or just the app, depending on the result.
HTH