Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Windows Installer Testing #79

Open
Moburma opened this issue Oct 11, 2023 · 30 comments
Open

New Windows Installer Testing #79

Moburma opened this issue Oct 11, 2023 · 30 comments

Comments

@Moburma
Copy link
Contributor

Moburma commented Oct 11, 2023

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
Copy link
Collaborator

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

@Moburma
Copy link
Contributor Author

Moburma commented Oct 12, 2023

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
Copy link
Collaborator

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
Copy link

goofyseeker311 commented Oct 12, 2023

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
Copy link
Contributor Author

Moburma commented Oct 12, 2023

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
Copy link

goofyseeker311 commented Oct 12, 2023

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

@goofyseeker311
Copy link

goofyseeker311 commented Oct 13, 2023

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
Copy link
Contributor Author

Moburma commented Oct 13, 2023

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
Copy link
Contributor Author

Moburma commented Oct 18, 2023

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
Copy link
Collaborator

mefistotelis commented Oct 22, 2023

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
Copy link
Contributor Author

Moburma commented Oct 23, 2023

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
Copy link
Collaborator

Will fix as well.

@Moburma
Copy link
Contributor Author

Moburma commented Nov 12, 2023

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
Copy link
Collaborator

mefistotelis commented Nov 16, 2023

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
Copy link
Contributor Author

Moburma commented Nov 16, 2023

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
Copy link
Collaborator

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
Copy link
Contributor Author

Moburma commented Nov 16, 2023

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

  • MIDI tension music is now supported using the WildMIDI software MIDI library
  • Player configuration preferences are now saved along with game saves. These work based on the login name the player chooses, and will preserve the menu settings between game sessions. Therefore the game will remember settings such as custom control bindings, high resolution/low resolution, Deep Radar and MIDI tension/CD track between sessions as long as the same login name is used, and they no longer have to be set again each time on game load.
  • As a corollary to the above, the login name can now be set at the command line using the switch -u (username). e.g. "swars.exe -u James" will load the preferences set for the user James. This way it's possible to start levels from the command line and have options such as Deep Radar and custom key controls already set.
  • Campaigns have now been separated out into discrete files, instead of using the original ALL000.MIS file. This means there can now be per-campaign settings, and all three game campaigns no longer have to exist within the cramped 120 mission limit the original game had. Players should notice no difference, but mission objectives and campaign level orders can now be modified by altering the corresponding .ini file in the config directory in a text editor. Eurocorp campaign: miss000.ini, Church of the New Epoch campaign: miss001.ini, Unguided Campaign: miss002.ini. There is also a fourth campaign miss003.ini that contains all other cut levels for the game.
  • As a result of the above, loading levels from the command line now uses a different syntax: -m (campaign number),(mission index number). For example, to play the first mission of the Church of the New Epoch campaign, you would use "swars.exe -m 1,48". To play the last level of the Eurocorp campaign, "swars.exe -m 0,101" would be used.
  • City data has now been moved to cities.ini in the config directory. This allows modification of existing cities and new cities to be defined on the map screen
  • Cybernetic Modification data has been moved to cybmods.ini in the config directory. This allows modification of e.g. research cost/time, and purchase costs.
  • Weapon data has been moved to weapons.ini in the config directory. This allows modification of weapon stats, including weapon damage, accuracy, research cost/time and purchase cost.
  • People data has been moved to people.ini in the config directory. This allows modification of baseline stats of game characters, including Health, speed, and Persuaderton cost/power. Note that many people stats are set explicitly per-level Thing and will override what is set here.
  • Pre-alpha level file formats are now natively supported. This means old cut levels using level formats 9 - 12 that previously could not be loaded without being first converted by a third-party tool can now be played. Examples are Unguided Missions 67 and 70
  • In-game text now uses per-campaign alltext.wad/idx files. They are also now separated by language, meaning it's possible to change between game language by changing the language set in the config.ini file (note, sound and FMV files would also need to be changed to match). Text is now stored in PO files in the source, making it easier to create translations of all text.

