Fix Native Game compiler installs

This commit is contained in:
Timothy Baldridge 2022-09-26 17:39:50 -06:00
parent b94e55c78b
commit 931733c49d
2 changed files with 42 additions and 32 deletions

View File

@ -3,6 +3,7 @@
#### Version - 3.0.1.6 - 9/??/2022 #### Version - 3.0.1.6 - 9/??/2022
* Fix Cyberpunk 2077 GoG recognition * Fix Cyberpunk 2077 GoG recognition
* Add a CLI command `list-games` to list all games recognized by WJ and their versions/locations * Add a CLI command `list-games` to list all games recognized by WJ and their versions/locations
* Fix Native Game compiler installs
#### Version - 3.0.1.5 - 9/26/2022 #### Version - 3.0.1.5 - 9/26/2022
* Fix MO2ArchiveName resolution * Fix MO2ArchiveName resolution

View File

@ -169,7 +169,11 @@ public class StandardInstaller : AInstaller<StandardInstaller>
private void CreateOutputMods() private void CreateOutputMods()
{ {
_configuration.Install.Combine("profiles") // Non MO2 Installs won't have this
var profileDir = _configuration.Install.Combine("profiles");
if (!profileDir.DirectoryExists()) return;
profileDir.Combine("profiles")
.EnumerateFiles() .EnumerateFiles()
.Where(f => f.FileName == Consts.SettingsIni) .Where(f => f.FileName == Consts.SettingsIni)
.Do(f => .Do(f =>
@ -331,13 +335,17 @@ public class StandardInstaller : AInstaller<StandardInstaller>
private void SetScreenSizeInPrefs() private void SetScreenSizeInPrefs()
{ {
var profilesPath = _configuration.Install.Combine("profiles");
if (_configuration.SystemParameters == null) if (_configuration.SystemParameters == null)
_logger.LogWarning("No SystemParameters set, ignoring ini settings for system parameters"); _logger.LogWarning("No SystemParameters set, ignoring ini settings for system parameters");
var config = new IniParserConfiguration {AllowDuplicateKeys = true, AllowDuplicateSections = true}; var config = new IniParserConfiguration {AllowDuplicateKeys = true, AllowDuplicateSections = true};
config.CommentRegex = new Regex(@"^(#|;)(.*)"); config.CommentRegex = new Regex(@"^(#|;)(.*)");
var oblivionPath = (RelativePath) "Oblivion.ini"; var oblivionPath = (RelativePath) "Oblivion.ini";
foreach (var file in _configuration.Install.Combine("profiles").EnumerateFiles()
if (profilesPath.DirectoryExists())
{
foreach (var file in profilesPath.EnumerateFiles()
.Where(f => ((string) f.FileName).EndsWith("refs.ini") || f.FileName == oblivionPath)) .Where(f => ((string) f.FileName).EndsWith("refs.ini") || f.FileName == oblivionPath))
try try
{ {
@ -370,6 +378,7 @@ public class StandardInstaller : AInstaller<StandardInstaller>
{ {
_logger.LogCritical(ex, "Skipping screen size remap for {file} due to parse error.", file); _logger.LogCritical(ex, "Skipping screen size remap for {file} due to parse error.", file);
} }
}
var tweaksPath = (RelativePath) "SSEDisplayTweaks.ini"; var tweaksPath = (RelativePath) "SSEDisplayTweaks.ini";
foreach (var file in _configuration.Install.EnumerateFiles() foreach (var file in _configuration.Install.EnumerateFiles()