Comments (7)
There's no configuration for doing this in the code, but depending on what you're trying to accomplish, maybe some hackery can get you there.
Is your intent to download code/resources that are presumably not yet downloaded and then just stop?
from getdown.
The main reason is that I need to stop a service before getdown, and start
it After. *then * I start the main application.
5. juni 2014 18:36 skrev "Michael Bayne" [email protected]
følgende:
There's no configuration for doing this in the code, but depending on what
you're trying to accomplish, maybe some hackery can get you there.Is your intent to download code/resources that are presumably not yet
downloaded and then just stop?—
Reply to this email directly or view it on GitHub
#6 (comment).
from getdown.
On Thu, Jun 5, 2014 at 11:37 AM, David Steinsland [email protected]
wrote:
The main reason is that I need to stop a service before getdown, and start
it After. *then * I start the main application.
OK, then I think the approach I had in mind may be useful.
You can pass system properties to the Getdown app which are passed through
to your app. So you could do:
java -jar getdown.jar -Dapp.update-only=true appdir
which will then pass -Dupdate-only=true to your app when it is run. Your
app can check for update-only first thing and if it sees that, then it can
just exit immediately.
That way, whatever is running Getdown will cause it to do its natural
updating, and then "run" the app, which will just exit immediately. Then
you can run your app however you like, without the -Dupdate-only system
property, which will cause it to run as normal. That could be by reinvoking
Getdown (which will see that everything is up to date and just run your
app), or by whatever other means you like.
from getdown.
yeah, thank you. much simpler!
on a side note.. is it possible to update getdown
by specifying it as a resource
, or will this completely break the classloader?
from getdown.
On Fri, Jun 6, 2014 at 6:37 AM, David Steinsland [email protected]
wrote:
on a side note.. is it possible to update getdown by specifying it as a
resource, or will this completely break the classloader?I was going to point you to the wiki page on updating Getdown, but I
haven't written it yet! Ha!
You can update Getdown, but you have to jump through hoops, because as you
suspect, if you update the getdown.jar that is actually running Getdown, it
will crash and burn.
What we do is to add:
resource = getdown-new.jar
to our apps, and then there's a helper class in Getdown called LaunchUtil
which defines:
/**
* Upgrades Getdown by moving an installation managed copy of the
Getdown jar file over the
* non-managed copy (which would be used to run Getdown itself).
*
*
If the upgrade fails for a variety of reasons, warnings are
logged but no other actions
* are taken. There's not much else one can do other than try again
next time around.
*/
public static void upgradeGetdown (File oldgd, File curgd, File newgd)
The way to use it is to put getdown.jar in your app's classpath, and then
call LaunchUtil.upgradeGetdown() during your apps startup phase.
upgradeGetdown() does the following:
delete oldgd
move curgd to oldgd
move newgd to curgd
copy curgd back to newgd
This three way shuffle is to avoid conflicts if Getdown is still running
for any reason and has curgd open (which on Windows will prevent it from
being deleted or copied over, but not renamed), and also to avoid issues if
the user's disk happens to reach 100% full during this process.
Also upgradeGetdown() does nothing if curgd and newgd are the same size
(which it uses as a proxy for tracking whether it already did the upgrade).
from getdown.
Aha, so something like this then:
...
public static void main(...) {
com.threerings.getdown.util.LaunchUtil.upgradeGetdown(new File("getdown-old.jar"),
new File("getdown.jar"),
new File("getdown-new.jar"));
}
java -cp getdown.jar:app.jar com.myapp
from getdown.
Exactly.
from getdown.
Related Issues (20)
- Improvement suggestion for verification
- Portuguese translation issues HOT 1
- Exception with Java>14, the class Pack200 is missing
- How do I access the artifacts if the appbase URL in the getdown.txt file is of jfrog artifactory which requires credentials to log in?
- Download links broken
- Getdown not deleting validated marker files after update
- Error creating digest: Error computing digest HOT 1
- getdown update does not delete files deleted on the server in versionless mode HOT 2
- generating digest file in a project that does not use a built tool such as maven, ant HOT 1
- Option to enable relative paths to jarfiles in classpath entries HOT 1
- JVM error when adding JavaFX modules HOT 1
- [Question]How do you make an installer for a getdown project using jpackage? HOT 1
- Platform-specific Configuration for arm based mac
- cleanup_pattern problem - does not work HOT 2
- unable to build cloned getdown HOT 2
- getdown does not recognize downloaded java version HOT 1
- Sanitize JvmArgs HOT 2
- Starting with JDK 20, digest creation fails on dynamic `appbase`
- digest difference on zip file when migration from Getdown version 1.7 to version 1.8 HOT 3
- Digest exception when using a protected zip file (with password) in the application package HOT 5
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 getdown.