diff --git a/Preprocessed.iss b/Preprocessed.iss index a11c22c..704687a 100644 --- a/Preprocessed.iss +++ b/Preprocessed.iss @@ -549,8 +549,7 @@ end; ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{7774CEEE-6785-48B9-BA35-6B842F947A21} AppName=Twitchy -AppVersion=0.4.1 -;AppVerName={#MyAppName} {#MyAppVersion} +AppVersion=0.5 DefaultDirName={autopf}\Twitchy DisableProgramGroupPage=yes LicenseFile=.\TwitchDesktopNotifications\Lisence.rtf diff --git a/TwitchDesktopNotifications/Program.cs b/TwitchDesktopNotifications/Program.cs index 56d2686..d3ea1c9 100644 --- a/TwitchDesktopNotifications/Program.cs +++ b/TwitchDesktopNotifications/Program.cs @@ -5,11 +5,12 @@ using System.Reflection.Metadata; using System.Runtime.InteropServices; using System.Text.Json; using System.Windows.Controls; -using System.Windows.Forms; using System.Windows.Media; +using System.Threading; using TwitchDesktopNotifications; using TwitchDesktopNotifications.Core; using TwitchDesktopNotifications.JsonStructure; +using Windows.UI.Core.Preview; internal class Program { @@ -19,7 +20,7 @@ internal class Program private static NotifyIcon notifyIcon; private static ContextMenuStrip cms; - private static ManageIgnores manageIgnores; + private static ManageIgnores? manageIgnores; public static void Ws_CodeRecived(object? sender, EventArgs e) { @@ -83,14 +84,11 @@ internal class Program } } } - [STAThread] private static void Main(string[] args) { try { - var timer = new PeriodicTimer(TimeSpan.FromSeconds(10)); - notifyIcon = new NotifyIcon(); notifyIcon.Icon = new Icon("Assets/icon.ico"); notifyIcon.Text = "Twitch Notify"; @@ -114,19 +112,14 @@ internal class Program TriggerAuthentication(); } - Thread thread = new Thread(() => - { - while (true) + var autoEvent = new AutoResetEvent(false); + var timer = new System.Threading.Timer((Object? stateInfo) => { + if (DataStore.GetInstance().Store != null) { - Thread.Sleep(10000); - if (DataStore.GetInstance().Store != null) - { - TwitchFetcher.GetInstance().GetLiveFollowingUsers(); - } + TwitchFetcher.GetInstance().GetLiveFollowingUsers(); } - }); - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); + }, autoEvent, 1000, 500); + Application.Run(); diff --git a/TwitchDesktopNotifications/sign.ps1 b/TwitchDesktopNotifications/sign.ps1 index 2930870..f89dea5 100644 --- a/TwitchDesktopNotifications/sign.ps1 +++ b/TwitchDesktopNotifications/sign.ps1 @@ -72,14 +72,9 @@ $appArgs = 'sign', $appArgs = $appArgs + $files; #run the signtool -#signtool $appArgs; +signtool $appArgs; # once files are signed package into zip Get-ChildItem './' | where { $_.Name -notin 'sign.ps1'} | Compress-Archive -DestinationPath 'Twitchy.zip' -Update -$setupArgs = - '/pu+', - '/DSourceDir=TwitchDesktopNotifications\bin\x64\ReleaseSign\net6.0-windows10.0.17763.0\', - '../../../../../setup.iss'; -iscc $setupArgs Exit $LASTEXITCODE \ No newline at end of file diff --git a/setup.iss b/setup.iss index 09b198d..48d6ec4 100644 --- a/setup.iss +++ b/setup.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "Twitchy" -#define MyAppVersion "0.4.2" +#define MyAppVersion "0.5" #define MyAppExeName "Twitchy.exe" #ifndef MyAppTargetFramework