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

Added Itch manifest & launch configs #14703

Closed
wants to merge 5 commits into from
Closed

Conversation

aaronfranke
Copy link

@aaronfranke aaronfranke commented Jan 10, 2018

Part of solving #14214

  • .itch.toml is the main manifest file. This is the main thing I'm adding. It contains information about how to launch the game. The os property currently does nothing, but in the future ( Added optional OS field for App Manifests  itchio/itch#1605), it will make only the relevant options for your operating system show up.

  • .itch/isolate-app.profile is required for the Itch sandbox. Ignore the entire .itch folder as Butler ignores it and it should be treated as temporary files.

  • mono and mono-macos are is a symlinks to Mono on Linux and MacOS. The Itch app sets the working directory to the location of the executable, so directly linking to Mono in .itch.toml is not an option. The solution is simply to create symlinks to mono in the OpenRA directory, as I've done.

  • These files do not cause any problems when launching OpenRA without the Itch app.

I have not actually tested this on MacOS, since I do not own a Mac. I got the Mono path from StackOverflow. However, I have high confidence it will work, since it's a similar method to launching on Linux.

@pchote
Copy link
Member

pchote commented Jan 10, 2018

I’m not sure how the itch side of things works, but from the OpenRA side launching OpenRA.Game.exe directly is a bad idea. This bypasses all the platform specific shims in their respective launchers, which means no crash handing, no application icons and incorrect names, pinning to taskbar/dock/launcher leaves broken shortcuts that crash on launch, plus a few smaller issues. Can you please make this run the platform launchers instead? You should then be able to drop the mono symlinks.

.itch.toml Outdated

[[actions]]
os = "windows"
name = "Tiberian Sun - Windows"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please remove these? Tiberian Sun is not ready for a public release.

@aaronfranke
Copy link
Author

Can you clarify, what are the platform launchers?

@pchote
Copy link
Member

pchote commented Jan 10, 2018

The .app bundles on macOS, /usr/(bin|games)/openra-(cnc|d2k|ra) on linux, and (RedAlert|TiberianDawn|Dune2000).exe on windows. They are generated as part of the package creation scripts.

@aaronfranke
Copy link
Author

aaronfranke commented Jan 10, 2018

For Windows launchers: Sure!

/usr/(bin|games)/openra-(cnc|d2k|ra) on linux

No, I can't just run these, not directly. These files existing depend on OpenRA being installed through the system's package manager, and they point to /usr/lib/openra. Releasing OpenRA builds through Itch means that you launch the version that downloads to the Itch app directory (~/.config/itch/apps/OpenRA on Linux and the equivalent paths on Windows and Mac).

What I can do is copy-paste these launch scripts, place them in the OpenRA directory (I can hide them in a subdir), and commit them along with this patch. However, you mentioned that they are generated, so I am wondering if copy-pasting them is the wrong approach.

Would the MacOS .app bundles be included within the game folder like on Windows?

@pchote
Copy link
Member

pchote commented Jan 10, 2018

The app bundles wrap the game directory plus other macOS specific files into a self contained portable application. Think of them like the Linux .appimage format, which was modeled after them.

@aaronfranke
Copy link
Author

Itch doesn't seem to like it when I pass it a Linux shell script directly. itchio/itch#1608

Windows and Mac now use launchers. The concept of pinning doesn't exist on many Linux DEs, and almost certainly not for pinning the launcher script with an icon. I've also experimented with calling .desktop files, which has issues without absolute paths. Launching on Linux the way it's currently set up with mono etc is probably the best way to go about it, as it's consistent and robust.

@pchote
Copy link
Member

pchote commented Jan 10, 2018

How does itch get the game files for these entries to launch?

@pchote
Copy link
Member

pchote commented Jan 10, 2018

Even without pinning, launching the Game.exe directly will still omit the icons and titles from the launcher and window switch menus, or am I missing something?

@aaronfranke
Copy link
Author

aaronfranke commented Jan 10, 2018