Unguided Campaign Changes

  • Unguided Campaign now available from the Login screen. Note this is a first draft and unfinished and simply presents the cut levels as-is when Bullfrog last touched them, so many cannot be completed and are unbalanced, etc
  • Placeholder mission briefings created for all Unguided campaign missions outlining what to do on each mission
  • Unguided campaign missions missing in-game objectives now have objectives to complete
  • Mission 65 - Massive Assault now uses the ALL000.BEN objectives rather than the final game ones. This fixes the incorrect group set for the first objective and also requires a weapon be recovered from the Eurocorp base to succeed.

Bug Fixes

  • Item objective handling has been re-written. The original game code had many bugs in how items were handled and would fail on several of the cut Unguided levels as a result. These changes fix item collection objectives on those levels making it possible to complete them (e.g. Unguided Mission 67: Talks Ambush now works correctly)
  • Issue 16: Item dupe by restarting missions fixed. This is the notorious bug in item handling that meant the player could end up with invisible explosives (and other so called "four pack" items) in their inventories that could not be dropped when collected in a level and the level was restarted. This would make the penultimate Eurocorp level impossible to complete
  • Issue 52: While it is possible to choose between two different Tension music tunes, only one ever plays fixed. The second MIDI tension song can now be chosen for the first time in-game. This was broken in the original DOS release of the game and only played the first track still when set
  • Issue 46: Tank plays sound at map coords (0,0) when firing fixed. This was an original game bug that meant the sound intended to play when a tank turret rotated was only heard at one specific corner of the map, even when the tank was elsewhere in the level
  • Issue 18: Number of scientist deaths is always double of the reported value fixed. This was an original game bug that meant research scientists death counts after completing a mission were wrong
  • Text fixes: Mission 43 is now correctly named "Deadly Harvest" in the English text files. The capital city of Bahrain is now called Al Manamah instead of Bahrain, as per the demos of the game.

Installer

  • Installer has been drastically overhauled and is new for this release
  • Installer now supports all known Western versions of the game, including new support for the GoG download version and the German DOS CD
  • Installer now supports the Japanese Windows version of the game. Note that only English and French language from this release work currently, Japanese language is not supported yet. The Taiwanese and Korean releases of the game aren't supported yet, if you own these, please get in touch!
  • Installer now supports German language - GoG version includes these language files, otherwise you will need the specific German DOS CD release of the game. German language files were not included on the main European/USA disc.
  • Note that ripping CD music is not supported and will error if you install from a mounted CD image of the game. You will either need a real CD of the game, or choose NOT to install the music in the installer, and instead rip the tracks manually yourself to a folder called "music" in the main game directory with the files names track_1.ogg, track_2.ogg and track_3.ogg.

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
Copy link
Collaborator

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

@Moburma
Copy link
Contributor Author

Moburma commented Nov 16, 2023

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
Copy link
Contributor Author

Moburma commented Nov 16, 2023

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
Copy link
Collaborator

mefistotelis commented Nov 16, 2023

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
Copy link
Contributor

geist22 commented Nov 18, 2023

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
Copy link
Collaborator

@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
Copy link
Contributor Author

Moburma commented Apr 27, 2024

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
Copy link
Collaborator

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
Copy link
Contributor Author

Moburma commented Apr 28, 2024

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
Copy link
Collaborator

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
Copy link
Contributor Author

Moburma commented May 1, 2024

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
Copy link
Collaborator

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)

@Moburma
Copy link
Contributor Author

Moburma commented Oct 24, 2024

I've been working on a change to the installer. Now it will have a third option to update an existing install. This is handy, as it then gets the latest levels.zip etc for you. It also skips installing music etc. I've made it so it doesn't update config.ini and also skips copying rules.ini in this mode. I'm doing more testing now, but probably put a version up tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants