itchio / itch

🎮 The best way to play your itch.io games
https://itch.io/app
MIT License
2.35k stars 209 forks source link

Add XNA redist to prerequisites repository #1096

Closed fasterthanlime closed 7 years ago

fasterthanlime commented 7 years ago

See https://github.com/itchio/itch-compatibility-watchlist/issues/485

(And make sure Lemma uses it once it's out)

Metalfusion commented 7 years ago

Any ETA for this? My game (Battlefleet Engineer) needs the XNA 4.0 Refresh to run and I would like to not have to have an installer just for that.

fasterthanlime commented 7 years ago

So I have good news and bad news.

The good news is: I just spent hours adding XNA 4 to our redists database, and it works great :+1:

The bad news is: v23.4.0 apparently completely skips over windows prereqs. I'm hoping to release a fix real soon for that, I'll let you know when that happens.

fasterthanlime commented 7 years ago

Good news: v23.4.1 is out, and it installs prereqs correctly.

You can test with "xna-4.0" for the prereq name, @Metalfusion. I'll add it to the docs once you confirm it works properly for you :)

MichaelDePiazzi commented 7 years ago

@fasterthanlime Sorry to be a pain, but any updates on support for DirectX (#1042) and .NET Framework (#1061) pre-reqs? Thanks!

Metalfusion commented 7 years ago

@fasterthanlime It seems the itch app now tries to install the prerequisite even as I have it already installed. Maybe we somehow have different installer packages.

I would suggest using a different registry key for checking if the Microsoft XNA Framework Redistributable 4.0 Refresh is installed.

On a 32-bit OS: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\XNA\Framework\v4.0] Refresh1Installed=1

On a 64-bit OS: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\XNA\Framework\v4.0] Refresh1Installed=1

fasterthanlime commented 7 years ago

@fasterthanlime It seems the itch app now tries to install the prerequisite even as I have it already installed. Maybe we somehow have different installer packages.

That's very possible. The install should be really fast though, since it's already installed :)

On a 32-bit OS: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\XNA\Framework\v4.0] Refresh1Installed=1

On a 64-bit OS: [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\XNA\Framework\v4.0] Refresh1Installed=1

I've spent quite a bit of time hunting for those, thanks! My current redist format doesn't allow querying values just yet, it just checks that a certain key entry exists. I'll update it at a later date, since the current system will work even if it means one unnecessary run of the installer.

Metalfusion commented 7 years ago

On my development machine with Windows 8.1 and Microsoft XNA Game Studio 4.0 Refresh the prerequisite install fails, generating the following log: https://gist.github.com/Metalfusion/c2d97626150e00651ce4db00d514467c

However, I also tested in a clean Windows 10 virtual machine and there it installed fine so this probably won't affect normal users. My guess is that the XNA game studio package for developers includes the redistributable's content but has different product ID or something, but the redistributable installer detects that it is already installed.

Anyway, this already practically solves my XNA prerequisite problem. Thanks @fasterthanlime!

fasterthanlime commented 7 years ago

@Metalfusion interesting - that's most definitely what's happening.

Can you do me a favor and;

If it returns a predictable error code, then I can just ignore that!

Metalfusion commented 7 years ago

Here you go: https://gist.github.com/Metalfusion/9ddbfe4e584e8a7255cc39f73eca6692

Seems to be around line 348

fasterthanlime commented 7 years ago

Alright, well in typical MSI fashion, it's returning the most generic of error codes (1603 - which just means "something went wrong"). The actual error code is Error 1316. The specified account already exists., like you found out.

So, it will actually fail for users who already have the full IDE installed.

On the plus side, I've been investigating using node-registry-windows directly to look up the registry (instead of exec'ing reg.exe). We can do now that we're set up for using native node.js modules in the app (this shipped with the last version, had to adjust the CI infrastructure).

I'm leaving this gist here as reference of how to read a value from the registry using it:

https://gist.github.com/fasterthanlime/b85801149e409770b23d331c282002c7

fasterthanlime commented 7 years ago

Good news, the actual source of the issue is detailed in #1304 (and a fix is on the way)!

Closing in favor of that.