Skip to content

Commit

Permalink
Merge pull request #5 from AleksandarDev/dev
Browse files Browse the repository at this point in the history
Merged 2 forks
  • Loading branch information
tenacious authored Mar 3, 2017
2 parents ca36446 + 83558b4 commit dc83f7b
Show file tree
Hide file tree
Showing 59 changed files with 4,978 additions and 4,166 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,4 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/
/AutoSquirrel.asproj
31 changes: 29 additions & 2 deletions AutoSquirrel.sln
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
# Visual Studio 15
VisualStudioVersion = 15.0.26127.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoSquirrel", "AutoSquirrel\AutoSquirrel.csproj", "{CEEF6526-7DAA-4AE9-8FE5-7C6E6C07093D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{CEFE0C7D-4652-49F4-BAAC-261053714A9C}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{708D7157-695C-4B62-8994-F1A0F84DA6C2}"
ProjectSection(SolutionItems) = preProject
docs\PackageCreation.md = docs\PackageCreation.md
docs\SquirrelIntegration.md = docs\SquirrelIntegration.md
docs\VersionAutoIncrement.md = docs\VersionAutoIncrement.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Images", "Images", "{732589F0-331E-4ADF-B48E-2A99EAAD667D}"
ProjectSection(SolutionItems) = preProject
docs\images\assembly_version_attribute.png = docs\images\assembly_version_attribute.png
docs\images\AssemblyVersion_Project.png = docs\images\AssemblyVersion_Project.png
docs\images\connection_detail.png = docs\images\connection_detail.png
docs\images\PackageCreatorGUI.png = docs\images\PackageCreatorGUI.png
docs\images\pre_compilation_edit.png = docs\images\pre_compilation_edit.png
docs\images\squirrel_upload.png = docs\images\squirrel_upload.png
docs\images\upload_location.png = docs\images\upload_location.png
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -19,4 +42,8 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{708D7157-695C-4B62-8994-F1A0F84DA6C2} = {CEFE0C7D-4652-49F4-BAAC-261053714A9C}
{732589F0-331E-4ADF-B48E-2A99EAAD667D} = {708D7157-695C-4B62-8994-F1A0F84DA6C2}
EndGlobalSection
EndGlobal
12 changes: 10 additions & 2 deletions AutoSquirrel/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="DeltaCompressionDotNet.MsDelta" publicKeyToken="46b2138a390abf55" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
19 changes: 8 additions & 11 deletions AutoSquirrel/App.xaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Application x:Class="AutoSquirrel.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AutoSquirrel"
>
<Application.Resources>
<Application
x:Class="AutoSquirrel.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AutoSquirrel">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<local:AppBootstrapper x:Key="bootstrapper" />
<local:AppBootstrapper x:Key="bootstrapper" />
</ResourceDictionary>
<ResourceDictionary Source="/AutoSquirrel;component/AppCustomStyle.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
Expand All @@ -17,8 +17,5 @@
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>



</Application.Resources>
</Application>
</Application>
78 changes: 44 additions & 34 deletions AutoSquirrel/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
using Caliburn.Micro;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Caliburn.Micro;
using Squirrel;

namespace AutoSquirrel
{
/// <summary>
/// Logica di interazione per App.xaml
/// Application Entry
/// </summary>
public partial class App : Application
{
private const string traceFilename = "Log.txt";

/// <summary>
/// Raises the <see cref="E:System.Windows.Application.Startup"/> event.
/// </summary>
/// <param name="e">
/// A <see cref="T:System.Windows.StartupEventArgs"/> that contains the event data.
/// </param>
protected override void OnStartup(StartupEventArgs e)
{
Trace.AutoFlush = true;
Expand All @@ -35,25 +35,21 @@ protected override void OnStartup(StartupEventArgs e)

Trace.Listeners.Add(log);
}
catch (Exception ex)
catch
{

}

this.DispatcherUnhandledException += App_DispatcherUnhandledException;
this.DispatcherUnhandledException += this.App_DispatcherUnhandledException;
base.OnStartup(e);
}

private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
ShowUnhandeledException(e);
}
private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e) => ShowUnhandeledException(e);

private void ShowUnhandeledException(DispatcherUnhandledExceptionEventArgs e)
{
e.Handled = true;

string errorMessage =
var errorMessage =
string.Format(
"An application error occurred.\nPlease check whether your data is correct and repeat the action. If this error occurs again there seems to be a more serious malfunction in the application, and you better close it.\n\nError:{0}\n\nDo you want to continue?\n(if you click Yes you will continue with your work, if you click No the application will close)",

Expand All @@ -66,30 +62,44 @@ private void ShowUnhandeledException(DispatcherUnhandledExceptionEventArgs e)
Trace.TraceError("Stack Trace " + e.Exception.StackTrace);
Trace.TraceError("Source " + e.Exception.Source);
Trace.TraceError("Inner Exception3 " + e.Exception.InnerException);

//if (
// MessageBox.Show(errorMessage, "Application Error", MessageBoxButton.YesNoCancel, MessageBoxImage.Error, MessageBoxResult.No) ==
// MessageBoxResult.Yes)
{
{

Application.Current.Shutdown();
}
}
Application.Current.Shutdown();
}

}

