Skip to content
This repository has been archived by the owner on Jan 8, 2022. It is now read-only.

Commit

Permalink
Auto Updates
Browse files Browse the repository at this point in the history
Console and GUI are joined
  • Loading branch information
SuperJMN committed Feb 23, 2019
1 parent 289453a commit 1ab6223
Show file tree
Hide file tree
Showing 18 changed files with 91 additions and 45 deletions.
6 changes: 3 additions & 3 deletions Source/Deployer.Raspberry.Console/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
</configuration>
</configuration>
2 changes: 1 addition & 1 deletion Source/Deployer.Raspberry.Console/ConsoleDisplayUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;

namespace Deployment.Console
namespace Deployer.Raspberry.Console
{
public class ConsoleDisplayUpdater : IDisposable
{
Expand Down
3 changes: 1 addition & 2 deletions Source/Deployer.Raspberry.Console/ConsoleMarkdownDialog.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Deployer;

namespace Deployment.Console
namespace Deployer.Raspberry.Console
{
internal class ConsoleMarkdownDialog : IMarkdownDialog
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Deployer.Tasks;

namespace Deployment.Console
namespace Deployer.Raspberry.Console
{
internal class ConsoleMarkdownDisplayer : IMarkdownDisplayer
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{16500914-E053-433E-9B6A-27D4A5717130}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>Deployment.Console</RootNamespace>
<AssemblyName>WoaDeployer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<OutputType>Library</OutputType>
<RootNamespace>Deployer.Raspberry.Console</RootNamespace>
<AssemblyName>Deployer.Raspberry.Console</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -34,8 +35,9 @@
<WarningLevel>4</WarningLevel>
<LangVersion>7.1</LangVersion>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down Expand Up @@ -117,7 +119,9 @@
<Link>Core\Tools\Etcher-Cli\x86\node_modules\usb\src\binding\usb_bindings.node</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser">
Expand All @@ -133,7 +137,7 @@
<Version>3.3.0</Version>
</PackageReference>
<PackageReference Include="System.Reactive">
<Version>4.1.2</Version>
<Version>4.1.3</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CommandLine;

namespace Deployment.Console.Options
namespace Deployer.Raspberry.Console.Options
{
[Verb("execute", HelpText = "Executes a script that doesn't deploy Windows")]
public class NonWindowsDeploymentCmdOptions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using CommandLine;

namespace Deployment.Console.Options
namespace Deployer.Raspberry.Console.Options
{
[Verb("deploy", HelpText = "Executes a Windows deployment script")]
public class WindowsDeploymentCmdOptions
Expand Down
11 changes: 4 additions & 7 deletions Source/Deployer.Raspberry.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
using System.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
using ByteSizeLib;
using CommandLine;
using Deployer;
using Deployer.FileSystem;
using Deployer.Lumia.NetFx;
using Deployer.Raspberry;
using Deployer.Raspberry.Console.Options;
using Deployer.Tasks;
using Deployment.Console.Options;
using Grace.DependencyInjection;
using Serilog;
using Serilog.Events;

namespace Deployment.Console
namespace Deployer.Raspberry.Console
{
internal static class Program
public static class Program
{
private static async Task Main(string[] args)
public static async Task Main(string[] args)
{
ConfigureLogger();

Expand Down
4 changes: 2 additions & 2 deletions Source/Deployer.Raspberry.Console/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Source/Deployer.Raspberry.Gui/App.config
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="Deployer.Android.Gui.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Deployer.Android.Gui.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
</startup>
<userSettings>
<Deployer.Android.Gui.Properties.Settings>
<setting name="WimFolder" serializeAs="String">
<value />
<value/>
</setting>
<setting name="SizeReservedForWindows" serializeAs="String">
<value>18</value>
Expand All @@ -21,4 +21,4 @@
</setting>
</Deployer.Android.Gui.Properties.Settings>
</userSettings>
</configuration>
</configuration>
4 changes: 1 addition & 3 deletions Source/Deployer.Raspberry.Gui/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:valueConverters="clr-namespace:ValueConverters;assembly=ValueConverters"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:gui="clr-namespace:Deployer.Raspberry.Gui"
StartupUri="Views\MainWindow.xaml">
xmlns:gui="clr-namespace:Deployer.Raspberry.Gui">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand Down
36 changes: 33 additions & 3 deletions Source/Deployer.Raspberry.Gui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,45 @@
using System.Windows;
using System.Linq;
using System.Windows;
using Deployer.Gui.Common;
using Deployer.Raspberry.Console;
using Deployer.Raspberry.Gui.Views;
using Serilog;


namespace Deployer.Raspberry.Gui
{
public partial class App
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
base.OnStartup(e);

MahApps.Metro.ThemeManager.IsAutomaticWindowsAppModeSettingSyncEnabled = true;
MahApps.Metro.ThemeManager.SyncThemeWithWindowsAppModeSetting();

if (e.Args.Any())
{
LaunchConsole(e.Args);
}
else
{
LaunchGui();
}
}

private void LaunchGui()
{
var window = new MainWindow();
MainWindow = window;
window.Show();
}

private void LaunchConsole(string[] args)
{
UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);

ConsoleEmbedder.ExecuteInsideConsole(() => Program.Main(args).Wait());
Shutdown();
}
}
}
7 changes: 7 additions & 0 deletions Source/Deployer.Raspberry.Gui/AppProperties.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Deployer.Raspberry.Gui
{
public class AppProperties
{
public const string GitHubBaseUrl = "https://github.com/WOA-Project/WOA-Deployer-Rpi";
}
}
15 changes: 12 additions & 3 deletions Source/Deployer.Raspberry.Gui/Deployer.Raspberry.Gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
<ProjectGuid>{ED104C3D-4B45-4C45-82BD-B043E85F0FE8}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Deployer.Raspberry.Gui</RootNamespace>
<AssemblyName>WOA Deployer</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<AssemblyName>WoaDeployer</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -40,6 +41,9 @@
<PropertyGroup>
<ApplicationIcon>Assets\appicon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Deployer.Raspberry.Gui.App</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand All @@ -65,6 +69,7 @@
<Compile Include="..\Deployer.Raspberry.NetFx\Properties\SharedAssemblyInfo.cs">
<Link>Properties\SharedAssemblyInfo.cs</Link>
</Compile>
<Compile Include="AppProperties.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down Expand Up @@ -229,7 +234,7 @@
<Version>1.0.0</Version>
</PackageReference>
<PackageReference Include="ReactiveUI.WPF">
<Version>9.9.1</Version>
<Version>9.11.1</Version>
</PackageReference>
<PackageReference Include="Serilog.Sinks.Observable">
<Version>2.0.2</Version>
Expand Down Expand Up @@ -307,6 +312,10 @@
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Deployer.Raspberry.Console\Deployer.Raspberry.Console.csproj">
<Project>{16500914-e053-433e-9b6a-27d4a5717130}</Project>
<Name>Deployer.Raspberry.Console</Name>
</ProjectReference>
<ProjectReference Include="..\Deployer.Raspberry.NetFx\Deployer.Raspberry.NetFx.csproj">
<Project>{2abbf26a-2c87-4657-861e-08ec55dead77}</Project>
<Name>Deployer.Raspberry.NetFx</Name>
Expand Down
5 changes: 3 additions & 2 deletions Source/Deployer.Raspberry.Gui/Locator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Deployer.Lumia.NetFx;
using Deployer.Raspberry.Gui.Specifics;
using Deployer.Raspberry.Gui.ViewModels;
using Deployer.Raspberry.Gui.Views;
using Deployer.Tasks;
using Grace.DependencyInjection;
using MahApps.Metro.Controls.Dialogs;
Expand All @@ -17,7 +16,7 @@ namespace Deployer.Raspberry.Gui
public class Locator
{
private readonly DependencyInjectionContainer container;

public Locator()
{
container = new DependencyInjectionContainer();
Expand All @@ -32,6 +31,8 @@ public Locator()
.MinimumLevel.Verbose()
.CreateLogger();

UpdateChecker.CheckForUpdates(AppProperties.GitHubBaseUrl);

var optionsProvider = new WindowsDeploymentOptionsProvider();

container.Configure(x =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Deployer.Lumia.NetFx</RootNamespace>
<AssemblyName>Deployer.Lumia.NetFx</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.0")]
[assembly: AssemblyVersion("2.1.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
2 changes: 1 addition & 1 deletion Source/DeployerPlatform

0 comments on commit 1ab6223

Please sign in to comment.