mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 22:15:18 -04:00
39 lines
No EOL
1.1 KiB
C#
39 lines
No EOL
1.1 KiB
C#
using System;
|
|
using System.Globalization;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Windows;
|
|
|
|
namespace DiscordChatExporter.Gui;
|
|
|
|
public static class Sanctions
|
|
{
|
|
[ModuleInitializer]
|
|
internal static void Verify()
|
|
{
|
|
var isSkipped = string.Equals(
|
|
Environment.GetEnvironmentVariable("RUSNI"),
|
|
"PYZDA",
|
|
StringComparison.OrdinalIgnoreCase
|
|
);
|
|
|
|
if (isSkipped)
|
|
return;
|
|
|
|
var isSanctioned =
|
|
CultureInfo.CurrentCulture.Name.EndsWith("-ru", StringComparison.OrdinalIgnoreCase) ||
|
|
CultureInfo.CurrentCulture.Name.EndsWith("-by", StringComparison.OrdinalIgnoreCase);
|
|
|
|
if (!isSanctioned)
|
|
return;
|
|
|
|
MessageBox.Show(
|
|
"You cannot use this software on the territory of a terrorist state. " +
|
|
"Set the environment variable `RUSNI=PYZDA` if you wish to override this check.",
|
|
"Sanctioned region",
|
|
MessageBoxButton.OK,
|
|
MessageBoxImage.Error
|
|
);
|
|
|
|
Environment.Exit(0xFACC);
|
|
}
|
|
} |