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

Launching under Linux #2

Open
dewitpj opened this issue Jul 11, 2019 · 4 comments
Open

Launching under Linux #2

dewitpj opened this issue Jul 11, 2019 · 4 comments

Comments

@dewitpj
Copy link

dewitpj commented Jul 11, 2019

Hey,

After patching the .jar you need to launch the game using the wrapper, just "spacehaven", in the same directory as the .jar :)

@TBleader
Copy link

TBleader commented May 28, 2020

Some stuff you can do to help it run on linux:
Some paths for you to try. If you wish to support automagically searching steam libraries, going to the Steam/steamapps/ folder there is a file called 'libraryfolders.vdf' that contains the path to all steam libraries, excluding the steam install path. You could add a function to search those as well, as the path would be [librarypath]/steamapps/common/SpaceHaven/. I only have 1 library, but its a text file and it should be pretty easy to parse. I'd suggest also including the default steam install locations in the paths already, I added it for linux but I have no idea what it is for macos or windows (probably one of the program files folders).

    "../SpaceHaven/spacehaven",
    "../../SpaceHaven/spacehaven",
    "~/Games/SpaceHaven/spacehaven",
    ".local/share/Steam/steamapps/common/SpaceHaven/spacehaven",

in locateSpaceHaven:

            self.gamePath = path
            self.jarPath = os.path.join(os.path.dirname(path), "spacehaven.jar")
            self.modPath = os.path.join(os.path.dirname(path), "mods")

right after the path.endswith('.exe')

then changing browseForSpacehaven to include an all files will allow linux users to properly search for the executable, as it has no file extension, and using the jar excludes the option of having steam recognize it.

        self.locateSpacehaven(
            filedialog.askopenfilename(
                parent=self.master,
                title="Locate spacehaven",
                filetypes=[
                    ('spacehaven.exe', '*.exe'),
                    ('spacehaven.app', '*.app'),
                    ('spacehaven.jar', '*.jar'),
                    ('all files', '*'),
                ]
            )
        )

I didn't need to change any of the code for actually launching it, the subprocess.call is perfect, and if the path is the spacehaven executable file as it should be, provided the user has placed a steam_appid.txt. I notified the devs that they should add this file, so this might not be needed in the future either, but without it the game does launch fine it's just steam doesn't recognize it.

As for wrapping this up as a single executable, Pyinstaller supports linux. Then you could use StaticX to create a completely static file, such that the user doesn't need to download or install any libraries (this might not be required, I don't have a way to test if it is currently).

Hope this helps, let me know if you have any issues or questions! :)

@ronnocnave
Copy link

Adding my +1 to request a Linux version. Just shoot for Ubuntu (that's what Steam does). The community will take care of the rest. Thank you.

@Beanzilla
Copy link

Beanzilla commented Nov 21, 2021

Is a Linux version coming?

That is, is a Linux version of the mod loader coming? (Just to clarify)

@RandomLegend
Copy link

Can someone help me out here? I have absolutely no clue on how to use this on linux at all.

I dont have a .jar file in the release download at all. And when i open the directory in the terminal and try to execute either the modloader.py or setup.py it gives me some error for not finding some files.

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

No branches or pull requests

5 participants