Skip to content

Commit 9955b86

Browse files
committed
Automatic Update
1 parent fc8c16e commit 9955b86

34 files changed

+717
-205
lines changed

DataCommander.Providers/AboutForm.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public AboutForm()
3434
Including <a href=""https://github.com/csbernath/DataCommander/blob/master/Foundation.NetStandard-2.0/README.md"">Foundation (.NET Standard 2.0) Class Library</a>
3535
<br/>
3636
<br/>
37+
Version: {assembly.GetName().Version}
3738
Build date: {lastWriteTime.ToString("yyyy-MM-dd")}
3839
<br/>
3940
<br/>

DataCommander.Update/Form1.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

DataCommander.Update/Program.cs

Lines changed: 0 additions & 22 deletions
This file was deleted.

DataCommander.Update/DataCommander.Update.csproj renamed to DataCommander.Updater/DataCommander.Updater.csproj

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
77
<ProjectGuid>{0B6B1DFC-696B-457A-A57E-A0BCBA0C463D}</ProjectGuid>
88
<OutputType>WinExe</OutputType>
9-
<RootNamespace>DataCommander.Update</RootNamespace>
10-
<AssemblyName>DataCommander.Update</AssemblyName>
9+
<RootNamespace>DataCommander.Updater</RootNamespace>
10+
<AssemblyName>DataCommander.Updater</AssemblyName>
1111
<TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>
1212
<FileAlignment>512</FileAlignment>
1313
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
@@ -21,6 +21,7 @@
2121
<DefineConstants>DEBUG;TRACE</DefineConstants>
2222
<ErrorReport>prompt</ErrorReport>
2323
<WarningLevel>4</WarningLevel>
24+
<Prefer32Bit>false</Prefer32Bit>
2425
</PropertyGroup>
2526
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
2627
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -45,14 +46,18 @@
4546
<Reference Include="System.Xml" />
4647
</ItemGroup>
4748
<ItemGroup>
48-
<Compile Include="Form1.cs">
49+
<Compile Include="Updater.cs" />
50+
<Compile Include="UpdaterForm.cs">
4951
<SubType>Form</SubType>
5052
</Compile>
51-
<Compile Include="Form1.Designer.cs">
52-
<DependentUpon>Form1.cs</DependentUpon>
53+
<Compile Include="UpdaterForm.Designer.cs">
54+
<DependentUpon>UpdaterForm.cs</DependentUpon>
5355
</Compile>
5456
<Compile Include="Program.cs" />
5557
<Compile Include="Properties\AssemblyInfo.cs" />
58+
<EmbeddedResource Include="UpdaterForm.resx">
59+
<DependentUpon>UpdaterForm.cs</DependentUpon>
60+
</EmbeddedResource>
5661
<EmbeddedResource Include="Properties\Resources.resx">
5762
<Generator>ResXFileCodeGenerator</Generator>
5863
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -61,6 +66,7 @@
6166
<Compile Include="Properties\Resources.Designer.cs">
6267
<AutoGen>True</AutoGen>
6368
<DependentUpon>Resources.resx</DependentUpon>
69+
<DesignTime>True</DesignTime>
6470
</Compile>
6571
<None Include="Properties\Settings.settings">
6672
<Generator>SettingsSingleFileGenerator</Generator>
@@ -75,5 +81,11 @@
7581
<ItemGroup>
7682
<None Include="App.config" />
7783
</ItemGroup>
84+
<ItemGroup>
85+
<ProjectReference Include="..\Foundation.NetStandard-2.0\Foundation.NetStandard-2.0.csproj">
86+
<Project>{04996258-f3f5-4eec-9d3e-acae9726f93f}</Project>
87+
<Name>Foundation.NetStandard-2.0</Name>
88+
</ProjectReference>
89+
</ItemGroup>
7890
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7991
</Project>

DataCommander.Updater/Program.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.Windows.Forms;
4+
5+
namespace DataCommander.Updater
6+
{
7+
static class Program
8+
{
9+
[STAThread]
10+
static void Main(string[] args)
11+
{
12+
try
13+
{
14+
Debugger.Launch();
15+
MessageBox.Show("Updating Data Commander...");
16+
17+
var applicationExeFileName = args[0];
18+
var updater = new Updater();
19+
updater.Update(applicationExeFileName);
20+
21+
MessageBox.Show("Data Commander updated and started.");
22+
23+
//Application.EnableVisualStyles();
24+
//Application.SetCompatibleTextRenderingDefault(false);
25+
//Application.Run(new UpdaterForm(applicationExeFileName));
26+
}
27+
catch (Exception e)
28+
{
29+
MessageBox.Show($"Fatal exception:\r\n{e}");
30+
}
31+
}
32+
}
33+
}
File renamed without changes.

DataCommander.Update/Properties/Resources.Designer.cs renamed to DataCommander.Updater/Properties/Resources.Designer.cs

Lines changed: 19 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
File renamed without changes.

DataCommander.Update/Properties/Settings.Designer.cs renamed to DataCommander.Updater/Properties/Settings.Designer.cs

Lines changed: 9 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)