Skip to content

Commit

Permalink
Security Updates system now in place
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Daws committed Jul 9, 2024
1 parent 6945a14 commit 708a788
Show file tree
Hide file tree
Showing 4 changed files with 134 additions and 4 deletions.
6 changes: 6 additions & 0 deletions .idea/.idea.activator/.idea/projectSettingsUpdater.xml

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

80 changes: 80 additions & 0 deletions .idea/.idea.activator/.idea/workspace.xml

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

48 changes: 44 additions & 4 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using PastebinAPI;
using System.Net;

namespace activator
{
internal static class Program
Expand All @@ -8,10 +11,47 @@ internal static class Program
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new MainWindow());
string needUpdate = new WebClient().DownloadString("https://pastebin.com/raw/4syXnW8w");

if (needUpdate == null | needUpdate == "")
{
MessageBox.Show(
"MSActivate could not check for security updates online.",
"Security Updates Paused",
MessageBoxButtons.OK,
MessageBoxIcon.Asterisk
);

ApplicationConfiguration.Initialize();
Application.Run(new MainWindow());
} else if (needUpdate == "no")
{
ApplicationConfiguration.Initialize();
Application.Run(new MainWindow());
} else
{
DialogResult upgradeMsg = MessageBox.Show(
"MSActivate has a security update avaliable for your version. If you are running that version, you can skip." +
"If not, please download it from MSActivate's GitHub page.",
"Security Update Avaliable",
MessageBoxButtons.CancelTryContinue,
MessageBoxIcon.Exclamation
);

if (upgradeMsg == DialogResult.Cancel)
{
Application.Exit();
}
else if (upgradeMsg == DialogResult.TryAgain)
{
Application.Exit();
}
else if (upgradeMsg == DialogResult.Continue)
{
ApplicationConfiguration.Initialize();
Application.Run(new MainWindow());
}
}
}
}
}
4 changes: 4 additions & 0 deletions activator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<PackageReference Include="PastebinAPI" Version="1.1.1" />
</ItemGroup>

</Project>

0 comments on commit 708a788

Please sign in to comment.