swfans / swars

Syndicate Wars port, alternative binary for the classic Bullfrog game
Other
90 stars 14 forks source link

New Windows Installer Testing #79

Open Moburma opened 11 months ago

Moburma commented 11 months ago

EDIT 2: Another new version linked

As you may have noticed, the official Windows installer for the port is now years old, and doesn't support the latest developments (i.e. the change to how language files work). It also doesn't support what is now the most common version of the game (the GOG installer), and doesn't support the German CD release, either.

As such I've been working on updating it and making a newer, nicer and more functional installer. The original one was a good starting point, but now I'm quite confident that the latest version should cover nearly all bases from which you may be trying to install the game from. There's also an actual proper uninstaller now, too.

I've done lots of testing, but of course with these things you never really know they're 100% until they are out in the wild for people to really test them. If you would like to help test this new build, you can download the latest github actions build packaged up at the following link:

https://uploadnow.io/f/FG0F31r

Obvious caveats apply - don't install it over your existing game if you don't want to risk losing anything, and be prepared for some possibly horrendous bug that I may have somehow missed. Please try it out and report success or failure. There are a couple of minor issues that are flagged in the installer itself, but I will not mention them here to see if what I have put in so far is good enough to mitigate them or if more is needed.

Also let me know of any other functionality that might be useful (like maybe uninstall while preserving saved game directory only?).

Things to test:

  1. Does the installer run to completion? If not, what part errors?
  2. Does the game run correctly aftger install? If possible, play through the first mission of either campaign as that should prove most things are in place
    1. Does the uninstaller work? There should be no game folder or shortcut icons left at the end

Also if you could say which version you installed (CD, GOG), and which language is also helpful.

mefistotelis commented 11 months ago

Hm, my VirtualBox has trouble mounting an image with cd audio.. but tested without CDA, and it worked ok.

Moburma commented 11 months ago

Yes, that is something I was alluding to above. I did put in a warning if you hover over the game music option in the components page, but I think you've confirmed it's too easily missed, so I will put in a clearer warning. I think it's another common use case - I actually had this problem waaay back in the day when the original release of the port came out and was confused then. Unfortunately I don't think there's any way to rip from a mounted iso, the workaround is simply not to do it in the installer and tell the user to do it themselves.

iso issue

mefistotelis commented 11 months ago

I did put in a warning if you hover over the game music option in the components page, but I think you've confirmed it's too easily missed

I didn't really missed it, I just assumed that VirtualBox, being a simulator detached from any HW, will support the format properly. But it looks like it does not, even though multi-track CUE/BIN support was added back in version 5.2 (at least, this is what they claim in release notes).

goofyseeker311 commented 11 months ago

seems to work without any problems.

side note: the default key "backslash" for grouping soldiers is not found in any of the normal keys on scandinavian keyboard layout.

Moburma commented 11 months ago

seems to work without any problems.

side note: the default key "backslash" for grouping soldiers is not found in any of the normal keys on scandinavian keyboard layout.

Thanks, out of interest what version did you install, GOG?

The keyboard thing is off topic, but I actually get the same problem with my UK keyboard, it's actually some non-standard keyboard I have and a few games don't recognise that key (DCS world is another).

goofyseeker311 commented 11 months ago

gog version. "backslash" key is alt-gr + ?, so its not a single key press.

goofyseeker311 commented 11 months ago

why does the game or installer put a win.gif/.png on my d:\ root? its the installer vertical image of a soldier. yes the installer was in d: drive, not in the c: target drive.

Moburma commented 11 months ago

Oops, I was using that while testing something early on, was pretty certain I'd reverted it, it's not set there in my latest version. Thanks for finding it, this is exactly the sort of thing I wanted to squash before publishing. I've uploaded a new version here, this doesn't put the image there for me: https://uploadnow.io/files/NSkpK8M

Moburma commented 11 months ago

Another new version. This won't be very interesting for most people, but I've now moved over to my new more generic Gogisoripper tool instead of the original Syndicate Wars specific swisoripper tool for ripping the GOG audio tracks. What is slightly more interesting is I realised the GOG .cue file is actually wrong and the audio tracks are slightly misaligned. This is most obvious if you play track 3 of the GOG version in-game, which is missing the first second or two of music. As such I've gone back and rechecked the track boundaries by hand against a rip from a real CD and now the versions ripped by this installer are correct and don't miss any audio/include bits from the previous track like the GOG release does.

Link: https://uploadnow.io/f/FG0F31r

mefistotelis commented 11 months ago

The old libpng3 is no longer necessary. Same with openal32.dll and wrap_oal.dll.

EDIT: Will fix that myself, as it's a dependency for other changes I'm doing.

Moburma commented 11 months ago

One thing I noticed as well post-pull-request is there are duplicate lines at line 376 and 377, 380 and 381. Goto langncd_store only needs calling once.

mefistotelis commented 11 months ago

Will fix as well.

Moburma commented 10 months ago

More a note to myself, but one mildly annoying problem is that the progress bar never goes to 100% at the end of install due to the number of Return commands used in the functions. Nsis considers this "missed" progress. Really needs a re-write of the old Vexillum installer stuff to fix it (or an ugly workaround forcing the progress), not sure if it's worth it though.

mefistotelis commented 10 months ago

We should prepare a "release", as people are installing a version from April and asking strange questions... Could you prepare a release notes for the v0.3.5? Also, would be nice if the installer could "!include" the header file with version number, instead of having a version within the main script.

EDIT: by the header, I mean swars-config.nsh which is created while building.

Moburma commented 10 months ago

Yes, I was just about to suggest the same. I'll put together release notes (be nice to have these displayed in the installer as a page, yes?) and try and get the version header working, I saw you started on that. I might try and fix the 100% progress issue too, saw a few ways to do it.

