Comments (8)
I see what you mean. Currently, the update happens in the main thread and the launch is done in a new thread. You're proposing to reverse this setup.
Well, the default bootstrap is really here to get you quickly running your application without diving into the library details. You will most likely want to customize this behavior, in which case you can provide your own bootstrap.
from update4j.
If I'm not wrong, ConfigImpl.doLaunch launches the application in a thread, so using a custom bootstrap won't fix the issue if calls Config.launch. At least this should be fixed.
Maybe I can try to do the changes myself and send a pull request, I don't have a Mac to test so it may take some time.
from update4j.
Indeed you're right, but this is documented so changing this might break other people's projects.
Could you perhaps start SWT in the main thread before launching the business application?
You mentioned it only happens for --launchFirst
; your above mentioned issue should happen in both launch types.
from update4j.
Yes, you are right, it should happen with both launch types, I started writing before realizing that doLaunch started another thread and forgot to edit.
I'm not sure how starting the application in the doLaunch thread would break other applications. It starts a thread and waits for it to finish, so anything calling it will block (as documented on Configuration.launch). Is there a reason to start a new thread and wait instead of just starting the application ?
I would avoid writing a dedicated bootstrap, the default is more than enough for my needs currently. Actually I would like to have an option to just check the presence of update.zip, apply the changes and launch the application, nothing else. I don't want any "under the hood" self-update, all updates should be user initiated (this is both because it is an experimental implementation for me, and because I don't like automatic updates in other software...).
from update4j.
The primary reason to start another thread is to keep the thread context class loader separated. It's very complex to explain but you could read about the class loading model in the docs.
Of course, nothing keeps you from forking and doing your own thing 😉.
from update4j.
Wrote a simple patch to get rid of the additional threads and seems it works well with SWT on MacOS.
Also no problems with Linux and Windows.
update4j_main_thread.patch.txt
Anyway, I think I'll go the fork way for my project.
As a side note, I started writing a maven-plugin to generate the config file, if you are interested.
from update4j.
Yes, I might be interested. If it solves a problem I'll add a reference to the README
from update4j.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from update4j.
Related Issues (20)
- Permission Issue: Default Bootstrap Archive Location HOT 9
- Updating app's JDK with update4j HOT 5
- Make update.zip path confgurable HOT 1
- Deletion of files not present in config HOT 8
- getOldFiles takes a long time (too long?) HOT 22
- Basic issue of understanding HOT 25
- Working in offline mode with --local and --syncLocal HOT 3
- Communication between bootstrap and business application HOT 4
- config.update does not download anything and just stop the programs HOT 2
- Headless Setup with NGINX Basic Auth HOT 13
- proposal HOT 1
- NoSuchFileException reserved/config when there is nothing to update HOT 3
- Demo App doesn't run on Windows 11 and Java 19 HOT 4
- Connect/read timeouts too short on URLConnection HOT 1
- Propagating business applications' exit code through Bootstrap HOT 5
- Support multiple architectures HOT 19
- Exception when download files. HOT 2
- Relative path in basePath? HOT 3
- Size of file does not match size in configuration HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from update4j.