Skip to content

Commit

Permalink
Added check for internet connectivity
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Auer authored and Luca Auer committed Jan 30, 2018
1 parent 84ed963 commit 2e51af5
Show file tree
Hide file tree
Showing 51 changed files with 102 additions and 62 deletions.
Binary file modified Image Sort Installer/Debug/Image Sort Installer.msi
Binary file not shown.
53 changes: 9 additions & 44 deletions Image Sort Installer/Image Sort Installer.vdproj
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,19 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_BA37002FA523BF842A6B2894B6AF4E62"
"OwnerKey" = "8:_283B6564AC7A9D8267D4E1BF72C1FCC5"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_B7FBB8E808FB94D7752BF884A3F49021"
"OwnerKey" = "8:_7ACF96A8A9B2F3E7F316BED346E6A181"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_00D0CE4288B4D7F30219BA4F513F6672"
"OwnerKey" = "8:_778F29889CDBDC2E0DE5876BE263707A"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
Expand All @@ -118,19 +118,19 @@
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_778F29889CDBDC2E0DE5876BE263707A"
"OwnerKey" = "8:_00D0CE4288B4D7F30219BA4F513F6672"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_7ACF96A8A9B2F3E7F316BED346E6A181"
"OwnerKey" = "8:_B7FBB8E808FB94D7752BF884A3F49021"
"MsmSig" = "8:_UNDEFINED"
}
"Entry"
{
"MsmKey" = "8:_UNDEFINED"
"OwnerKey" = "8:_283B6564AC7A9D8267D4E1BF72C1FCC5"
"OwnerKey" = "8:_BA37002FA523BF842A6B2894B6AF4E62"
"MsmSig" = "8:_UNDEFINED"
}
}
Expand Down Expand Up @@ -235,11 +235,6 @@
"AssemblyAsmDisplayName" = "8:System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_00D0CE4288B4D7F30219BA4F513F6672"
{
"Name" = "8:System.Windows.Interactivity.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Windows.Interactivity.dll"
"TargetName" = "8:"
Expand All @@ -266,11 +261,6 @@
"AssemblyAsmDisplayName" = "8:Microsoft.Windows.Design.Extensibility, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86"
"ScatterAssemblies"
{
"_283B6564AC7A9D8267D4E1BF72C1FCC5"
{
"Name" = "8:Microsoft.Windows.Design.Extensibility.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Microsoft.Windows.Design.Extensibility.dll"
"TargetName" = "8:"
Expand All @@ -297,11 +287,6 @@
"AssemblyAsmDisplayName" = "8:Image sort.Logic, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_3D8B437F219698BC574D0078B5398CDF"
{
"Name" = "8:Image sort.Logic.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Image sort.Logic.dll"
"TargetName" = "8:"
Expand All @@ -328,11 +313,6 @@
"AssemblyAsmDisplayName" = "8:System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
"ScatterAssemblies"
{
"_778F29889CDBDC2E0DE5876BE263707A"
{
"Name" = "8:System.Net.Http.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:System.Net.Http.dll"
"TargetName" = "8:"
Expand All @@ -359,11 +339,6 @@
"AssemblyAsmDisplayName" = "8:Microsoft.Windows.Design.Interaction, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=x86"
"ScatterAssemblies"
{
"_7ACF96A8A9B2F3E7F316BED346E6A181"
{
"Name" = "8:Microsoft.Windows.Design.Interaction.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Microsoft.Windows.Design.Interaction.dll"
"TargetName" = "8:"
Expand Down Expand Up @@ -410,11 +385,6 @@
"AssemblyAsmDisplayName" = "8:Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_B7FBB8E808FB94D7752BF884A3F49021"
{
"Name" = "8:Newtonsoft.Json.dll"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Newtonsoft.Json.dll"
"TargetName" = "8:"
Expand All @@ -441,11 +411,6 @@
"AssemblyAsmDisplayName" = "8:Image sort.Update, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"
"ScatterAssemblies"
{
"_BA37002FA523BF842A6B2894B6AF4E62"
{
"Name" = "8:Image sort.Update.exe"
"Attributes" = "3:512"
}
}
"SourcePath" = "8:Image sort.Update.exe"
"TargetName" = "8:"
Expand Down Expand Up @@ -541,15 +506,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:Image Sort Installer"
"ProductCode" = "8:{79157CE9-64ED-46DF-852C-325B271FF3C8}"
"PackageCode" = "8:{8D95996F-E789-4F18-9671-8EDC0173DF42}"
"ProductCode" = "8:{834BE477-4A1C-4441-AC2E-C98EE42D1724}"
"PackageCode" = "8:{C6553DC1-E03F-4B31-A1F9-D08096A70249}"
"UpgradeCode" = "8:{1AC9D063-74DA-4D56-BA4A-C7F4216CFAF3}"
"AspNetVersion" = "8:4.0.30319.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:FALSE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.2.0"
"ProductVersion" = "8:1.2.1"
"Manufacturer" = "8:Lolle2000la"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"
Expand Down
Binary file modified Image Sort Installer/Release/Image Sort Installer.msi
Binary file not shown.
4 changes: 2 additions & 2 deletions Image sort.Logic/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// 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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: NeutralResourcesLanguage("en-US")]

Binary file modified Image sort.Logic/bin/Debug/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.Logic/bin/Debug/Image sort.Logic.pdb
Binary file not shown.
Binary file modified Image sort.Logic/bin/Release/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.Logic/bin/Release/Image sort.Logic.pdb
Binary file not shown.
Binary file not shown.
Binary file modified Image sort.Logic/obj/Debug/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.Logic/obj/Debug/Image sort.Logic.pdb
Binary file not shown.
Binary file modified Image sort.Logic/obj/Release/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.Logic/obj/Release/Image sort.Logic.pdb
Binary file not shown.
22 changes: 19 additions & 3 deletions Image sort.UI/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Configuration;
using System.Data;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
using System.Windows;

Expand All @@ -13,15 +14,30 @@ namespace Image_sort.UI
/// </summary>
public partial class App : Application
{
[DllImport("wininet.dll")]
public extern static bool InternetGetConnectedState(out int Description, int ReservedValue);

/// <summary>
/// Gets internet state, returns true if connected
/// </summary>
/// <returns></returns>
public static bool IsConnectedToInternet()
{
int Desk;
return InternetGetConnectedState(out Desk, 0);
}

/// <summary>
/// Overridden so that the updater can check for updates before startup
/// </summary>
/// <param name="e"></param>
protected override void OnStartup(StartupEventArgs e)
{
// Run the Updater before starting the app
System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory
+ @"\Image sort.Update.exe").WaitForExit();
// Run updater, if connected to internet
if(IsConnectedToInternet())
// Run the Updater before starting the app
System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory
+ @"\Image sort.Update.exe").WaitForExit();

// Continue normally
base.OnStartup(e);
Expand Down
2 changes: 1 addition & 1 deletion Image sort.UI/Image sort.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
Expand Down
4 changes: 2 additions & 2 deletions Image sort.UI/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// 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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
[assembly: NeutralResourcesLanguage("en-GB")]

Binary file modified Image sort.UI/bin/Debug/Image Sort.Update.exe
Binary file not shown.
Binary file modified Image sort.UI/bin/Debug/Image Sort.Update.pdb
Binary file not shown.
Binary file modified Image sort.UI/bin/Debug/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.UI/bin/Debug/Image sort.Logic.pdb
Binary file not shown.
Binary file modified Image sort.UI/bin/Debug/Image sort.UI.exe
Binary file not shown.
Binary file modified Image sort.UI/bin/Debug/Image sort.UI.pdb
Binary file not shown.
Binary file modified Image sort.UI/bin/Release/Image sort.Logic.dll
Binary file not shown.
Binary file modified Image sort.UI/bin/Release/Image sort.Logic.pdb
Binary file not shown.
Binary file modified Image sort.UI/bin/Release/Image sort.UI.exe
Binary file not shown.
Binary file modified Image sort.UI/bin/Release/Image sort.UI.pdb
Binary file not shown.
Binary file not shown.
62 changes: 61 additions & 1 deletion Image sort.UI/obj/Debug/GeneratedInternalTypeHelper.g.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,62 @@

//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace XamlGeneratedNamespace {


/// <summary>
/// GeneratedInternalTypeHelper
/// </summary>
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public sealed class GeneratedInternalTypeHelper : System.Windows.Markup.InternalTypeHelper {

/// <summary>
/// CreateInstance
/// </summary>
protected override object CreateInstance(System.Type type, System.Globalization.CultureInfo culture) {
return System.Activator.CreateInstance(type, ((System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic)
| (System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.CreateInstance)), null, null, culture);
}

/// <summary>
/// GetPropertyValue
/// </summary>
protected override object GetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, System.Globalization.CultureInfo culture) {
return propertyInfo.GetValue(target, System.Reflection.BindingFlags.Default, null, null, culture);
}

/// <summary>
/// SetPropertyValue
/// </summary>
protected override void SetPropertyValue(System.Reflection.PropertyInfo propertyInfo, object target, object value, System.Globalization.CultureInfo culture) {
propertyInfo.SetValue(target, value, System.Reflection.BindingFlags.Default, null, null, culture);
}

/// <summary>
/// CreateDelegate
/// </summary>
protected override System.Delegate CreateDelegate(System.Type delegateType, object target, string handler) {
return ((System.Delegate)(target.GetType().InvokeMember("_CreateDelegate", (System.Reflection.BindingFlags.InvokeMethod
| (System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance)), null, target, new object[] {
delegateType,
handler}, null)));
}

/// <summary>
/// AddEventHandler
/// </summary>
protected override void AddEventHandler(System.Reflection.EventInfo eventInfo, object target, System.Delegate handler) {
eventInfo.AddEventHandler(target, handler);
}
}
}

Binary file not shown.
Binary file not shown.
Binary file modified Image sort.UI/obj/Debug/Image sort.UI.exe
Binary file not shown.
Binary file modified Image sort.UI/obj/Debug/Image sort.UI.g.resources
Binary file not shown.
Binary file modified Image sort.UI/obj/Debug/Image sort.UI.pdb
Binary file not shown.
6 changes: 3 additions & 3 deletions Image sort.UI/obj/Debug/Image sort.UI_MarkupCompile.i.cache
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
winexe
C#
.cs
C:\Users\Lolle\source\repos\image-sort-dev\Image-Sort\Image sort.UI\obj\Debug\
C:\Users\Lolle\Source\Repos\Image-Sort\Image sort.UI\obj\Debug\
Image_sort.UI
none
false
DEBUG;TRACE
C:\Users\Lolle\source\repos\image-sort-dev\Image-Sort\Image sort.UI\App.xaml
C:\Users\Lolle\Source\Repos\Image-Sort\Image sort.UI\App.xaml
11151548125

10-286410001
18-1008622645
18-679880146
MainWindow.xaml;

False
Expand Down
2 changes: 1 addition & 1 deletion Image sort.UI/obj/Debug/Image sort.UI_MarkupCompile.lref
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
C:\Users\Lolle\Source\Repos\Image-Sort\Image sort.UI\obj\Debug\GeneratedInternalTypeHelper.g.cs


FC:\Users\Lolle\Source\Repos\Image-Sort\Image sort.UI\MainWindow.xaml;;

Binary file not shown.
Binary file not shown.
Binary file modified Image sort.UI/obj/Release/Image sort.UI.exe
Binary file not shown.
Binary file modified Image sort.UI/obj/Release/Image sort.UI.g.resources
Binary file not shown.
Binary file modified Image sort.UI/obj/Release/Image sort.UI.pdb
Binary file not shown.
5 changes: 2 additions & 3 deletions Image sort.Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void Main(string[] args)
// Serializes the UpdateRegistry from json
UpdateRegModel updateReg = JsonConvert.DeserializeObject<UpdateRegModel>(json);
if (updateReg != null)
// if the version given is different, download and run the newest update
// if the version given is different, download and run the newest! update
if (updateReg.version != Properties.Resources.version)
if (MessageBox.Show("Do you want to update to the newest" +
" version of Image sort?", "Update", MessageBoxButton.YesNo,
Expand All @@ -51,8 +51,7 @@ public static string GetUpdateRegistry()
{
try
{
json = wc.DownloadString("https://raw.githubusercontent.com" +
"/Lolle2000la/Image-Sort/master/update-reg.json");
json = wc.DownloadString("https://raw.githubusercontent.com/Lolle2000la/Image-Sort/master/update-reg.json");
}
catch (WebException)
{
Expand Down
4 changes: 2 additions & 2 deletions Image sort.Update/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
Binary file modified Image sort.Update/bin/Debug/Image sort.Update.exe
Binary file not shown.
Binary file modified Image sort.Update/bin/Debug/Image sort.Update.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Image sort.Update/obj/Debug/Image sort.Update.exe
Binary file not shown.
Binary file modified Image sort.Update/obj/Debug/Image sort.Update.pdb
Binary file not shown.
Binary file modified ProjOne/bin/Debug/Image sort.Update.exe
Binary file not shown.
Binary file modified ProjOne/bin/Debug/Image sort.Update.pdb
Binary file not shown.

0 comments on commit 2e51af5

Please sign in to comment.