B4J Question [SOLVED] Non-UI Apps Packaging

Cableguy

Expert
Licensed User
Longtime User
Specifically I want to package an ABM app.
Thanks

I don't quite know if it is possible although I can understand why you would want to package a non UI app, but I don't think that it would be any more easy or even possible to package an ABM app...
ABM apps are not meant to be run on a local (individualized) machine, but rather on a server... Even if it is run in a single machine, it will always be deployed from a webbrowser… So why not just create a script that unzips the project to a user defined folder and create a shortcut?
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
I don't quite know if it is possible although I can understand why you would want to package a non UI app, but I don't think that it would be any more easy or even possible to package an ABM app...
ABM apps are not meant to be run on a local (individualized) machine, but rather on a server... Even if it is run in a single machine, it will always be deployed from a webbrowser… So why not just create a script that unzips the project to a user defined folder and create a shortcut?
Noted, there is an ABM app that I want to make available for users to install on their computers without having to connect to the internet and access a web-server. So without having to go to the java site and install java first etc etc, I'd just like to provide them a single package that will run without the hustles.

Now you say something interesting, create a script to unzip the project. I guess I could find a way to do that. Now the next question is, bundling the java runtime with the app.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I guess you can create a basic launcher in b4J for the ABM app, based in a simple webbrowser window that opens the ABM app directly, and prevents any other usage of it, thus being a UI app, package it! that would take care of the java bundling. plus, make your UI app check if the ABM app is properly available, like through an initial user interface setup...
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Ohk, after some stack-overflowing.. this is what I ended up doing and my ABM app works perfectly without installing java.

1. Create a folder on c drive with my app, e.g. MyApp
2. Copy the Objects folder contents to my c:\MyApp
3. Deleted bin, logs, src folder, this leaves my jar file, copymewithjar.needs, sqlite database folder etc.
4. From this link, downloaded, Launch4bj. I have attached my xml file here for reference.
5. Created the necessary icon for my file, specified the .exe file for launchb4j to be in my c:\MyApp
6. Copied the jre folder from C:\Program Files (x86)\Java\jdk1.8.0_172\ to c:\MyApp

The folder structure for c:\MyApp should be like this (after I compile with launch4j.

BibleShow.png


NB: Open the attached xml file with Launch4j, you can change the path to your jar file, output file and re-compile after copying jre folder (as is)

Then zip the contents of your folder and distribute them. The end user can unzip, double click the .exe file and then open the browser to the port of your ABM, e.g. localhost:51047/bibleshow.

Ta!

PS: what's on the xml file..

Screen 1: Output file, jar file, icon

Screen1.png


Screen 2: bundled path (this is the jre path (in the same folder)), min and max version, Only use private JDK runtimes, first 64 then 32 bit.

Screen2.png


Screen 3: Header type - console (just in case)

Screen3.png


When zipped, the complete file is about some 125MB
 

Attachments

  • BibleShow.xml
    836 bytes · Views: 370
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Nice... not "perfect" from a user view but vey elegant solution...
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I will see if I can end up with an Inno SetUp Install. That should be interesting...
I guess that, if you can "encapsulate" your ABM app inside a B4J UI one, then it should be "easy" to do it...
If only I had the time....
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
I guess that, if you can "encapsulate" your ABM app inside a B4J UI one, then it should be "easy" to do it...
If only I had the time....
Remember @Cableguy , AB does not recommend having an ABM app running inside a webview and a webview might not have all the needed functionalities of an ABM app. I did that with an app on Google Play. The recommendation was to do an ABM Native App.

Yes, I could do something that would launch the jar file using jShell and open the browser (code in an ABM App), but I don't want that. The other issue is the jre that needs to be bundled in this case.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Remember @Cableguy , AB does not recommend having an ABM app running inside a webview and a webview might not have all the needed functionalities of an ABM app.

You are absolutely Right, as usual
 
Upvote 0
Top