Wish Cleaner Executables

MrKim

Well-Known Member
Licensed User
Longtime User
Currently 'Build Standalone Package' generates a huge package that is good only for that program. It would be really helpful if it was possible to build multiple executables that could reuse the portions of the package that are reusable?
It would also be handy if you could 'Re-build Standalone Package'. This would generate only the parts that actually change so updates would be much smaller.
So I guess really what it would be is maybe a 'runtime package' containing, perhaps, an executables directory where you would put the executables and their unique supporting files?
 

MrKim

Well-Known Member
Licensed User
Longtime User
You can distribute the full OpenJDK. It is not much larger than a standalone package. You can then start the program with a simple batch file. It is also possible to create a small executable, similar to the executable created with the packager tool.
Clients are used to executables. Also, I am having trouble with it as you describe. I did that with one program and the program works fine on my Dev machine but when I put the jar file on a clean Windows machine part of it works fine but their is a portion that saves a file and it crashes the program with no error.
The batch file was not simple (form me ) it looks like this and took me a lot of time to write.
B4X:
START bin\javaw.exe --module-path javafx\lib --add-modules javafx.controls,javafx.fxml -jar SKDBServerTester.jar
And, as mentioned the following code fails completely. The program just closes with no message. Note that the code to open the file to be edited works fine but saving does not. IF I do the exact same program as an executable it works.
B4X:
Private Sub SaveBtn_Click
Try
    If File.Exists(B4XPages.MainPage.WorkingDir, "config.properties") Then
        If File.Exists(B4XPages.MainPage.WorkingDir, "config.properties.Backup") Then
            File.Delete(B4XPages.MainPage.WorkingDir, "config.properties.Backup")
        End If
        File.Copy(B4XPages.MainPage.WorkingDir, "config.properties", B4XPages.MainPage.WorkingDir, "config.properties.Backup")
        Toast.Show("'config.properties' backed up to 'config.properties.Backup'")
        File.Delete(B4XPages.MainPage.WorkingDir, "config.properties")
    End If
    File.WriteString(B4XPages.MainPage.WorkingDir, "config.properties", EditConfigTA.Text)
    Sleep(4000)
    Toast.Show("config.properties saved!")
    TxtChnged = False
Catch
    xui.MsgboxAsync(LastException.Message, "Save Failed!")
End Try
End Sub
(If the file name looks familiar it is to edit the config file for jRDC2 (my modified version)
But we are digressing. This is a wish - to make all of this simpler. I did not want to bother you with trying to help me fix the issue above.
I also wanted to write a StartServer.exe and StopServer.exe for the jrdc rather than batch files.
I have finally convinced my cohorts that directly connecting wirelessly to SQL server is a bad idea. But this means putting a jrdc server at (currently) over 100 different sites. (This was the biggest reason they didn't want to do this in the first place.) I need to make it simple to do, and simple to debug. Some people will allow the server on their SQL server. Others, I'm sure are going to say "No way in hell! Java is a security risk! Put it on a separate computer". Ports and IP addresses need to be decided and opened through the firewall etc. etc. and every site is different with different rules. Some have IT that will insist on doing it, others will let us TeamViewer in to their server and just do whatever we want.
I found that on my clean computer the jrdc server (started with a batch file) would only start OK if I started it from a command line that was opened 'run as administrator'. If it wasn't the server would actually start, but not load certain components so the server would return an error to the app rather than just failing to start. So you say 'A simple batch file' HAH! It is never that simple. Right-clicking the batch file from file explorer would result in the above. Opening a command prompt and THEN running the batch file works. I had to use the start-debug batch file to even see the error.
The point I am making is that, literally, days have been spent by me trying to create a simple foolproof package that I can give to the world without receiving too many support phone calls. I love writing programs but dealing with the nuances of installation and how java and javaw and javac work is not something I am interested in. It would be nice to be able to finish a program, create an executable and have it 'just work'.
 
Last edited:

OliverA

Expert
Licensed User
Longtime User
Cookies are required to use this site. You must accept them to continue using the site. Learn more…