Compare commits

..

No commits in common. "0c6ce9e681eb5d26666f0bdd39bf787f23397429" and "074ac6e826a1bfa5b4f45f47eeedb45498be710a" have entirely different histories.

6 changed files with 17 additions and 72 deletions

View File

@ -20,7 +20,6 @@
<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>

View File

@ -12,7 +12,7 @@ namespace SPTInstaller;
public partial class App : Application public partial class App : Application
{ {
public static string LogPath = Path.Join(Environment.CurrentDirectory, "spt-installer.log"); private readonly string _logPath = Path.Join(Environment.CurrentDirectory, "spt-installer_.log");
public override void Initialize() public override void Initialize()
{ {
@ -21,8 +21,9 @@ 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) =>
@ -41,8 +42,9 @@ 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());

View File

@ -66,29 +66,22 @@ public class ReleaseCheckTask : InstallerTaskBase
if (intGameVersion < intSPTVersion) if (intGameVersion < intSPTVersion)
{ {
return Result.FromError("Your live EFT is out of date. Please update it using the BSG Launcher then run the SPT Installer again"); return Result.FromError("Your client is outdated. Please update EFT using your BSG Launcher");
} }
if (intGameVersion == intSPTVersion) if (intGameVersion == intSPTVersion)
{ {
patchNeedCheck = false; patchNeedCheck = false;
} }
bool sptClientIsOutdated = intSPTVersion != patchMirrorInfo.TargetClientVersion && patchNeedCheck; if ((intGameVersion != patchMirrorInfo.SourceClientVersion ||
bool liveClientIsOutdated = intGameVersion != patchMirrorInfo.SourceClientVersion && patchNeedCheck; intSPTVersion != patchMirrorInfo.TargetClientVersion) && 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(
"Could not find a downgrade patcher for the version of EFT you have installed." + "We 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;

View File

@ -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.71</AssemblyVersion> <AssemblyVersion>2.70</AssemblyVersion>
<FileVersion>2.71</FileVersion> <FileVersion>2.70</FileVersion>
<Company>SPT</Company> <Company>SPT</Company>
</PropertyGroup> </PropertyGroup>

View File

@ -6,9 +6,6 @@ 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;
@ -46,47 +43,6 @@ 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
@ -108,7 +64,6 @@ public class MessageViewModel : ViewModelBase
{ {
ShowCloseButton = showCloseButton; ShowCloseButton = showCloseButton;
Message = result.Message; Message = result.Message;
ClipCommandText = "Copy installer log to clipboard";
Task.Run(() => Task.Run(() =>
{ {

View File

@ -15,7 +15,7 @@
</UserControl.Styles> </UserControl.Styles>
<Grid ColumnDefinitions="*,AUTO,*" RowDefinitions="*,AUTO,20,AUTO,20,Auto,*" <Grid ColumnDefinitions="*,AUTO,*" RowDefinitions="*,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"
@ -34,12 +34,8 @@
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalContentAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Center"
Padding="20 10" /> Padding="20 10" />
<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" <cc:CacheInfo Grid.Row="4" 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>