Merge pull request 'fix/vaious-bugs' (#66) from waffle.lord/SPT-AKI-Installer:fix/vaious-bugs into master
Reviewed-on: CWX/SPT-AKI-Installer#66
This commit is contained in:
commit
be4ba865eb
@ -63,7 +63,9 @@ public partial class WhyCacheThoughDialog : UserControl
|
|||||||
|
|
||||||
if (!downloadsFolder.Exists)
|
if (!downloadsFolder.Exists)
|
||||||
{
|
{
|
||||||
AdditionalInfo = "Could not get downloads folder :(";
|
var message = "Could not get downloads folder :(";
|
||||||
|
Log.Error($"[MV_0] {message}");
|
||||||
|
AdditionalInfo = message;
|
||||||
AdditionalInfoColor = "red";
|
AdditionalInfoColor = "red";
|
||||||
_movePatcherState = -1;
|
_movePatcherState = -1;
|
||||||
return;
|
return;
|
||||||
@ -73,13 +75,15 @@ public partial class WhyCacheThoughDialog : UserControl
|
|||||||
|
|
||||||
if (_foundPatcher == null || !_foundPatcher.Exists)
|
if (_foundPatcher == null || !_foundPatcher.Exists)
|
||||||
{
|
{
|
||||||
AdditionalInfo =
|
var message = "Could not find a patcher file in your downloads folder";
|
||||||
"Could not find a patcher file in your downloads folder";
|
Log.Warning($"[MV_0] {message}");
|
||||||
|
AdditionalInfo = message;
|
||||||
|
|
||||||
AdditionalInfoColor = "red";
|
AdditionalInfoColor = "red";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.Information($"[MV_0] Found patcher for move: {_foundPatcher.Name}");
|
||||||
AdditionalInfo = $"Click again to move the below patcher file to the cache folder\n{_foundPatcher?.Name ?? "-SOMETHING WENT WRONG-"}";
|
AdditionalInfo = $"Click again to move the below patcher file to the cache folder\n{_foundPatcher?.Name ?? "-SOMETHING WENT WRONG-"}";
|
||||||
AdditionalInfoColor = "#FFC107";
|
AdditionalInfoColor = "#FFC107";
|
||||||
_movePatcherState = 1;
|
_movePatcherState = 1;
|
||||||
@ -89,7 +93,9 @@ public partial class WhyCacheThoughDialog : UserControl
|
|||||||
{
|
{
|
||||||
var cacheFilePath = Path.Join(DownloadCacheHelper.CachePath, "patcher");
|
var cacheFilePath = Path.Join(DownloadCacheHelper.CachePath, "patcher");
|
||||||
_foundPatcher?.MoveTo(cacheFilePath, true);
|
_foundPatcher?.MoveTo(cacheFilePath, true);
|
||||||
AdditionalInfo = "Patch was moved into cache :D";
|
var message = "Patcher was moved into cache :D";
|
||||||
|
Log.Information($"[MV_1] {message}");
|
||||||
|
AdditionalInfo = message;
|
||||||
AdditionalInfoColor = "ForestGreen";
|
AdditionalInfoColor = "ForestGreen";
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -99,6 +105,9 @@ public partial class WhyCacheThoughDialog : UserControl
|
|||||||
Log.Error(ex, "Failed to move downloaded patcher file into cache");
|
Log.Error(ex, "Failed to move downloaded patcher file into cache");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
Log.Error("[MV_ ] Move state is broken :(");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,13 +66,16 @@ public static class DownloadCacheHelper
|
|||||||
if (FileHashHelper.CheckHash(cacheFile, expectedHash))
|
if (FileHashHelper.CheckHash(cacheFile, expectedHash))
|
||||||
{
|
{
|
||||||
fileInCache = cacheFile;
|
fileInCache = cacheFile;
|
||||||
|
Log.Information("Hashes MATCH");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log.Warning("Hashes DO NOT MATCH");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch
|
catch(Exception ex)
|
||||||
{
|
{
|
||||||
|
Log.Error(ex, "Something went wrong during hashing");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,9 +25,6 @@ public class SetupClientTask : InstallerTaskBase
|
|||||||
|
|
||||||
var progress = new Progress<double>((d) => { SetStatus(null, null, (int)Math.Floor(d)); });
|
var progress = new Progress<double>((d) => { SetStatus(null, null, (int)Math.Floor(d)); });
|
||||||
|
|
||||||
|
|
||||||
if (_data.PatchNeeded)
|
|
||||||
{
|
|
||||||
SetStatus("Preparing 7z", "", null, ProgressStyle.Indeterminate);
|
SetStatus("Preparing 7z", "", null, ProgressStyle.Indeterminate);
|
||||||
|
|
||||||
if (!FileHelper.StreamAssemblyResourceOut("7z.dll", Path.Join(DownloadCacheHelper.CachePath, "7z.dll")))
|
if (!FileHelper.StreamAssemblyResourceOut("7z.dll", Path.Join(DownloadCacheHelper.CachePath, "7z.dll")))
|
||||||
@ -35,6 +32,8 @@ public class SetupClientTask : InstallerTaskBase
|
|||||||
return Result.FromError("Failed to prepare 7z");
|
return Result.FromError("Failed to prepare 7z");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_data.PatchNeeded)
|
||||||
|
{
|
||||||
// extract patcher files
|
// extract patcher files
|
||||||
SetStatus("Extrating Patcher", "", 0);
|
SetStatus("Extrating Patcher", "", 0);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
Details="{Binding SelectedPreCheck.Details}"
|
Details="{Binding SelectedPreCheck.Details}"
|
||||||
ActionButtonText="{Binding SelectedPreCheck.ActionButtonText}"
|
ActionButtonText="{Binding SelectedPreCheck.ActionButtonText}"
|
||||||
ActionCommand="{Binding SelectedPreCheck.ActionButtonCommand}"
|
ActionCommand="{Binding SelectedPreCheck.ActionButtonCommand}"
|
||||||
ShowAction="{Binding SelectedPreCheck.ActionButtonIsVisible}"
|
ShowAction="{Binding SelectedPreCheck.ShowActionButton}"
|
||||||
BarColor="{Binding SelectedPreCheck.BarColor}"
|
BarColor="{Binding SelectedPreCheck.BarColor}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user