Compare commits
5 Commits
074ac6e826
...
0c6ce9e681
Author | SHA1 | Date | |
---|---|---|---|
0c6ce9e681 | |||
ccc91b09f6 | |||
9b3d9fd755 | |||
2110b185d2 | |||
|
918106a469 |
1
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
1
.idea/.idea.SPTInstaller/.idea/avalonia.xml
generated
@ -20,6 +20,7 @@
|
|||||||
<entry key="SPTInstaller/CustomControls/UpdateInfoCard.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/CustomControls/UpdateInfoCard.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/Views/DetailedPreChecksView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/Views/DetailedPreChecksView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/Views/MainWindow.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/Views/MainWindow.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
|
<entry key="SPTInstaller/Views/MessageView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
<entry key="SPTInstaller/Views/PreChecksView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
<entry key="SPTInstaller/Views/PreChecksView.axaml" value="SPTInstaller/SPTInstaller.csproj" />
|
||||||
</map>
|
</map>
|
||||||
</option>
|
</option>
|
||||||
|
@ -12,7 +12,7 @@ namespace SPTInstaller;
|
|||||||
|
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
private readonly string _logPath = Path.Join(Environment.CurrentDirectory, "spt-installer_.log");
|
public static string LogPath = Path.Join(Environment.CurrentDirectory, "spt-installer.log");
|
||||||
|
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
@ -21,9 +21,8 @@ public partial class App : Application
|
|||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Information()
|
.MinimumLevel.Information()
|
||||||
.WriteTo
|
.WriteTo
|
||||||
.File(path: _logPath,
|
.File(path: LogPath,
|
||||||
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Information,
|
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Information)
|
||||||
rollingInterval: RollingInterval.Day)
|
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
RxApp.DefaultExceptionHandler = Observer.Create<Exception>((exception) =>
|
RxApp.DefaultExceptionHandler = Observer.Create<Exception>((exception) =>
|
||||||
@ -42,9 +41,8 @@ public partial class App : Application
|
|||||||
Log.Logger = new LoggerConfiguration()
|
Log.Logger = new LoggerConfiguration()
|
||||||
.MinimumLevel.Debug()
|
.MinimumLevel.Debug()
|
||||||
.WriteTo
|
.WriteTo
|
||||||
.File(path: _logPath,
|
.File(path: LogPath,
|
||||||
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Debug,
|
restrictedToMinimumLevel: Serilog.Events.LogEventLevel.Debug)
|
||||||
rollingInterval: RollingInterval.Day)
|
|
||||||
.CreateLogger();
|
.CreateLogger();
|
||||||
|
|
||||||
System.Diagnostics.Trace.Listeners.Add(new SerilogTraceListener.SerilogTraceListener());
|
System.Diagnostics.Trace.Listeners.Add(new SerilogTraceListener.SerilogTraceListener());
|
||||||
|
@ -66,7 +66,7 @@ public class ReleaseCheckTask : InstallerTaskBase
|
|||||||
|
|
||||||
if (intGameVersion < intSPTVersion)
|
if (intGameVersion < intSPTVersion)
|
||||||
{
|
{
|
||||||
return Result.FromError("Your client is outdated. Please update EFT using your BSG Launcher");
|
return Result.FromError("Your live EFT is out of date. Please update it using the BSG Launcher then run the SPT Installer again");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intGameVersion == intSPTVersion)
|
if (intGameVersion == intSPTVersion)
|
||||||
@ -74,14 +74,21 @@ public class ReleaseCheckTask : InstallerTaskBase
|
|||||||
patchNeedCheck = false;
|
patchNeedCheck = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((intGameVersion != patchMirrorInfo.SourceClientVersion ||
|
bool sptClientIsOutdated = intSPTVersion != patchMirrorInfo.TargetClientVersion && patchNeedCheck;
|
||||||
intSPTVersion != patchMirrorInfo.TargetClientVersion) && patchNeedCheck)
|
bool liveClientIsOutdated = intGameVersion != patchMirrorInfo.SourceClientVersion && patchNeedCheck;
|
||||||
|
|
||||||
|
if (liveClientIsOutdated)
|
||||||
|
{
|
||||||
|
return Result.FromError("Your live EFT is out of date. Please update it using the BSG Launcher then run the SPT Installer again");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sptClientIsOutdated)
|
||||||
{
|
{
|
||||||
return Result.FromError(
|
return Result.FromError(
|
||||||
"We could not find a downgrade patcher for the version of EFT you have installed." +
|
"Could not find a downgrade patcher for the version of EFT you have installed." +
|
||||||
"\nThis can happen due to one of the following reasons:" +
|
"\nThis can happen due to one of the following reasons:" +
|
||||||
"\n* Live EFT just updated. The SPT team will create a new patcher within 24 hours, hold tight!" +
|
"\n* Live EFT just updated. The SPT team will create a new patcher within 24 hours, hold tight!" +
|
||||||
"\n* Live EFT just updated. You have not installed it on your computer using the BSG launcher.");
|
"\n* Live EFT just updated. You have not installed it on your computer using the BSG launcher");
|
||||||
}
|
}
|
||||||
|
|
||||||
_data.PatchNeeded = patchNeedCheck;
|
_data.PatchNeeded = patchNeedCheck;
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
<PackageIcon>icon.ico</PackageIcon>
|
<PackageIcon>icon.ico</PackageIcon>
|
||||||
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release;TEST</Configurations>
|
<Configurations>Debug;Release;TEST</Configurations>
|
||||||
<AssemblyVersion>2.70</AssemblyVersion>
|
<AssemblyVersion>2.71</AssemblyVersion>
|
||||||
<FileVersion>2.70</FileVersion>
|
<FileVersion>2.71</FileVersion>
|
||||||
<Company>SPT</Company>
|
<Company>SPT</Company>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
@ -6,6 +6,9 @@ using SPTInstaller.Helpers;
|
|||||||
using SPTInstaller.Interfaces;
|
using SPTInstaller.Interfaces;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
|
using Avalonia.Input;
|
||||||
|
using Avalonia.Platform.Storage;
|
||||||
|
|
||||||
namespace SPTInstaller.ViewModels;
|
namespace SPTInstaller.ViewModels;
|
||||||
|
|
||||||
@ -43,6 +46,47 @@ public class MessageViewModel : ViewModelBase
|
|||||||
set => this.RaiseAndSetIfChanged(ref _cacheInfoText, value);
|
set => this.RaiseAndSetIfChanged(ref _cacheInfoText, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string _clipCommandText;
|
||||||
|
|
||||||
|
public string ClipCommandText
|
||||||
|
{
|
||||||
|
get => _clipCommandText;
|
||||||
|
set => this.RaiseAndSetIfChanged(ref _clipCommandText, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand CopyLogFileToClipboard => ReactiveCommand.CreateFromTask(async () =>
|
||||||
|
{
|
||||||
|
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (desktop.MainWindow?.Clipboard == null)
|
||||||
|
{
|
||||||
|
ClipCommandText = "Could not get clipboard :(";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var dataObject = new DataObject();
|
||||||
|
var logFile = await desktop.MainWindow.StorageProvider.TryGetFileFromPathAsync(App.LogPath);
|
||||||
|
|
||||||
|
if (logFile == null)
|
||||||
|
{
|
||||||
|
ClipCommandText = "Could not get log file :(";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dataObject.Set(DataFormats.Files, new[] {logFile});
|
||||||
|
|
||||||
|
await desktop.MainWindow.Clipboard.SetDataObjectAsync(dataObject);
|
||||||
|
ClipCommandText = "Copied!";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
ClipCommandText = ex.Message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
private StatusSpinner.SpinnerState _cacheCheckState;
|
private StatusSpinner.SpinnerState _cacheCheckState;
|
||||||
|
|
||||||
public StatusSpinner.SpinnerState CacheCheckState
|
public StatusSpinner.SpinnerState CacheCheckState
|
||||||
@ -64,6 +108,7 @@ public class MessageViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
ShowCloseButton = showCloseButton;
|
ShowCloseButton = showCloseButton;
|
||||||
Message = result.Message;
|
Message = result.Message;
|
||||||
|
ClipCommandText = "Copy installer log to clipboard";
|
||||||
|
|
||||||
Task.Run(() =>
|
Task.Run(() =>
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
</UserControl.Styles>
|
</UserControl.Styles>
|
||||||
|
|
||||||
<Grid ColumnDefinitions="*,AUTO,*" RowDefinitions="*,AUTO,20,AUTO,*"
|
<Grid ColumnDefinitions="*,AUTO,*" RowDefinitions="*,AUTO,20,AUTO,20,Auto,*"
|
||||||
Classes.error="{Binding HasErrors}">
|
Classes.error="{Binding HasErrors}">
|
||||||
|
|
||||||
<Label Grid.Column="1" Grid.Row="1"
|
<Label Grid.Column="1" Grid.Row="1"
|
||||||
@ -35,7 +35,11 @@
|
|||||||
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
|
VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
|
||||||
Padding="20 10" />
|
Padding="20 10" />
|
||||||
|
|
||||||
<cc:CacheInfo Grid.Row="4" Grid.ColumnSpan="3" Padding="10" Margin="10 0 0 0"
|
<Button Grid.Row="5" Grid.Column="1" Classes="link" Content="{Binding ClipCommandText}"
|
||||||
|
Command="{Binding CopyLogFileToClipboard}" HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<cc:CacheInfo Grid.Row="6" Grid.ColumnSpan="3" Padding="10" Margin="10 0 0 0"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
InfoText="{Binding CacheInfoText}" State="{Binding CacheCheckState}" />
|
InfoText="{Binding CacheInfoText}" State="{Binding CacheCheckState}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user