Skip to content

Commit

Permalink
Fix issues with no installation of Steam. Allows for broader Desktop …
Browse files Browse the repository at this point in the history
…use.
  • Loading branch information
Soapwood committed Aug 1, 2024
1 parent 528f300 commit 324890d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
14 changes: 11 additions & 3 deletions VXMusicDesktop/Core/SteamVROverlayAppsInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class SteamVROverlayAppsInterface

private string SteamAppConfigPath;
private string SteamInstallPath;

public bool SteamAppConfigPathExists => Directory.Exists(SteamAppConfigPath);
public bool SteamInstallPathExists => Directory.Exists(SteamInstallPath);

private static readonly string SteamRegistryValue = "SteamPath";
private static readonly string SteamRegistryKey = @"HKEY_CURRENT_USER\Software\Valve\Steam";
Expand All @@ -31,8 +34,9 @@ public SteamVROverlayAppsInterface(IServiceProvider serviceProvider)
_logger.LogTrace("Creating SteamVROverlayAppsInterface.");

SteamInstallPath = GetSteamInstallationPath();

SteamAppConfigPath = Path.GetFullPath(Path.Combine(SteamInstallPath, "config", "appconfig.json"));

if(!string.IsNullOrEmpty(SteamInstallPath))
SteamAppConfigPath = Path.GetFullPath(Path.Combine(SteamInstallPath, "config", "appconfig.json"));
}

public bool InstallVxMusicAsSteamVrOverlay()
Expand All @@ -44,6 +48,10 @@ public bool InstallVxMusicAsSteamVrOverlay()
public bool IsManifestEntryInAppConfig()
{
_logger.LogDebug("Checking if VXMusic is already added as a SteamVR Overlay..");

if (!SteamAppConfigPathExists)
return false;

var (manifestPaths, _) = ReadContentsOfAppConfig();
return SteamVrManifestPathExistsInAppConfig(manifestPaths, SteamAppConfigPath);
}
Expand All @@ -62,7 +70,7 @@ private string GetSteamInstallationPath()
_logger.LogError(ex.Message);
}

return DefaultSteamAppConfigPath;
return "";
}

private bool AddManifestEntryToAppConfig(string vxMusicManifestFile)
Expand Down
6 changes: 6 additions & 0 deletions VXMusicDesktop/MVVM/ViewModel/OverlayViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ public void InstallVxMusicAsSteamVrOverlay(object commandParameter)
{
if (!IsManifestEntryAlreadyInAppConfig)
{
if (!App.VXMusicSession.SteamVrOverlayApps.SteamInstallPathExists)
{
MessageBox.Show("Steam is not installed!", "Warning", MessageBoxButton.OK, MessageBoxImage.Warning);
return;
}

if (App.VXMusicSession.SteamVrOverlayApps.InstallVxMusicAsSteamVrOverlay())
{
IsManifestEntryAlreadyInAppConfig = true;
Expand Down
2 changes: 1 addition & 1 deletion VXMusicDesktop/VXMusicDesktop.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<PackageIcon>VXLogo.png</PackageIcon>
<ApplicationIcon>Images\VXLogoIcon.ico</ApplicationIcon>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<Version>0.6.5.1</Version>
<Version>0.6.5.2</Version>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<Title>VXMusicDesktop</Title>
<Authors>VirtualXtensions</Authors>
Expand Down

0 comments on commit 324890d

Please sign in to comment.