Delete install path on install error
This commit is contained in:
parent
cb770f8dab
commit
f05005460f
1 changed files with 24 additions and 14 deletions
|
@ -101,6 +101,8 @@ namespace LANCommander.PlaynitePlugin
|
|||
var destination = Path.Combine(Plugin.Settings.InstallDirectory, game.Title.SanitizeFilename());
|
||||
|
||||
Plugin.PlayniteApi.Dialogs.ActivateGlobalProgress(progress =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Directory.CreateDirectory(destination);
|
||||
progress.ProgressMaxValue = 100;
|
||||
|
@ -122,6 +124,14 @@ namespace LANCommander.PlaynitePlugin
|
|||
Overwrite = true
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (Directory.Exists(destination))
|
||||
{
|
||||
Directory.Delete(destination, true);
|
||||
}
|
||||
}
|
||||
},
|
||||
new GlobalProgressOptions($"Downloading {game.Title}...")
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue