Coder Social home page Coder Social logo

Comments (6)

mordechaim avatar mordechaim commented on May 30, 2024

But how can we update the update4j, myapp-boot.jar, myapp.ini and myapp.exe in the installation folder (that are currently in use)?

update4j

The update4j file itself (currently) cannot be updated using this framework's features. The way to go would be to start the framework with a script or a set the classpath in a configuration file (as the case with javapackager, in MyApp.cfg that contains the classpath info) and when a new version is available download it with a newer version of these scripts/configuration pointing to the new file.

myapp-boot.jar

If you are using delegate mode, the philosophy is that you won't replace the existing files, instead you release a new delegate and increment the Delegate::version. Ideally, you could append a version number to the boot jar to match the delegate version (myapp-boot-v1.jar). If you're using modules, you must have a different module name from the old (since it doesn't really get replaced), so my.app.v1 should be ok.

myapp.ini

I would assume your ini file is texual, read by myapp.exe at app launch. In this case it doesn't get locked in any way.

myapp.exe

If you are on Windows (unclear, as the paths you gave point to Linux style, but exe isn't really Linux), there isn't any way you can update it. On Linux, files never get locked. Never!

On Linux it is safe to overwrite running executables, as the executable will still see the old version as long as it runs. But jar files aren't really executables but just zipped files read by the JVM, so overwriting them in a running instance is dangerous.

How can we work with relative instead of absolute paths in such a case?

Can you please elaborate your problem?
Do you mean that individual files in the config file are absolute and won't resolve against the base path?

from update4j.

persal avatar persal commented on May 30, 2024

Thanks, will look at using delegate instead of our custom bootstrap class.
Also good to know where the limitations are. Hopefully updating the update4j library is not something that is needed very often.

Regarding paths. My understanding is that I have to provide absolute paths to where update libraries should be installed. But what if I want them to be updated in the relative path to "current directory", which is where "myapp.exe" is located.
Currently updates will be installed to "basePath" of not declared as absolute in the config.
Can I perhaps rewrite the "basePath" in my delegate?

We plan to have one installer for windows and a generic for others.

from update4j.

mordechaim avatar mordechaim commented on May 30, 2024

from update4j.

persal avatar persal commented on May 30, 2024

Added a delegate with works nicely with booting from update4js default Bootstrap. Also found user.dir very useful. I assume there are more of these "built-in" properties?

Appreciate all your help!

from update4j.

mordechaim avatar mordechaim commented on May 30, 2024

from update4j.

persal avatar persal commented on May 30, 2024

Ah good to know that's how they get resolved. Didn't know user.dir was as widespread as user.home

from update4j.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.