B4J Tutorial UI apps packaging - self contained installers

Discussion in 'B4J Tutorials' started by Erel, Aug 2, 2015.

Thread Status:
Not open for further replies.
  1. miga

    miga Member Licensed User

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

    Erel Administrator Staff Member Licensed User

    No. You can only create it on a Mac computer.
     
  3. Cableguy

    Cableguy Expert Licensed 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?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You can put the other jar in the Files folder. You will need to copy it at runtime on the first run.

    No.
     
  5. Nokia

    Nokia Active Member Licensed 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?
     
  6. Erel

    Erel Administrator Staff Member Licensed 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
     
  7. aaronk

    aaronk Well-Known Member Licensed 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.

    upload_2016-10-27_16-48-28.png
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    The packager works with UI applications. Is this a ui application?
     
  9. aaronk

    aaronk Well-Known Member Licensed User

  10. Nokia

    Nokia Active Member Licensed User

    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?
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Were there any messages in the logs (you can run it with B4J-Bridge or from the command line)?
     
  12. alienhunter

    alienhunter Active Member Licensed 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
    pack.jpg


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


    Code:
    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: Nov 9, 2016
  13. Erel

    Erel Administrator Staff Member Licensed User

    What is the value of txtJar.Text ?
     
  14. alienhunter

    alienhunter Active Member Licensed User

    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
     
  15. alienhunter

    alienhunter Active Member Licensed User

    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: Nov 10, 2016
  16. Erel

    Erel Administrator Staff Member Licensed User

  17. alienhunter

    alienhunter Active Member Licensed User

    the jar is 30 MB+ where the error comes up , i will try to setup something so you can get this file
    strange thing small projects work
     
  18. Erel

    Erel Administrator Staff Member Licensed 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:
    Code:
    '     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 likes this.
  19. alienhunter

    alienhunter Active Member Licensed 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
     
  20. Toley

    Toley Active Member Licensed User

    I need to make a package including external driver too. Is this tool can do it?
     
Thread Status:
Not open for further replies.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice