A program to download another application and keep it up to date.
Для русскоговорящей аудитории в Wiki подготовлен перевод данного документа на русский язык.
This application respects your laziness and understands how it's hard to upgrade DeskChan every time when a new build is released. Really, at this moment we have two ways to do it manually:
- Quit the application.
- Download a distributive archive.
- Delete all files and directories in your DeskChan directory (excluding some exceptions):
- except for the
data
folder; - and the plugins in the
plugins
folder that are not part of the official distribution.
- except for the
- Extract the archive into it.
- Launch a new version of the application.
- Ditto.
- Ditto.
- Extract the archive and overwrite all files.
- Gets rid of all deprecated files manually.
- Ditto.
And you have to repeat all these steps over and over, again and again for every new build of DC. Tediously, isn't it?
Probably, you're already curious what I suggest to do with it and how it should work? OK, let's see:
- You launch the application via the launcher. Or even it's started automatically when your computer is starting up.
- Amazing! The application is being updated automatically! What a crazy thing!
- Profit! It just launches! That's it.
Unfortunately, the launcher is not working in this way today. Currently, it's only able to:
- check if you're using the latest version of it or not;
- if you don't:
- download a distribution,
- extract files and delete it;
- if you don't:
- launch the DeskChan application;
- terminate itself.
It's sort of a rough overview but illustrates a general idea. For example, the launcher also can make itself a startup application. We'll discuss it in detail later.
More functionality will be available in future releases.
As of v0.1.1-dev, the launcher consists of 3 parts:
Module | Files | Description |
---|---|---|
Core library | DCL-CORE.jar | Contains all logic that responsible for the version resolving and installation. |
Command line module | dcl.exe, dcl | Is responsible for interacting with the user via terminal in a text mode. |
Graphical module | DeskChan-Launcher.exe, DeskChan-Launcher |
Provides a graphical user interface using JavaFX library. |
As you can see from the diagram above, both command line and graphical modules depend on the core library (obviously, isn't it?), but they are completely independent of each other.
I consciously going to maintain both modules in the future. Maybe someday it will be changed, but for now they have its own specialties and exclusive features, which will be covered below.
Actually, this module may be called as the main one. At least today, it supports a lot more features and options than its "competitor".
By default, it:
- uses the system language;
- installs DeskChan into the directory of the same name if cannot find it already installed and up to date;
- and launches the application.
But it supports a certain amount of arguments. Some of them just configure various options, but the others are supposed to alter the behavior completely. Here they are (this list is likely to be expanded in later releases):
Argument | Description |
---|---|
--deskchan-update-required |
If you pass this argument, the launcher just prints "true" or "false", depending on the availability of a newer release of DeskChan on GitHub or not, and terminates. |
--launcher-update-required |
Same as the previous one, but for the launcher itself. |
--deskchan-version |
Prints the current version of DeskChan that is installed under the control of this launcher and terminates. |
--launcher-version |
Just prints the current version of itself. |
--path |
Using this argument, you may define another location for installation. However, the launcher will copy itself there to be along with DeskChan by all means. |
--locale |
If you don't want to use a default locale, you may set another here. It takes strings like ru or ru_RU . Currently, only two languages are supported: English and Russian. |
--delay |
Determines the time in seconds that must pass between the intent of application to quit and the moment when the window will be actually closed. It's quite useless when the launcher has been launched via terminal but very useful when it was launched via a desktop environment. |
--autorun |
By default, the launcher asks you should it be a startup application or not during the installation process. But you may manually set this flag in advance. Also, it can be used to change the setting during usual launch, not the installation. |
--no-autorun |
See the description of the previous argument. This one is the opposite to it. |
--preserve-distribution |
By default, the launcher deletes a distributive archive after the installation. You can disable this behavior using this flag. |
As of v0.1.1-dev the launcher can be launched in the GUI mode as a usual window. This mode lacks a way to change its
behavior using command line arguments, but the most useful options are brought to the GUI layer as controls. However,
they are only equivalents for --path
and --autorun
/--no-autorun
. Moreover, you may set them only during
the initial installation process. Thus, you cannot disable autorun on startup at any time via graphical interface today.
I'm going to solve this problem in the future, though.
One of CORRUPTOR2037's favorite buzzwords.
- Support for files-based distributions against the archive-based ones that are used now. What does it mean? Currently,
the launcher always has to download a whole 20+ Mb distributive archive to extract it and install the application.
Even if the update affects only several small-sized files (frankly speaking, it's a hardly possible case nowadays:
all the code of DeskChan with all dependencies are packed into one single file (
bin/DeskChan.exe
); however, it's still just a half of the whole archive). A solution requires a lot of work on the server side too (probably, for the time being, I'll even have to keep copies of distributions in a proper format on my own server) and will take most of the time that I'll spend working on the next release (along with the following feature). - Support for consistency-correct updates. This means that the launcher will be able to not only add and replace files but delete the obsolete ones.
- A plugin for DeskChan itself that will be able to take responsibility for some features and options. For example, it will manage the autorun option (especially useful for graphical interface module) and be used as a fallback to notify the user about the availability of newer versions.
- A way to install a specific version of DeskChan.
- Support for other repositories except the default one. This feature makes it possible to split releases into different branches (e.g. stable, beta, dev or something like them).
- Plugin management via the plugin. I think the plugin should not be just a middleware between two applications. It can
be a more complex, separate artifact with its own specific functionality based on the already written infrastructure.
A plugin management system, for instance, must be pretty similar to the launcher: version resolving, files-based
downloading, consistency-correct updates, and so on. However, it must have additional features: dependency resolving,
searching over a catalog of plugins, etc.
Maybe I change my mind later, and it will be an independent plugin whose history will be written in another repository. But for now, I think so.
The project has a Gradle wrapper configured, so you can use the following command template:
- on Windows:
gradlew <task>
- on Linux:
./gradlew <task>
Here is a list of some main tasks in which you might be interested:
Task | Description |
---|---|
buildDistZip |
Builds the project and creates a distribution as a zip archive. |
wrapFilesWithDir |
Does the same as the previous task, but not generate the archive. You can find the output in the build/DeskChan-Launcher <version> folder. |
run |
Just compiles all classes, resources and runs the application. The working directory will be set to the build/classes folder. |
Note that this application is under a very slow development, and it's normal for this repository to not have new commits for months. Just keep this in mind.
If you found a mistake in this text (or in other English texts as well), let me know! I will appreciate your help to make my English better :)
Besides usual GitHub means and emails, you may contact me (or someone else from DeskChan Project) via Telegram. It's even a preferable variant, I suppose. And don't let Russian letters scare you!