B4J Tutorial B4JPackager11 - the simplest way to distribute UI apps

Status
Not open for further replies.

tuhatinhvn

Active Member
Licensed User
Longtime User
i have some files on folder File.DirApp , when use this packager where is these file should be copied?
 

jmon

Well-Known Member
Licensed User
Longtime User
It works great. I suggest adding an option to add additional files. This way the installer can include other files and subdirectories. The simplest is to have 1 folder that will include all the files that need to be copied to the application directory.
In Process_Globals:
B4X:
Sub Process_Globals
    '...
    Private AdditionalFolder As String = "C:\AdditionalFolder\"
    'non configurable variables:
    '...
End Sub

In Start (I commented the existing lines):
B4X:
Sub Start
    '...
    'Wait For (BuildRunner) Complete (Success As Boolean)
    Wait For (CopyAdditionalFolder) Complete (Success As Boolean)
    'Wait For (OpenExplorer) Complete (Success As Boolean)
    '...
End Sub

And then adding those 2 functions:
B4X:
Private Sub CopyAdditionalFolder As ResumableSub
    If AdditionalFolder <> "" Then
        CopyFolder(AdditionalFolder, File.Combine(TempFolder, "\build"))
    End If
    Return True
End Sub

Private Sub CopyFolder(Source As String, targetFolder As String)
    If File.Exists(targetFolder, "") = False Then File.MakeDir(targetFolder, "")
    For Each f As String In File.ListFiles(Source)
        If File.IsDirectory(Source, f) Then
            CopyFolder(File.Combine(Source, f), File.Combine(targetFolder, f))
            Continue
        End If
        File.Copy(Source, f, targetFolder, f)
    Next
End Sub

The InnoSetup file doesn't need to be modified, as it's already including the recusrsivesubdirs flag:
B4X:
[Files]
Source: build\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
 

Woinowski

Active Member
Licensed User
Longtime User
Hello Erel, is there any news on the improved startup executable? (no terminal window)

Hi Erel,

my bash is a little rusty (not having used it for nearly 20 years), but I have a rough idea to solve this "get rid of window" with this bash line

B4X:
exit & \bin\java -jar foo.jar

"\bin\java -jar foo.jar" stands for whatever you need to start the jar file. Basic idea is to fork the jar execution and then exit the shell. If this does not work, than at least the fork direction might help.
 

Mmilo1971

Member
Hello,
I am using B4JPackager11 and in the log window I can see:

...
Waiting for debugger to connect ....
Program started.
B4JPackager11 Version 1.13
InputJar: C:\\Users......\Graduatoria.jar (my file)
Running: C:\\Users\User\Desktop\B4JPAC-1\Objects\temp\FindDos.Path.exe
Folder not found:


and after the program stop.

Where I am wrong?
Thank you
Massimiliano
 

Mmilo1971

Member
I did right click and choose the menu item "toggle brekpoint", in debug mode it stops and the line become Yellow and in the log window I see the messages above except the "Folder not found". Going on the error is the same.

I added:
B4X:
Log (JavafxJmods)
Log (JavaFXLibs)

And
JavafxJmods seems to be void ...it doesn't return anything
JavaFXLibs return C:\Program Files\Java\jdk-11.0.4\bin\..\javafx\lib

Thank you
 
Last edited:

Mmilo1971

Member


Yeaaaahhh … YOU WAS RIGHT …… my fault was downloading Java from the official website.

PS: I discovered B4X searching a software to develop Android App …. so after some practice where I would translate some Python programs I wrote for my wife … I will for sure buy B4A …. I already have bought the BIG Book .. next step will be the software.

Thank you again for your help.
Massimiliano
 

Carlos marin

Active Member
Licensed User
Longtime User
Erel I'm getting this error on line 130

Running: C:\Users\CARLOS~1\Desktop\B4JPAC~1\Objects\temp\FindDosPath.exe
Folder not found:
 

MrKim

Well-Known Member
Licensed User
Longtime User
This tool is designed for Java 11+. You should use the previous B4JPackager tool for older versions of Java.
I am confused. I open the Java Control panel and it says I am Java Version 8 Update 231 (build 1.8.0_231-b11) and am up to date. Where is 11?
Also, What is OpenJDK 11 and how do I find out if it is installed and what version it is? I found some info online that said type javac -version. that returns javac 1.8.0_131. But that does not seem right.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…