In the future (#11352) we can set up Itch's butler utility to automatically upload built game files. We would add this to the build scripts. Until then, we can upload ZIP files of builds through a web browser.

openra

On my system, this is what OpenRA looks like, when launched from the shell script /usr/games/openra-ra and /usr/share/applications/openra-ra.desktop installed with the .deb package from the website, and also when launched with mono OpenRA.Game.exe Game.Mod=ra from Itch. I'm pretty sure the icon on Linux depends on the executable and not the launch method.

Bottom line, mono OpenRA.Game.exe Game.Mod=ra is just as icon-y as it currently is with the .deb.

Butler ignores it, so should we: itchio/itch#1607
@pchote
Copy link
Member

pchote commented Jan 10, 2018

Bottom line, mono OpenRA.Game.exe Game.Mod=ra is just as icon-y as it currently is with the .deb.

This isn't how we expect people to run OpenRA from the deb! The icon is tied to the desktop file, which is then tied to the launcher script. These can of course be modified for the itch wrapper.

@aaronfranke
Copy link
Author

At least in my desktop environment, launching with the .desktop file doesn't add an icon to the taskbar.

@aaronfranke
Copy link
Author

aaronfranke commented Jan 10, 2018

I should clarify, I did not mean to say that you expect users to launch with mono OpenRA.Game.exe when installed with the deb. I know the .desktop tied to the script is intended. I am just saying that once Itch launches via mono OpenRA.Game.exe, vs the .desktop, the results are identical.

Anyway, basically the only error handling the script really does, on Linux at least, is say "I crashed, want to view help?". I already set up the manual/wiki as a launch option. So really the only reason we'd want to use the existing launch systems is for the icon, which the script doesn't do...

@aaronfranke
Copy link
Author

aaronfranke commented Jan 21, 2018

I believe this is merge-able as-is. It currently works fine. We can make tweaks later, if necessary.

@pchote
Copy link
Member

pchote commented Jan 22, 2018

Can you please outline the steps to get OpenRA with the metadata file imported and running inside itch? This will have important implications on where the files are supposed to live and how they interact with the rest of our code - having this manifest in the root of the project dir is probably not correct (all the deployment bits go in packaging).

I have been assuming that this is going to need its own packaging "platform" to generate a (or ideally one per platform) zip or tarball that could be consumed by the itch backend. Am I missing something?

@aaronfranke
Copy link
Author

Eventually, when we set up Itch.io butler in some part of the build process:

  1. The files to be uploaded to Itch, for each platform, go to their own folder. Not a zip.

  2. We push these to Itch using their butler utility.

We definitely could do something where these files are placed in a subfolder in packaging, then copied to the main game directory when generating and uploading Itch builds. See latest commit.

@aaronfranke
Copy link
Author

Do not merge for now. The creator of Itch is looking into better methods of handling Mono games, dependencies, and launching mechanisms.

itchio/itch#1606

itchio/itch#1642

@pchote
Copy link
Member

pchote commented Apr 29, 2018

@aaronfranke does the new AppImage packaging in #15086 make this any easier for you?
We could potentially also port over the -winportable packaging from the Mod SDK (basically just a zip file with the contents of what would be installed to Program Files), which would then provide "portable" bundles for all platforms that Itch could download and chain through to.

@aaronfranke
Copy link
Author

@pchote It very likely will. We still need Mono installed, so we still need Itch to add Mono to their list of prerequisites for best compatibility, but we should be able to fix everything on OpenRA's end for users that have Mono manually installed.

I'll look into it sometime this week.

@pchote
Copy link
Member

pchote commented Apr 29, 2018

The AppImages include a startup check for mono and show a gui error if it isn't available.

@pchote
Copy link
Member

pchote commented May 21, 2018

Any progress here @aaronfranke? Shall we close this PR until the itch-side dependencies are sorted out?

@aaronfranke
Copy link
Author

Yeah, it'd be best to wait and see what Itch does in regards to Mono support. Closing, for now.

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

Successfully merging this pull request may close these issues.

None yet

3 participants