mefistotelis commented 10 months ago

be nice to have these displayed in the installer as a page, yes?

My main intention is to paste them to the release message, as there were 700 commits since previous release. Though you can add it to the installer as well, up to you.

try and get the version header working

It is in the same folder where your NSI script is copied, so should go without any issues. (the automatic builds run the installer creation from release/res folder)

Moburma commented 10 months ago

EDIT: Urgh, Github has stripped my examples that used angular brackets, it had things like -m (campaign number),(mission index number). Changed them to curved brackets for now on here.

How about this for release notes:

Release XXX

Improvements since release 0.3.3.797:

General Game Improvements

Unguided Campaign Changes

Bug Fixes

Installer

Not sure about the PO files bit above, it's a cool feature but more source code than end user game related, so feels a bit wrong included it here, and also I'm not sure I expressed it well either. Obviously let me know if I missed anything important. I also managed to fix the 100% installer bug, it actually just needed one Section edited, I just used a goto to skip the filecopy failure bit.

mefistotelis commented 10 months ago

Oh wow. I though those will be 6-10 lines, you really surprised me. But sure, that will do. Thank you.

Moburma commented 10 months ago

Well, it was obvious that people aren't aware of how much (or indeed any) work has been done on this project (mostly by your good self!), so I think it's worth going the extra mile to make it clear how good it is now and exactly what it can do compared to the original game.

Moburma commented 10 months ago

One annoying thing: I just downloaded the latest installer from the Github actions. It works fine, but Windows Defender has a false positive on it being a virus for some weird reason. Just what we needed.

mefistotelis commented 10 months ago

Not much we can do about that.

Well, most AVs have a way of reporting false positives, so that they can be manually verified and cleared in future versions. But I never bothered with that.

EDIT: Created the release. Skipped version 3.4. Didn't really tested whether the binaries work - I guess I firmly believe in our build system (though really I just didn't had time).

geist22 commented 10 months ago

I've tried out the release version, though I normally prefer the simple flexibility of portable archives, here's some comments:

  1. \QDATA\INTRO.SMK isn't needed here anymore, since this file is copied to \intro\, it's a duplicate now.
  2. It couldn't load my old saves, I noticed the savegame location was changed from swars\qdata to user\appdata\roaming\ but I didn't know until after I've made a new save. Perhaps you might want to keep the old location enabled, or note that the location was changed. A new user wouldn't notice this, but I was a bit surprised when I've copied my saves to the usual directory and it didn't work.

Other than that, I don't see anything to complain about. I've used the GOG version (which I've had to install again first, since I'm using two different copies, one for dosbox-staging and one for swars port).

mefistotelis commented 4 months ago

@Moburma are you willing to implement downloading map/level files and installing these?

An example release is already made in swars-levels. There's also a build systems which makes release ZIP automatically, so the file content will be consistent between releases.

What we need from the installer is:

  1. Check if the ZIP file (with name hard-coded into the installer) exists in the installer folder. Optionally verify size or MD5 checksum as well (to avoid using half-downloaded files).
  2. If the check fails, download the file from hard-coded link to a release within swars-levels to the installer folder.
  3. While installing the port, unzip the levels file to the output folder rather than copying levels from original game.
Moburma commented 4 months ago

Yep, I will have a go. A bit busy with work this week but will see what I can do. Do we want to make this mandatory or optional?

mefistotelis commented 4 months ago

Mandatory.

We should provide one experience. If someone wants to diverge from it, that should be done by additional modifications after installation. (or by installing manually rather than via the installer)

Moburma commented 4 months ago

I actually got this done already, but will be very busy the next couple of days so will return to it then. I guess the idea is you'd have an include like the PRODUCT_VERSION define to dynamically add the swlevels zipfile name and MD5 during compilation? I've hardcoded those for now, but it seems the logical way to do it. Also it will need quite a few third party plugins as this is all non out-of-the-box functionality. Not sure the best way to do that using github actions yet, I'm just doing it locally for now.

At the moment I'm using these: https://nsis.sourceforge.io/Inetc_plug-in - downloads https://nsis.sourceforge.io/Nsisunz_plug-in - Zip file extract

And will likely add this for MD5 checking: https://nsis.sourceforge.io/MD5_plugin

I'll upload a version once I've got the MD5 part worked out.

mefistotelis commented 4 months ago

I guess the idea is you'd have an include like the PRODUCT_VERSION define to dynamically add the swlevels zipfile name and MD5 during compilation?

For now I wasn't thinking about moving the download link or md5 anywhere. Sure this can be done, ie. we can use configure scripts to add these to swars-config.nsh, taking them from install instructions. But for now, I see no issue with hard-coding.

it will need quite a few third party plugins

Yeah, cannot avoid that. We just have to add installation of these plugins to our build environment. The action we use supports adding custom plugin folder: https://github.com/joncloud/makensis-action

Moburma commented 4 months ago

Ok, finally had time to finish this off properly and submitted a change. Needs the plugins I indicated above. Extracting the levels isn't very elegant, I found a better zip plugin that could extract only some files, but it wouldn't work - then I found it's an old plugin and doesn't have a unicode version that the newer installer expects, so I gave up on it. Anyway, this downloads the levels package, and compares the MD5 against what is stored in the installer. If it's bad it downloads again and checks once more. I didn't set it to keep trying after this as I hate it when things can get stuck in an infinite loop. If the second check is bad the installer aborts.

mefistotelis commented 4 months ago

Looks ok.

We should add the missing SCN files to swars-levels repo, then we can skip copying maps and levels from the original CD. (they are supposed to be auto-generated, but I still don't have a tool for that)