UltraStar-Deluxe / USDX

The free and open source karaoke singing game UltraStar Deluxe, inspired by Sony SingStarâ„¢
https://usdx.eu
GNU General Public License v2.0
832 stars 160 forks source link

[Installer] NSIS Update script is incomplete #102

Closed RattleSN4K3 closed 4 years ago

RattleSN4K3 commented 8 years ago

The NSIS update installer misses a lot of code to really make it work.

RattleSN4K3 commented 8 years ago

Working on it...

basisbit commented 8 years ago

updater should do a full uninstall of the old install and then do a new full install. custom song files won'T be deleted by nsis anyways because they were not part of the old install

RattleSN4K3 commented 8 years ago

The updater also includes online check.

RattleSN4K3 commented 8 years ago

Regarding that online check, I am already using the VERSION file (#79) to compare the current with a possible new one. As the internal version could increment during the development, I plan on using another branch to push there only when a public release is done. The updater will verify the file; http://raw.githubusercontent.com/UltraStar-Deluxe/USDX/release/VERSION (note: it points to the release branch not the master).

However, the script should also download the new installer, there should be a reliable match between the release version, the file VERSION and the installer file naming. The file name of the installer is already incompatible to the semver version since USDX had patch versions (1.0.1 etc.).. I'm thinking of adding at least 1 additional line to the version file for the release commit to match the version naming of the installer (to download).

1.3.2-beta 1.3-beta

With this information, the updater installer can download the file from Github with a replacement string: https://github.com/UltraStar-Deluxe/USDX/releases/download/%VERSION%/ultrastardx-%VERSIONSTRING%-installer-full.exe

basisbit commented 8 years ago

how about you put the VERSION file for the updater in the github.io repo? that is one of the things that github.io is good for

RattleSN4K3 commented 8 years ago

Not sure why using the .io repo. Branching is similar to the SVN concept tags, trunks and branches. However, in git tags don't exist as a folder structure. Tags could be merged or rebase/commited.

There is no specific VERSION file for the updater, it is the same file. It just has an additional entry for the release name (since you like 1.3 better as a full version name "1.3.2" for the public release).

Another branch could also be helpful to distinct stable from unstable code base. With upcoming major changes (OpenGL, SDL2, etc.). Feature could get broken again. Working on a single branch and trying to merge branches into master one could get nasty to work with and still keep it stable.

basisbit commented 8 years ago

feel free to read about github.io in the official documentation. Any download-files or files that the updater uses should be either release-tag-download-files using the release feature or should be stored in the .github.io repo and then the https://ultrastar-deluxe.github.io/whatever should be used to access the files.

RattleSN4K3 commented 8 years ago

It's no other file the updater requires than the ones which are already existing. (thanks for playing the RTFM card -.-).

RattleSN4K3 commented 8 years ago

On a more serious note, a github.io page does require additional work to do, for every single time and now. And in case of a probably upcoming release in less than 24h, the whole page system for the github.io page has to be planned (or at least created and adapted to work with the repo and updater). As this is non existing, but the other structure is - and likely stays - it seems the better approach for now.

RattleSN4K3 commented 8 years ago

I've uploaded the NSIS updater (and the installer script). You can check for the current file it is using. I don't think I'm gonna be able to change it to a KEY=Value-plain-text-kind-of-file therfe for it pretty much stays the same.

Checkl the commit: 397970bef00d74222ef8638e2629906b9d38eebb

There are already some translations which need to be updated. I've changed some strings used for message boxes to be used more as a helping message in the dialog.

In case of update_check_older as example from: "Your version $installed_version is outdated. The new version $online_version of ${name} is available. Do you want to update?" to "Your version $installed_version is outdated. The new version $online_version of ${name} is available. Choose your option:"

The update "installer" currently doesn't work out of the box in case you're testing it. It is already using a possible URL to be used with the upcoming release.

variables.nsh

!define version_url "http://raw.githubusercontent.com/UltraStar-Deluxe/USDX/release/VERSION"
!define update_url "https://github.com/UltraStar-Deluxe/USDX/releases/download/%VERSION%/ultrastardx-%VERSIONSTRING%-installer-full.exe"

In the same file, there are debug definitions, just uncomment these lines in order to test a update process. It will download the 1.0.1a and start the installer. In proper use, it will download a new version's installer and execute it.

; debug - uncomment for testing
;!define /redef update_url "http://downloads.sourceforge.net/project/ultrastardx/UltraStar%20Deluxe/Version%201.0.1a/ultrastardx-101a-installer-full.exe"
;!define /redef version_url "http://raw.githubusercontent.com/UltraStar-Deluxe/USDX/master/VERSION"

That'S it for the current quick explanation. I still have to manage some smaller parts of the installer/updater, but first I wanted to commit a major update. I like gonna make the file structure of the repo a bit more clear. Changelogs for instance, doesn't need to be in the root. The installer should also include (the now called "Update") updater script. And instead of the current "Update" script, the installer should have the option to download a new release if desired. Gonna create a new issue/PR for it (or even a wiki, dunno).

s09bQ5 commented 4 years ago

@basisbit, do you really want this to be fixed for the next release? What are the problems with the current installer?

basisbit commented 4 years ago

I already made the necessary changes on the installer script for the next release. I was just busy because of covid19 related work stuff and also a critical health case in my family. Will try to push the release after some basic testing next week. Please keep poking me so I don't forget 😅

s09bQ5 commented 4 years ago

So this can be closed now?