message: Fixed several issues with arguments passed to Steam
diff: @@ -16,7 +16,17 @@ const exec = promisify(execCallback);
  export default class GameRunnerProviderImpl extends GameRunnerProvider {
  async getGameArguments(game: Game, profile: Profile): Promise<string | R2Error> {
  - return `Z:${await FsProvider.instance.realpath(path.join(Profile.getActiveProfile().getPathOfProfile(), "BepInEx", "core", "BepInEx.Preloader.dll"))}`;
  + try {
  + const isProton = await (GameDirectoryResolverProvider.instance as LinuxGameDirectoryResolver).isProtonGame(game);
  + const corePath = await FsProvider.instance.realpath(path.join(Profile.getActiveProfile().getPathOfProfile(), "BepInEx", "core"));
  + const preloaderPath = path.join(corePath,
  + (await FsProvider.instance.readdir(corePath))
  + .filter((x: string) => ["BepInEx.Preloader.dll", "BepInEx.IL2CPP.dll"].includes(x))[0]);
  + return `--doorstop-enable true --doorstop-target "${isProton ? 'Z:' : ''}${preloaderPath}"`;
  + } catch (e) {
  + const err: Error = e;
  + return new R2Error("Failed to find preloader dll", err.message, "BepInEx may not installed correctly. Further help may be required.");
  + }
  }
  public async startModded(game: Game): Promise<void | R2Error> {
  @@ -34,20 +44,22 @@ export default class GameRunnerProviderImpl extends GameRunnerProvider {
  try {
  for (const shFile of shFiles) {
  - await FsProvider.instance.chmod(shFile, 0o755);
  + console.log("SH:", shFile);
  + await FsProvider.instance.chmod(await FsProvider.instance.realpath(path.join(Profile.getActiveProfile().getPathOfProfile(), shFile)), 0o755);
  }
  } catch (e) {
  const err: Error = e;
  return new R2Error("Failed to make sh file executable", err.message, "You may need to run the manager with elevated privileges.");
  }
  - extraArguments = `--r2profile "${Profile.getActiveProfile().getProfileName()}" --doorstop-dll-search-override "${path.join(Profile.getActiveProfile().getProfileName(), "unstripped_corlib")}"`;
  + extraArguments = `--r2profile "${Profile.getActiveProfile().getProfileName()}" --doorstop-dll-search-override "${await FsProvider.instance.realpath(path.join(Profile.getActiveProfile().getPathOfProfile(), "unstripped_corlib"))}"`;
  }
  - const doorstopTarget = (isProton ? 'Z:' : '') +
  - await FsProvider.instance.realpath(path.join(Profile.getActiveProfile().getPathOfProfile(), "BepInEx", "core", "BepInEx.Preloader.dll"));
  -
  + const target = await this.getGameArguments(game, Profile.getActiveProfile());
  + if (target instanceof R2Error) {
  + return target;
  + }
  - return this.start(game, `--doorstop-enable true --doorstop-target "${doorstopTarget}" ${extraArguments}`);
  + return this.start(game, `${target} ${extraArguments}`);
  }
  public startVanilla(game: Game): Promise<void | R2Error> {
  