Skip to content

Commit 9631626

Browse files
committed
Include environment variables in the heroic output
1 parent b9708ae commit 9631626

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org).
66

7-
## [Unreleased](https://github.com/erri120/GameFinder/compare/v4.4.0...HEAD)
7+
## [Unreleased](https://github.com/erri120/GameFinder/compare/v4.6.2...HEAD)
88

99
## [Released](https://github.com/erri120/GameFinder/releases)
1010

11+
## [4.6.2](https://github.com/erri120/GameFinder/compare/v4.6.1...v4.6.2) - 2025-04-22
12+
13+
- Heroic: include environment variables in the output
14+
1115
## [4.6.1](https://github.com/erri120/GameFinder/compare/v4.6.0...v4.6.1) - 2025-04-14
1216

1317
- Steam: fix escape sequences in local user config files

src/GameFinder.Launcher.Heroic/DTOs/Json.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal record LinuxGameConfig(
3131
[property: JsonPropertyName("enableMsync")] bool EnableMsync,
3232
[property: JsonPropertyName("enableFsync")] bool EnableFsync,
3333
[property: JsonPropertyName("nvidiaPrime")] bool NvidiaPrime,
34-
[property: JsonPropertyName("enviromentOptions")] IReadOnlyList<object> EnviromentOptions,
34+
[property: JsonPropertyName("enviromentOptions")] IReadOnlyList<EnvironmentOption> EnvironmentOptions,
3535
[property: JsonPropertyName("wrapperOptions")] IReadOnlyList<object> WrapperOptions,
3636
[property: JsonPropertyName("showFps")] bool ShowFps,
3737
[property: JsonPropertyName("useGameMode")] bool UseGameMode,
@@ -45,6 +45,11 @@ internal record LinuxGameConfig(
4545
[property: JsonPropertyName("wineCrossoverBottle")] string WineCrossoverBottle
4646
);
4747

48+
public record EnvironmentOption(
49+
[property: JsonPropertyName("key")] string Key,
50+
[property: JsonPropertyName("value")] string Value
51+
);
52+
4853
public record WineVersion(
4954
[property: JsonPropertyName("bin")] string Bin,
5055
[property: JsonPropertyName("name")] string Name,

src/GameFinder.Launcher.Heroic/HeroicGOGGame.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System.Collections.Generic;
12
using System.Runtime.InteropServices;
23
using GameFinder.StoreHandlers.GOG;
34
using GameFinder.Wine;
@@ -34,4 +35,4 @@ public record HeroicGOGGame(
3435
}
3536

3637
[PublicAPI]
37-
public record WineData(AbsolutePath WinePrefixPath, DTOs.WineVersion WineVersion);
38+
public record WineData(AbsolutePath WinePrefixPath, IReadOnlyDictionary<string, string> EnvironmentVariables, DTOs.WineVersion WineVersion);

src/GameFinder.Launcher.Heroic/HeroicGOGHandler.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,16 @@ internal OneOf<WineData, ErrorMessage> GetWineData(DTOs.Installed installed, Abs
145145

146146
var winePrefixPath = _fileSystem.FromUnsanitizedFullPath(gameConfig.WinePrefix);
147147

148-
return new WineData(winePrefixPath, gameConfig.WineVersion);
148+
var environmentOptions = new Dictionary<string, string>(comparer: StringComparer.OrdinalIgnoreCase);
149+
if (gameConfig.EnvironmentOptions is not null && gameConfig.EnvironmentOptions.Count > 0)
150+
{
151+
foreach (var option in gameConfig.EnvironmentOptions)
152+
{
153+
environmentOptions[option.Key] = option.Value;
154+
}
155+
}
156+
157+
return new WineData(winePrefixPath, environmentOptions, gameConfig.WineVersion);
149158
}
150159

151160
internal static AbsolutePath GetLinuxGamesConfigJsonFile(AbsolutePath configPath, string name)

0 commit comments

Comments
 (0)