Import already-installed games
This commit is contained in:
parent
664dfaa6ad
commit
beeb79366b
1 changed files with 19 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using LANCommander.Client.Data.Models;
|
||||
using LANCommander.Client.Models;
|
||||
using LANCommander.SDK.Helpers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
|
@ -273,6 +274,24 @@ namespace LANCommander.Client.Services
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region Check Installation Status
|
||||
var installDirectory = Client.Games.GetInstallDirectory(remoteGame);
|
||||
|
||||
if (Directory.Exists(installDirectory))
|
||||
{
|
||||
var manifestLocation = ManifestHelper.GetPath(installDirectory, remoteGame.Id);
|
||||
|
||||
if (File.Exists(manifestLocation))
|
||||
{
|
||||
var manifest = ManifestHelper.Read(installDirectory, remoteGame.Id);
|
||||
|
||||
localGame.Installed = true;
|
||||
localGame.InstallDirectory = installDirectory;
|
||||
localGame.InstalledVersion = manifest.Version;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
if (localGame.Id == Guid.Empty)
|
||||
{
|
||||
localGame.Id = remoteGame.Id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue