Commit acf5f932 authored by RedArcaneArcher's avatar RedArcaneArcher
Browse files

check for manifest update when launching

parent 66604bd0
...@@ -181,11 +181,20 @@ namespace SunriseLauncher.ViewModels ...@@ -181,11 +181,20 @@ namespace SunriseLauncher.ViewModels
} }
} }
public void Launch() public async void Launch()
{ {
if (SelectedItem == null || SelectedItem.State != State.Ready) if (SelectedItem == null || SelectedItem.State != State.Ready)
return; return;
//check manifest has updated since app has opened
//even if this step fails, launch anyway in case manifest server is down
var updateResult = await fileUpdater.UpdateAsync(SelectedItem, false);
if (!updateResult.Success && !string.IsNullOrEmpty(updateResult.Message))
{
var msgbox = new MessageBoxView(updateResult.Message, "See log.txt for details.", false);
await msgbox.ShowDialog(Window);
}
var launch = SelectedItem.Metadata.LaunchOptions.FirstOrDefault(x => x.Name == SelectedItem.Launch); var launch = SelectedItem.Metadata.LaunchOptions.FirstOrDefault(x => x.Name == SelectedItem.Launch);
if (launch == null) if (launch == null)
return; return;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="300" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="300"
x:Class="SunriseLauncher.Views.MainWindow" x:Class="SunriseLauncher.Views.MainWindow"
Icon="/Assets/sunrise.ico" Icon="/Assets/sunrise.ico"
Title="Sunrise Launcher v0.0.2" Title="Sunrise Launcher v1.1.0"
Width="640" Height="360" MaxHeight="800"> Width="640" Height="360" MaxHeight="800">
<Window.Background> <Window.Background>
<ImageBrush Source="/Assets/background_top.png" AlignmentY="Top" DestinationRect="0,0,611,800" TileMode="Tile" Stretch="None" SourceRect="0,0,611,175"/> <ImageBrush Source="/Assets/background_top.png" AlignmentY="Top" DestinationRect="0,0,611,800" TileMode="Tile" Stretch="None" SourceRect="0,0,611,175"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment