Skip to content

Commit d6a541a

Browse files
committed
chores: 9.6.0
1 parent 3cc4dc6 commit d6a541a

25 files changed

+57
-43656
lines changed

BorderlessGaming.Logic/BorderlessGaming.Logic.csproj

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
<AppDesignerFolder>Properties</AppDesignerFolder>
1010
<RootNamespace>BorderlessGaming.Logic</RootNamespace>
1111
<AssemblyName>BorderlessGaming.Logic</AssemblyName>
12-
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
12+
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<TargetFrameworkProfile />
1415
</PropertyGroup>
1516
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
1617
<DebugSymbols>true</DebugSymbols>
@@ -39,21 +40,9 @@
3940
<AssemblyOriginatorKeyFile>..\BGKey.pfx</AssemblyOriginatorKeyFile>
4041
</PropertyGroup>
4142
<ItemGroup>
42-
<Reference Include="CommandLine, Version=1.9.71.2, Culture=neutral, PublicKeyToken=de6f01bd326f8c32, processorArchitecture=MSIL">
43-
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
44-
</Reference>
4543
<Reference Include="DotNetZip, Version=1.13.3.0, Culture=neutral, PublicKeyToken=6583c7c814667745, processorArchitecture=MSIL">
4644
<HintPath>..\packages\DotNetZip.1.13.3\lib\net40\DotNetZip.dll</HintPath>
4745
</Reference>
48-
<Reference Include="Facepunch.Steamworks">
49-
<HintPath>..\SteamLibs\Facepunch.Steamworks.dll</HintPath>
50-
</Reference>
51-
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.8.8.0, Culture=neutral, PublicKeyToken=c416bc1b32d97233, processorArchitecture=MSIL">
52-
<HintPath>..\packages\TaskScheduler.2.8.8\lib\net452\Microsoft.Win32.TaskScheduler.dll</HintPath>
53-
</Reference>
54-
<Reference Include="protobuf-net, Version=2.4.0.0, Culture=neutral, PublicKeyToken=257b51d87d2e4d67, processorArchitecture=MSIL">
55-
<HintPath>..\packages\protobuf-net.2.4.0\lib\net40\protobuf-net.dll</HintPath>
56-
</Reference>
5746
<Reference Include="System" />
5847
<Reference Include="System.Configuration" />
5948
<Reference Include="System.Core" />
@@ -92,7 +81,6 @@
9281
<DesignTime>True</DesignTime>
9382
<DependentUpon>Resources.resx</DependentUpon>
9483
</Compile>
95-
<Compile Include="Steam\SteamAPI.cs" />
9684
<Compile Include="System\AppEnvironment.cs" />
9785
<Compile Include="System\AutoStart.cs" />
9886
<Compile Include="System\StartupOptions.cs" />
@@ -118,12 +106,24 @@
118106
<None Include="..\BGKey.pfx">
119107
<Link>BGKey.pfx</Link>
120108
</None>
121-
<None Include="packages.config" />
122109
</ItemGroup>
123110
<ItemGroup>
124111
<None Include="Resources\blank.cur" />
125112
</ItemGroup>
126-
<ItemGroup />
113+
<ItemGroup>
114+
<PackageReference Include="CommandLineParser">
115+
<Version>1.9.71</Version>
116+
</PackageReference>
117+
<PackageReference Include="protobuf-net">
118+
<Version>2.4.0</Version>
119+
</PackageReference>
120+
<PackageReference Include="System.IO.Compression.ZipFile">
121+
<Version>4.3.0</Version>
122+
</PackageReference>
123+
<PackageReference Include="TaskScheduler">
124+
<Version>2.8.8</Version>
125+
</PackageReference>
126+
</ItemGroup>
127127
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
128128
<PropertyGroup>
129129
<PostBuildEvent>call "$(SolutionDir)Tools\DigiCertUtil.exe" sign /noInput /sha1 "CB509F61A8A3B970790F0E2C695A3782F101FF22" "$(ProjectDir)$(OutDir)$(TargetFileName)"</PostBuildEvent>

BorderlessGaming.Logic/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

BorderlessGaming.Logic/Steam/SteamAPI.cs

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

BorderlessGaming.Logic/System/StartupOptions.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ public class StartupOptions
1111
[Option('s', "silent", DefaultValue = false, HelpText = "Starts the application silently.")]
1212
public bool Silent { get; set; }
1313

14-
[Option('p', "steam", DefaultValue = false, HelpText = "Used by the Steam client.")]
15-
public bool IsSteam { get; set; }
16-
17-
1814
[ParserState]
1915
public IParserState LastParserState { get; set; }
2016

Lines changed: 16 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,18 @@
1-
using System;
1+
using BorderlessGaming.Logic.Core;
2+
using BorderlessGaming.Logic.Models;
3+
using BorderlessGaming.Logic.System.Utilities;
24
using System.Diagnostics;
35
using System.Drawing;
46
using System.IO;
5-
using System.Net.NetworkInformation;
6-
using System.Reflection;
7-
using System.Windows.Forms;
8-
using System.Xml;
9-
using BorderlessGaming.Logic.Core;
10-
using BorderlessGaming.Logic.Models;
11-
using BorderlessGaming.Logic.Properties;
12-
using BorderlessGaming.Logic.Steam;
13-
using BorderlessGaming.Logic.System.Utilities;
14-
using Ionic.Zip;
7+
using System.IO.Compression;
8+
using System.Text;
9+
1510

1611

