B4J Question Update the application to the client

PumaCyan

Member
Licensed User
there was a problem when I found a bug in my application, and I want to update the revised application results to the client computer.
Is it necessary to still send one folder from the result of the menu - build standalone package process?
for me the size is quite big if one folder has to be sent, even if it's in ZIP form
because before when I was still using visual basic, I only had to send the EXE file..
 

KMatle

Expert
Licensed User
Longtime User
You need to send the whole (zipped) folder. There's no update function when you only change one line or so (I wish there was). I tell my users to delete the whole folder and unzip the new one. Not the best way but reliable.

PS: You could create an own install/update app which downloads the new zip folder, deletes the old one and copies the new. Just an idea.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
Rather than worry about how to send the whole folder structure, I have found it most convenient to provide my users with a single file installer created as per the instructions in this post most convenient: https://www.b4x.com/android/forum/t...-way-to-distribute-standalone-ui-apps.117880/

As it says at the top of that post "An Inno Script template is created in the parent folder. You can use it together with Inno Script to build a single file installer." Refer to Tips and special cases point 11 for the details.

I believe providing the user with this single installation executable makes your product look more professional.
 
Upvote 0

Daestrum

Expert
Licensed User
Longtime User
You can update parts of a jar using 'jar' in the bin directory of java (it's an exe and 24Kb in size)
like
B4X:
jar uf theJarToUpdate.jar theReplacementClass.class

There are a few caveats though, you cannot add new classes or do other things that can break the loader/linker.

The class you are supplying must be in a similar folder structure i.e. b4j/example/newClass.class
as if you use c:/somewhere/newClass.class
the resultant jar layout would be incorrect and have a 'new' directory 'somewhere/' and it will put your new class in there, not overwriting the original class.

The jar would still work, it just won't see the new class you added and will still use the old class.

example updater (uses shell)
B4X:
    Dim sh As Shell
    sh.Initialize("sh","cmd.exe",Array("/c","C:/java19/jdk-19.0.2/bin/jar","uf","C:/b4j source/testUpdatev1/Objects/testUpdatev1.jar", "../b4j/example/class1.class"))
    sh.run(100)
 
Last edited:
Upvote 0
Top