itchio / itch

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

External files don't work in Itch app #1277

Closed waltdestler closed 6 years ago

waltdestler commented 7 years ago

I originally had the download for my game link to the download file on my own website, just to save me some time uploading files. This proved not to work with the Itch app (even though the download link on my game's page worked fine). Clicking the "Install" button briefly tried to download but then reverted back to saying "Install". No error message was shown.

Changing the file download to a non-external file fixed the issue, but the only way I figured that out was by trial-and-error.

Not sure if it matters, but my game uses an Inno Setup installer. (It uses the .Net Framework and some DirectX components that aren't included by-default in Windows 7.)

fasterthanlime commented 7 years ago

Can you e-mail us (hello@itch.io) the link to your website that contains your game's file? Mention 'itch app' in the subject line.

Usually that happens because the HTTP server you specify doesn't support some features the itch app needs (like, responding to HEAD requests, filling Content-Length properly, supporting the HTTP Range header)

waltdestler commented 7 years ago

It wasn't immediately obvious how to email you, and I don't mind posting the link publicly:

https://cosmoteer.net/

And the actual file: https://cosmoteer.net/downloads/Cosmoteer%200.12.2%20Setup.exe

I'm running a pretty default Apache server on Ubuntu 16.04. Not sure if it supports those features by default.

fasterthanlime commented 7 years ago

It wasn't immediately obvious how to email you

My bad, I edited the post shortly after :)

I was able to reproduce the issue - with an external download, the file name isn't set, so it downloads to 123456 (ie. whatever the upload id is). Then, since it's an Inno installer, it tries to launch it, and since it doesn't end with .exe, Windows just goes crazy.

Fun fact, there is a workaround for that for NSIS installers, but not for Inno ones: https://github.com/itchio/itch/blob/7f7d954a4b6ed62e09e58c0688d199635ef20dbb/src/tasks/install/nsis.ts

Something I'll look out for in the big refactor currently in progress, that's for sure. Thanks for reporting!

fasterthanlime commented 7 years ago

In the upcoming version of the app (v25), the download happens correctly, but the installer isn't recognized as inno, I'm looking into that!

fasterthanlime commented 7 years ago

Can I ask how you generate your setup file @waltdestler ?

It seems like an InnoSetup file wrapped in a Borland Delphi program.. what did you use to sign the executable?

fasterthanlime commented 7 years ago

I've looked into the Cosmoteer installer some more, and it definitely behaves like an InnoSetup installer wrapped in something else.

Unfortunately it requires Administrator privileges to install - I'm assuming because of the DirectX redistributable it installs?

Here's what I recommend @waltdestler:

When you push a folder using butler, a few things happen:

I see on your website you mention a self-updater - that's impressive! But also, for publishing on itch.io in particular, it's recommended to use https://itch.io/app to let games update automatically - all you have is to push portable builds with butler, and the backend & app take care of everything else.

Let me know if you have any questions!

waltdestler commented 7 years ago

@fasterthanlime Not sure why the installer appears to be InnoSetup wrapped in something else. It's pure InnoSetup 5.5.9 signed using Microsoft's 'signtool'. It bundles the Microsoft .NET and DirectX installers; maybe one of those is somehow fooling the detection?

There are three reasons it requires admin privileges:

  1. .NET Installation
  2. DirectX Installation
  3. So it can install to Program Files

Number 3 is of course irrelevant for itch, but 1 and 2 still are.

I see that you now have DirectX and .NET supported in the manifests, which is awesome (and the major reason I wasn't using butler). However, I only see .NET 4.6 on the .NET Framework page, but my game requires 4.6.2. I assume 4.6.2 support hasn't arrived yet?

Also, is there any way to have separate files for the itch app and the "download" button on my itch page? I'd still like to use my own installer for when people manually download the game, because they still need to have .NET and DirectX installed for them.

fasterthanlime commented 7 years ago

@fasterthanlime Not sure why the installer appears to be InnoSetup wrapped in something else. It's pure InnoSetup 5.5.9 signed using Microsoft's 'signtool'. It bundles the Microsoft .NET and DirectX installers; maybe one of those is somehow fooling the detection?

Maybe 5.5.9 is new-ish? Since you're doing the standard inno+signtool thing and not anything funky, I'll definitely look into making sure our spellbook recognizes it.

I see that you now have DirectX and .NET supported in the manifests, which is awesome (and the major reason I wasn't using butler). However, I only see .NET 4.6 on the .NET Framework page, but my game requires 4.6.2. I assume 4.6.2 support hasn't arrived yet?

There was a discussion about this, see https://github.com/itchio/itch/issues/1061#issuecomment-299754431 - the advice was not worry about it until someone requests it, and you just requested it! I'll add it now.

Also, is there any way to have separate files for the itch app and the "download" button on my itch page? I'd still like to use my own installer for when people manually download the game, because they still need to have .NET and DirectX installed for them.

In the long-term the plan is for us to automatically generate installers that can download the game + install prereqs. In the short term: there's no way to hide downloads from web, but you can just list both - the app will prefer the portable build if there's one, and if you list the .exe first, non-tech-savvy users will probably pick that.

waltdestler commented 7 years ago

Great, thanks so much for making 4.6.2 work!

And it sounds like listing both downloads on the page is fine for now. (Would be great if I could hide one, or give each download a description.)