/// <summary>
/// App Bootstrapper
/// </summary>
/// <seealso cref="Caliburn.Micro.BootstrapperBase"/>
public class AppBootstrapper : BootstrapperBase
{
/// <summary>
/// Initializes a new instance of the <see cref="AppBootstrapper"/> class.
/// </summary>
public AppBootstrapper()
{
using (var mgr = new UpdateManager(@"https://s3-eu-west-1.amazonaws.com/autosquirrel", "AutoSquirrel"))
{
// We have to re-implement the things Squirrel does for normal applications, because
// we're marked as Squirrel-aware
SquirrelAwareApp.HandleEvents(
onInitialInstall: v => mgr.CreateShortcutForThisExe(),
onAppUpdate: v =>
{
mgr.CreateShortcutForThisExe();
// Update the shortcuts
mgr.CreateShortcutsForExecutable("AutoSquirrel.exe", ShortcutLocation.AppRoot, false);
},
onAppUninstall: v => mgr.RemoveShortcutForThisExe());
}
Initialize();
}

protected override void OnStartup(object sender, StartupEventArgs e)
{
DisplayRootViewFor<ShellViewModel>();
}
/// <summary>
/// Override this to add custom behavior to execute after the application starts.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The args.</param>
protected override void OnStartup(object sender, StartupEventArgs e) => DisplayRootViewFor<ShellViewModel>();
}
}
}
73 changes: 38 additions & 35 deletions AutoSquirrel/AppCustomStyle.xaml
Original file line number Diff line number Diff line change
@@ -1,74 +1,78 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AutoSquirrel">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:AutoSquirrel">

<!--<Style TargetType="TextBox">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="local:SelectTextOnFocus.Active" Value="True" />
<!--<Style TargetType="TextBox">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="local:SelectTextOnFocus.Active" Value="True" />
</Style>-->



<Style TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center" />
</Style>

<Style x:Key="imageButton" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Image Width="19" Height="19"
x:Name="img" Opacity="1.0"
Stretch="UniformToFill"
Source="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
<Image
x:Name="img"
Width="19"
Height="19"
Opacity="1.0"
Source="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
Stretch="UniformToFill" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Black"
ShadowDepth="3" Direction="315" Opacity="0.8"/>
<DropShadowEffect
Direction="315"
Opacity="0.8"
ShadowDepth="3"
Color="Black" />
</Setter.Value>
</Setter>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="img" Property="Opacity" Value="0.3"/>
<Setter TargetName="img" Property="Opacity" Value="0.3" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>


<Style x:Key="LinkButton" TargetType="{x:Type Button}">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Foreground" Value="#408DD9"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Foreground" Value="#408DD9" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<TextBlock TextDecorations="Underline"
Text="{TemplateBinding Content}"
Background="{TemplateBinding Background}"/>
<TextBlock
Background="{TemplateBinding Background}"
Text="{TemplateBinding Content}"
TextDecorations="Underline" />
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="Foreground" Value="Red" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Red"/>
<Setter Property="Foreground" Value="Red" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="#FF515050"/>
<Setter Property="Foreground" Value="#FF515050" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>


<!--<Style TargetType="{x:Type TextBox}">
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="VerticalContentAlignment" Value="Center" />
Expand All @@ -78,7 +82,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBoxBase}">
<Border Name="MainBorder" Background="Transparent" CornerRadius="2">
<Grid Margin="4" >
<Grid Margin="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
Expand All @@ -97,7 +101,7 @@
Fill="#808080"
Height="15"
Stretch="Fill" Width="15"
VerticalAlignment="Bottom"/>
VerticalAlignment="Bottom" />
</Grid>
</Border>
<ControlTemplate.Triggers>
Expand All @@ -115,7 +119,7 @@
<ColorAnimation Storyboard.TargetName="BorderUnderline" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
To="#029cc7" Duration="0:0:0.3" />
<ColorAnimation Storyboard.TargetName="PathTriangle" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
To="#029cc7" Duration="0:0:0.3"/>
To="#029cc7" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
Expand All @@ -127,7 +131,7 @@
<ColorAnimation Storyboard.TargetName="BorderUnderline" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
To="#808080" Duration="0:0:0.3" />
<ColorAnimation Storyboard.TargetName="PathTriangle" Storyboard.TargetProperty="(Path.Fill).(SolidColorBrush.Color)"
To="#808080" Duration="0:0:0.3"/>
To="#808080" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
Expand All @@ -137,5 +141,4 @@
</Setter.Value>
</Setter>
</Style>-->

</ResourceDictionary>
8 changes: 5 additions & 3 deletions AutoSquirrel/AssemblyVersion.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
 //1
//0
//0
//215
//22
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyVersion("1.0.215.0")]
[assembly: AssemblyCopyright("Copyright © ChrisPulman 2017")]
[assembly: AssemblyVersion("1.1.22")]
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
[assembly: AssemblyFileVersion("1.1.22")]
Loading

0 comments on commit dc83f7b

Please sign in to comment.