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

Extend -single-instance fix to 1.9 #3001

Merged
merged 3 commits into from
Feb 12, 2020

Conversation

DasSkelett
Copy link
Member

Problem

#2902, which was fixed for KSP 1.8 in #2931, still applies to KSP 1.9 unfortunately:

Set current directory to /HDD/KubuntuSteamGames/steamapps/common/Kerbal Space Program
Found path: /HDD/KubuntuSteamGames/steamapps/common/Kerbal Space Program/KSP.x86_64
Speicherzugriffsfehler (Speicherabzug geschrieben)

(Now you know the German translation for a segmentation fault)

Changes

The version range for which we remove the -single-instance command has been extended to include 1.9.

I created a new helper function which allows to create a KspVersionRange from two KspVersion objects. The resulting version range extends from the lowest possible version of the first argument to the highest possible version of the second argument.
It uses the KspVersion->KspVersionRange logic from kspversion.ToVersionRange().

@DasSkelett DasSkelett added Enhancement New features or functionality GUI Issues affecting the interactive GUI Linux Issues specific for Linux labels Feb 12, 2020
@DasSkelett DasSkelett requested a review from HebaruSan February 12, 2020 20:28
@DasSkelett DasSkelett force-pushed the fix/single-instance-fix-1.9 branch from 8e67825 to 162a07c Compare February 12, 2020 20:48
@DasSkelett DasSkelett force-pushed the fix/single-instance-fix-1.9 branch from 162a07c to db33493 Compare February 12, 2020 21:02
@DasSkelett
Copy link
Member Author

DasSkelett commented Feb 12, 2020

Thanks for the suggestions!
I also added a test, while this might be implicitly tested in tests for the StrictGameComparator, explicit ones are a good idea.
(Without the test this PR reduces the code size :P)

Copy link
Member

@HebaruSan HebaruSan left a comment

Choose a reason for hiding this comment

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

Nice! Want to try merging your own changes to master?

@DasSkelett
Copy link
Member Author

No risk no fun 😁

DasSkelett added a commit that referenced this pull request Feb 12, 2020
@DasSkelett DasSkelett merged commit db33493 into KSP-CKAN:master Feb 12, 2020
@DasSkelett DasSkelett deleted the fix/single-instance-fix-1.9 branch February 12, 2020 21:22
@HebaruSan
Copy link
Member

@DasSkelett
Copy link
Member Author

Oh, thanks! Also: System.ComponentModel.Win32Exception (0x80004005): Cannot find the specified file 🙄

And xdg-open doesn't want to open binaries, so Utilities.ProcessStartURL is out:

Bei der Datei file:///NAS/games/KubuntuGames/steamapps/common/Kerbal Space Program/./KSP.x86_64 handelt es sich um ein ausführbares Programm. Es wird aus Sicherheitsgründen nicht gestartet.

Rough translation:

The file "file:///NAS/games/KubuntuGames/steamapps/common/Kerbal Space Program/./KSP.x86_64" is an executable program. It won't be started for security reasons.

We'll have to find yet another workaround for this...

@DasSkelett
Copy link
Member Author

Well, this is weird. I don't know how I got the Win23Exception to show up earlier, but it's not happening anymore.
So we should be fine just extending the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New features or functionality GUI Issues affecting the interactive GUI Linux Issues specific for Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants