Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Web Player can't find index.html in zip compressed by PowerShell

A topic by Aezart created Sep 13, 2020 Views: 699 Replies: 6
Viewing posts 1 to 3
(1 edit)

Just spent a few minutes trying to figure out why the web player wasn't finding index.html on the latest version of my game.

I'm on Windows 10, and it seems that if I archive my build with the usual right click -> send to -> compressed (zipped) folder, the web player handles it fine. But if I create the same archive using PowerShell's Compress-Archive command, the web player can't find index.html and fails to start.

Windows can extract both archives just fine, although I do notice the compressed size is slightly different (33326 KB for the PowerShell version, 33353 KB for the right click->send to compressed version).

Anyone else experience this issue?

Edit: The PowerShell command is 

$timestamp = $(Get-Date -UFormat "+%Y%m%dT%H%M%S")
cd build
Compress-Archive -Path "web\AKnightEternal" -DestinationPath AKE-web-$timestamp.zip
Moderator

Could you include the PowerShell command that you used? That might give a hint on what’s wrong.

Sure, It's:

$timestamp = $(Get-Date -UFormat "+%Y%m%dT%H%M%S")
cd build
Compress-Archive -Path "web\AKnightEternal" -DestinationPath AKE-web-$timestamp.zip

Which is the same folder I compress (web\AKnightEternal) when doing the right click->send to... compression.

Moderator

I’m not very familiar with PowerShell, but in the Linux command line shell, I’ve noticed that if you give a path for compression, it will include all folders inside, so your archive would include the folders “web” and “AKnightEternal”.

Could you try before the line with “Compress-Archive” to do:

cd web\AKnightEternal

And then on the “Compress-Archive” change the “-Path” to:

Compress-Archive -Path “.” -DestinationPath AKE-web-$timestamp.zip

This is just a guess, to see if that would work. You did mention that if you view both archives from the windows explorer they are both the same, but do they contain the same amount of folders? If that’s the issue, it would explain why Itch can’t detect the “index.html” file (since it’s not in the root folder) and it also explains why they have slightly different size.

Hope that was the issue.

Both my PowerShell and Windows Explorer builds have "AKnightEternal" as the top-level folder inside the archive, and the path to the index.html file is the same in both - AKnightEternal\www\index.html. Itch just can't find it there in the PowerShell version for some reason.

I'll give the changes you suggested a try when I get a chance, although I may wait until the game jam I've submitted this to is finished with judging since I've already got the Windows Explorer version of the zip uploaded and working.

Moderator

Sounds good, that’s the only thing I could think off unfortunately.

I always thought that the index file is meant to be in the root folder, but you mentioned it’s inside the “www” folder, which is inside the archive. It’s interesting that Itch can detect that when built from the windows explorer.

Anyway, I would suggest you investigate after the Jam is over, no reason to add extra problems when there’s a (I assume) tight deadline.

Moderator(+2)

I see you're trying to compress files under "web\AKnightEternal", i.e. two levels deep. The Itch server looks at most one level deep for index.html, so try to cd into "web" and only archive AKnightEternal.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.