1712
namespace BorderlessGaming.Logic.System
1813
{
1914
public static class Tools
2015
{
21-
private static bool HasInternetConnection
22-
{
23-
// There is no way you can reliably check if there is an internet connection, but we can come close
24-
get
25-
{
26-
var result = false;
27-
28-
try
29-
{
30-
if (NetworkInterface.GetIsNetworkAvailable())
31-
{
32-
using (var p = new Ping())
33-
{
34-
var pingReply = p.Send("8.8.4.4", 15000);
35-
if (pingReply != null)
36-
{
37-
var reply = p.Send("8.8.8.8", 15000);
38-
if (reply != null)
39-
{
40-
var send = p.Send("4.2.2.1", 15000);
41-
if (send != null)
42-
{
43-
result = reply.Status == IPStatus.Success ||
44-
pingReply.Status == IPStatus.Success ||
45-
send.Status == IPStatus.Success;
46-
}
47-
}
48-
}
49-
}
50-
}
51-
}
52-
catch
53-
{
54-
// ignored
55-
}
56-
return result;
57-
}
58-
}
59-
6016
public static void Setup()
6117
{
6218
if (!Directory.Exists(AppEnvironment.DataPath))
@@ -69,10 +25,6 @@ public static void Setup()
6925
}
7026
Config.Load();
7127
LanguageManager.Load();
72-
if (!Config.Instance.AppSettings.DisableSteamIntegration)
73-
{
74-
SteamApi.Init();
75-
}
7628
}
7729

7830
public static Rectangle GetContainingRectangle(Rectangle a, Rectangle b)
@@ -107,77 +59,25 @@ public static void GotoSite(string url)
10759

10860
public static void ExtractZipFile(string archiveFilenameIn, string password, string outFolder)
10961
{
110-
using (var zip = ZipFile.Read(archiveFilenameIn))
111-
{
112-
zip.ExtractAll(outFolder, ExtractExistingFileAction.OverwriteSilently);
113-
}
114-
}
115-
116-
public static void CheckForUpdates()
117-
{
118-
if (HasInternetConnection)
62+
using (ZipArchive archive = ZipFile.Open(archiveFilenameIn, ZipArchiveMode.Read, Encoding.UTF8))
11963
{
120-
try
64+
foreach (ZipArchiveEntry entry in archive.Entries)
12165
{
122-
var releasePageUrl = "";
123-
Version newVersion = null;
124-
const string versionConfig = "https://raw.github.com/Codeusa/Borderless-Gaming/master/version.xml";
125-
var reader = new XmlTextReader(versionConfig);
126-
reader.MoveToContent();
127-
var elementName = "";
128-
try
129-
{
130-
if (reader.NodeType == XmlNodeType.Element && reader.Name == "borderlessgaming")
131-
{
132-
while (reader.Read())
133-
{
134-
switch (reader.NodeType)
135-
{
136-
case XmlNodeType.Element:
137-
elementName = reader.Name;
138-
break;
139-
default:
140-
if (reader.NodeType == XmlNodeType.Text && reader.HasValue)
141-
{
142-
switch (elementName)
143-
{
144-
case "version":
145-
newVersion = new Version(reader.Value);
146-
break;
147-
case "url":
148-
releasePageUrl = reader.Value;
149-
break;
150-
}
151-
}
152-
break;
153-
}
154-
}
155-
}
156-
}
157-
catch (Exception)
158-
{
159-
MessageBox.Show(Resources.ErrorUpdates, Resources.ErrorHeader, MessageBoxButtons.OK,
160-
MessageBoxIcon.Error);
161-
}
162-
finally
66+
string destinationPath = Path.Combine(outFolder, entry.FullName);
67+
string destinationDirectory = Path.GetDirectoryName(destinationPath);
68+
69+
if (!Directory.Exists(destinationDirectory))
16370
{
164-
reader.Close();
71+
Directory.CreateDirectory(destinationDirectory);
16572
}
16673

167-
var applicationVersion = Assembly.GetEntryAssembly().GetName().Version;
168-
if (applicationVersion.CompareTo(newVersion) < 0)
74+
if (!string.IsNullOrEmpty(Path.GetFileName(destinationPath))) // Skip directories
16975
{
170-
if (MessageBox.Show(Resources.InfoUpdateAvailable, Resources.InfoUpdatesHeader,
171-
MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes)
172-
{
173-
GotoSite(releasePageUrl);
174-
}
76+
entry.ExtractToFile(destinationPath, overwrite: true);
17577
}
17678
}
177-
catch
178-
{
179-
}
18079
}
18180
}
81+
18282
}
18383
}

BorderlessGaming.Logic/Windows/Manipulation.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System.Windows.Forms;
88
using BorderlessGaming.Logic.Models;
99
using BorderlessGaming.Logic.Properties;
10-
using BorderlessGaming.Logic.Steam;
1110
using BorderlessGaming.Logic.System.Utilities;
1211

1312
namespace BorderlessGaming.Logic.Windows
@@ -210,13 +209,6 @@ public static async Task MakeWindowBorderless(ProcessDetails processDetails, For
210209
processDetails.MadeBorderless = true;
211210
processDetails.MadeBorderlessAttempts++;
212211
}
213-
if (SteamApi.IsLoaded)
214-
{
215-
if (SteamApi.UnlockAchievement("FIRST_TIME_BORDERLESS"))
216-
{
217-
Console.WriteLine("Great!");
218-
}
219-
}
220212
}
221213

222214
private static async Task MakeWindowBorderlessDelayed(ProcessDetails processDetails, Form frmMain,

BorderlessGaming.Logic/packages.config

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

BorderlessGaming/App.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8" ?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<configuration>
33
<startup>
4-
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
55
</startup>
6-
</configuration>
6+
</configuration>

0 commit comments

Comments
 (0)