B4J Tutorial UI apps packaging - self contained installers

Status
Not open for further replies.

miga

Member
Licensed User
Longtime User
May I create Mac installer (dmg) on Windows? I have done my application and want to distribute it in both formats.
 

Cableguy

Expert
Licensed User
Longtime User
I have a multi .jar file app... basically a main app, and a config app... is it possible to combine both the jar into the same installer?
is it possible to have a "run after install" option during install?
 

Nokia

Active Member
Licensed User
Longtime User
do you have to have the inno setup on the mac osx machine or just he JDK?

will the bundles folder be in the same folder as the Jar file?
 

aaronk

Well-Known Member
Licensed User
Longtime User
When I try and create the installer I get it coming up saying 'Error Parsing Manifest file.'

I installed innosetup-5.5.9 on my computer.

Running this on windows 10 on a VM on a Mac. (same computer I am using B4J on)

Any ideas on what could cause this to happen ?

When I run my server.jar file it runs fine, just can't create the installer file.

 

Nokia

Active Member
Licensed User
Longtime User
You don't need inno setup on the Mac.

You can see an example of a dmg package here: www.b4x.com/b4j/files/GoogleMapsExample.dmg

when I run the B4JPackager both your original and my modified, they do not produce a bundle. it just opens up a window with my app and a folder for applications.

on your original it seems to close and tries to open up again. but can't and the first time it opened it ask me if I wanted to install xcode. do you know if I need anything else to install?
 

alienhunter

Active Member
Licensed User
Longtime User
Hi
I get this error , it worked i in earlier java 1.80.60 , now 101
any clue why
thanks

(IOException) java.io.IOException: java.lang.IllegalArgumentException: MALFORMED



I narrowed it down to archiver , it does not unzip the manifest for some reason


B4X:
        Dim archiver As Archiver
        If archiver.UnZipFiles(txtJar.Text,"",workingFolder, Array As String("META-INF/MANIFEST.MF"), "") <> 1 Then
            cutils.ShowNotification2("", "Manifest file not found. Make sure that the jar file was compiled in release mode.", _
                cutils.ICON_ERROR, MainForm)
            Return
        End If
 
Last edited:

alienhunter

Active Member
Licensed User
Longtime User
What is the value of txtJar.Text ?

I did not checked this will check , I downloaded your example again yesterday
and it was the same error , but if i unzip the jar and place the meta folder in place it works
i did not noticed this unitl i updated the jdk/jre from 60 to 101
 

alienhunter

Active Member
Licensed User
Longtime User
What is the value of txtJar.Text ?
Program started.

hi here it is
txtJar.Text=
C:\MASTER ROOT\001-JAVA-WINDOWS_DEVELOPMENT\001-JAVA-SOURCECODES\001-JAVA-SUITE\JAVA_MANAGMENT-001_VERSION_1_006\Objects\xxxxx_app_suite.jar
(IOException) java.io.IOException: java.lang.IllegalArgumentException: MALFORMED



Did not worked even if i shortened the path, only if i disabled the archiver and copy
meta- inf manually

settings.txt
#Wed Nov 09 15:13:05 EST 2016
version=1.000
name=Chloe
icon=C\:\\Windows\\Folder.ico
packager=C\:\\Program Files (x86)\\Java\\jdk1.8.0_101\\bin\\javapackager.exe
jar=C\:\\MASTER ROOT\\JAVA_MANAGMENT-001_VERSION_1_005\\Objects\\xxxxx_app_suite.jar
title=Chole
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
As you found out it fails to unzip the jar file for some reason.

The truth is that this step is not very important. You can explicitly set appClass and comment the problematic code:
B4X:
'     Dim archiver As Archiver
'     If archiver.UnZipFiles(txtJar.Text, "",workingFolder, Array As String("META-INF/MANIFEST.MF"), "") <> 1 Then
'       cutils.ShowNotification2("", "Manifest file not found. Make sure that the jar file was compiled in release mode.", _
'         cutils.ICON_ERROR, MainForm)
'       Return
'     End If
'     Dim manifest As String = File.ReadString(workingFolder, "META-INF/MANIFEST.MF")
'     Dim m As Matcher = Regex.Matcher2("JavaFX-Application-Class:\s*(.*)$", Regex.MULTILINE, manifest)
'     Dim appClass As String
'     If m.Find Then
'       appClass = m.Group(1)
'     Else
'       cutils.ShowNotification2("", "Error parsing manifest file.", _
'         cutils.ICON_ERROR, MainForm)
'       Return
'     End If
     Dim appClass As String= "chloe.integrity.main"

I tested it and it works. Note that you need to make some changes in your code and use File.DirData instead of File.DirApp which is read-only once your app is installed under Program Files (for further discussion please start a new thread).
 

alienhunter

Active Member
Licensed User
Longtime User
Hi Erel
thank you for your time and advice , still work in progress some of the modules i will take your advice and correct this
AH
 

Toley

Active Member
Licensed User
Longtime User
I need to make a package including external driver too. Is this tool can do it?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…