From bf35c06c7f21a92fb387b105dbc783cf0ccae0a8 Mon Sep 17 00:00:00 2001 From: michioxd Date: Thu, 8 Feb 2024 23:32:51 +0700 Subject: [PATCH] 1.1 --- MainForm.Designer.cs | 107 +++++++++++++++++++++++++------ MainForm.cs | 100 ++++++++++++++++++++++++++++- Properties/Resources.Designer.cs | 40 ++++++++++++ Properties/Resources.resx | 12 ++++ Resources/dialog-close.png | Bin 0 -> 991 bytes Resources/dialog-more.png | Bin 0 -> 1172 bytes Resources/lightning.png | Bin 0 -> 1106 bytes Resources/update_drivers.png | Bin 0 -> 1201 bytes TinyDRPC.csproj | 1 + TinyDRPC.iss | 2 +- Utils/Configuration.cs | 8 ++- 11 files changed, 247 insertions(+), 23 deletions(-) create mode 100644 Resources/dialog-close.png create mode 100644 Resources/dialog-more.png create mode 100644 Resources/lightning.png create mode 100644 Resources/update_drivers.png diff --git a/MainForm.Designer.cs b/MainForm.Designer.cs index d004b27..4cfa287 100644 --- a/MainForm.Designer.cs +++ b/MainForm.Designer.cs @@ -64,21 +64,26 @@ private void InitializeComponent() label13 = new Label(); label11 = new Label(); tabPage2 = new TabPage(); + label15 = new Label(); linkLabel3 = new LinkLabel(); tabPage3 = new TabPage(); + checkUpdateBtn = new Button(); runMinimized = new CheckBox(); saveState = new CheckBox(); tabPage4 = new TabPage(); panel1 = new Panel(); - label15 = new Label(); + versionLabel = new Label(); label2 = new Label(); linkLabel4 = new LinkLabel(); tinyDrpcNotifyIcon = new NotifyIcon(components); tinyDrpcTrayIconContext = new ContextMenuStrip(components); + anUpdateIsAvailableToDownloadToolStripMenuItem = new ToolStripMenuItem(); showMainWindowToolStripMenuItem = new ToolStripMenuItem(); startDaemonContext = new ToolStripMenuItem(); toolStripSeparator1 = new ToolStripSeparator(); exitContext = new ToolStripMenuItem(); + updateAvailableBtn = new Button(); + checkUpdateOnStartup = new CheckBox(); tabControl1.SuspendLayout(); tabPage1.SuspendLayout(); tabPage2.SuspendLayout(); @@ -418,6 +423,7 @@ private void InitializeComponent() // // tabPage2 // + tabPage2.Controls.Add(label15); tabPage2.Controls.Add(linkLabel3); tabPage2.Controls.Add(label7); tabPage2.Controls.Add(label9); @@ -433,6 +439,15 @@ private void InitializeComponent() tabPage2.Text = "Image"; tabPage2.UseVisualStyleBackColor = true; // + // label15 + // + label15.AutoSize = true; + label15.Location = new Point(6, 291); + label15.Name = "label15"; + label15.Size = new Size(336, 30); + label15.TabIndex = 8; + label15.Text = "Note: Make sure you uploaded your image to the same app id \r\nyou provided in tab Configuration"; + // // linkLabel3 // linkLabel3.ActiveLinkColor = Color.Teal; @@ -449,6 +464,8 @@ private void InitializeComponent() // // tabPage3 // + tabPage3.Controls.Add(checkUpdateOnStartup); + tabPage3.Controls.Add(checkUpdateBtn); tabPage3.Controls.Add(runMinimized); tabPage3.Controls.Add(discordAppId); tabPage3.Controls.Add(linkLabel2); @@ -464,6 +481,16 @@ private void InitializeComponent() tabPage3.Text = "Configuration"; tabPage3.UseVisualStyleBackColor = true; // + // checkUpdateBtn + // + checkUpdateBtn.Location = new Point(6, 149); + checkUpdateBtn.Name = "checkUpdateBtn"; + checkUpdateBtn.Size = new Size(207, 23); + checkUpdateBtn.TabIndex = 11; + checkUpdateBtn.Text = "Check update now"; + checkUpdateBtn.UseVisualStyleBackColor = true; + checkUpdateBtn.Click += checkUpdateBtn_Click; + // // runMinimized // runMinimized.AutoSize = true; @@ -481,16 +508,16 @@ private void InitializeComponent() saveState.AutoSize = true; saveState.Location = new Point(6, 99); saveState.Name = "saveState"; - saveState.Size = new Size(203, 19); + saveState.Size = new Size(207, 19); saveState.TabIndex = 9; - saveState.Text = "Save running state for next statup"; + saveState.Text = "Save running state for next startup"; saveState.UseVisualStyleBackColor = true; saveState.CheckedChanged += saveState_CheckedChanged; // // tabPage4 // tabPage4.Controls.Add(panel1); - tabPage4.Controls.Add(label15); + tabPage4.Controls.Add(versionLabel); tabPage4.Controls.Add(label2); tabPage4.Controls.Add(linkLabel4); tabPage4.Location = new Point(4, 24); @@ -509,14 +536,14 @@ private void InitializeComponent() panel1.Size = new Size(100, 100); panel1.TabIndex = 0; // - // label15 + // versionLabel // - label15.AutoSize = true; - label15.Location = new Point(87, 177); - label15.Name = "label15"; - label15.Size = new Size(192, 15); - label15.TabIndex = 1; - label15.Text = "Version: 1.0 - powered by michioxd"; + versionLabel.AutoSize = true; + versionLabel.Location = new Point(87, 177); + versionLabel.Name = "versionLabel"; + versionLabel.Size = new Size(192, 15); + versionLabel.TabIndex = 1; + versionLabel.Text = "Version: 1.1 - powered by michioxd"; // // label2 // @@ -550,42 +577,81 @@ private void InitializeComponent() // // tinyDrpcTrayIconContext // - tinyDrpcTrayIconContext.Items.AddRange(new ToolStripItem[] { showMainWindowToolStripMenuItem, startDaemonContext, toolStripSeparator1, exitContext }); + tinyDrpcTrayIconContext.Items.AddRange(new ToolStripItem[] { anUpdateIsAvailableToDownloadToolStripMenuItem, showMainWindowToolStripMenuItem, startDaemonContext, toolStripSeparator1, exitContext }); tinyDrpcTrayIconContext.Name = "tinyDrpcTrayIconContext"; - tinyDrpcTrayIconContext.Size = new Size(181, 76); + tinyDrpcTrayIconContext.Size = new Size(266, 98); + // + // anUpdateIsAvailableToDownloadToolStripMenuItem + // + anUpdateIsAvailableToDownloadToolStripMenuItem.Font = new Font("Segoe UI", 9F, FontStyle.Bold, GraphicsUnit.Point, 0); + anUpdateIsAvailableToDownloadToolStripMenuItem.Image = Properties.Resources.update_drivers; + anUpdateIsAvailableToDownloadToolStripMenuItem.Name = "anUpdateIsAvailableToDownloadToolStripMenuItem"; + anUpdateIsAvailableToDownloadToolStripMenuItem.Size = new Size(265, 22); + anUpdateIsAvailableToDownloadToolStripMenuItem.Text = "An update is available to download"; + anUpdateIsAvailableToDownloadToolStripMenuItem.Visible = false; // // showMainWindowToolStripMenuItem // + showMainWindowToolStripMenuItem.Image = Properties.Resources.dialog_more; showMainWindowToolStripMenuItem.Name = "showMainWindowToolStripMenuItem"; - showMainWindowToolStripMenuItem.Size = new Size(180, 22); + showMainWindowToolStripMenuItem.Size = new Size(265, 22); showMainWindowToolStripMenuItem.Text = "Show Main Window"; showMainWindowToolStripMenuItem.Click += showMainWindowToolStripMenuItem_Click; // // startDaemonContext // + startDaemonContext.Image = Properties.Resources.lightning; startDaemonContext.Name = "startDaemonContext"; - startDaemonContext.Size = new Size(180, 22); + startDaemonContext.Size = new Size(265, 22); startDaemonContext.Text = "Start daemon"; startDaemonContext.Click += startDaemonContext_Click; // // toolStripSeparator1 // toolStripSeparator1.Name = "toolStripSeparator1"; - toolStripSeparator1.Size = new Size(177, 6); + toolStripSeparator1.Size = new Size(262, 6); // // exitContext // + exitContext.Image = Properties.Resources.dialog_close; exitContext.Name = "exitContext"; - exitContext.Size = new Size(180, 22); + exitContext.Size = new Size(265, 22); exitContext.Text = "Quit TinyDRPC"; exitContext.Click += exitContext_Click; // + // updateAvailableBtn + // + updateAvailableBtn.AccessibleDescription = "An update is available to download."; + updateAvailableBtn.Image = Properties.Resources.update_drivers; + updateAvailableBtn.ImageAlign = ContentAlignment.MiddleLeft; + updateAvailableBtn.Location = new Point(273, 12); + updateAvailableBtn.Name = "updateAvailableBtn"; + updateAvailableBtn.Size = new Size(120, 25); + updateAvailableBtn.TabIndex = 12; + updateAvailableBtn.Text = " Update available"; + updateAvailableBtn.UseVisualStyleBackColor = true; + updateAvailableBtn.Visible = false; + // + // checkUpdateOnStartup + // + checkUpdateOnStartup.AutoSize = true; + checkUpdateOnStartup.Checked = true; + checkUpdateOnStartup.CheckState = CheckState.Checked; + checkUpdateOnStartup.Location = new Point(6, 124); + checkUpdateOnStartup.Name = "checkUpdateOnStartup"; + checkUpdateOnStartup.Size = new Size(156, 19); + checkUpdateOnStartup.TabIndex = 12; + checkUpdateOnStartup.Text = "Check update on startup"; + checkUpdateOnStartup.UseVisualStyleBackColor = true; + checkUpdateOnStartup.CheckedChanged += checkUpdateOnStartup_CheckedChanged; + // // MainForm // AutoScaleDimensions = new SizeF(7F, 15F); AutoScaleMode = AutoScaleMode.Font; BackColor = SystemColors.Window; ClientSize = new Size(404, 513); + Controls.Add(updateAvailableBtn); Controls.Add(tabControl1); Controls.Add(status); Controls.Add(label10); @@ -654,7 +720,7 @@ private void InitializeComponent() private TabPage tabPage4; private LinkLabel linkLabel3; private Panel panel1; - private Label label15; + private Label versionLabel; private Label label2; private LinkLabel linkLabel4; private NotifyIcon tinyDrpcNotifyIcon; @@ -665,5 +731,10 @@ private void InitializeComponent() private ToolStripMenuItem showMainWindowToolStripMenuItem; private CheckBox saveState; private CheckBox runMinimized; + private Button updateAvailableBtn; + private ToolStripMenuItem anUpdateIsAvailableToDownloadToolStripMenuItem; + private Label label15; + private Button checkUpdateBtn; + private CheckBox checkUpdateOnStartup; } } diff --git a/MainForm.cs b/MainForm.cs index b6ee200..aa79fb9 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -3,13 +3,13 @@ using TinyDRPC.Utils; using BlueMystic; using Microsoft.Win32; -using System.Windows.Forms; +using Newtonsoft.Json; namespace TinyDRPC { public partial class MainForm : Form { - + public string CurrentVersion = "1.1"; private DiscordRpcClient? drpc; public MainForm() @@ -17,12 +17,83 @@ public MainForm() InitializeComponent(); } + private class VersionInfo + { + [JsonProperty("latestVersion")] + public string LatestVersion { get; set; } + + [JsonProperty("download")] + public string Download { get; set; } + } + private bool ValidateUrl(string url) { return Uri.TryCreate(url, UriKind.Absolute, out Uri uriResult) && (uriResult.Scheme == Uri.UriSchemeHttp || uriResult.Scheme == Uri.UriSchemeHttps); } + private void CheckForUpdate() + { + checkUpdateBtn.Enabled = false; + checkUpdateBtn.Text = "Checking..."; + _ = this.Invoke(new MethodInvoker(async delegate () + { + using var httpClient = new HttpClient(new HttpClientHandler { AllowAutoRedirect = true }); + try + { + string jsonContent = await httpClient.GetStringAsync("https://michioxd.github.io/TinyDRPC/fetchVersion.json"); + var versionInfo = JsonConvert.DeserializeObject(jsonContent); + checkUpdateBtn.Text = "Check update now"; + checkUpdateBtn.Enabled = true; + + if (versionInfo != null) + { + if (string.Compare(CurrentVersion, versionInfo.LatestVersion) < 0) + { + updateAvailableBtn.Visible = true; + updateAvailableBtn.Click += (object sender, EventArgs e) => + { + DialogResult result = MessageBox.Show($"A newer version ({versionInfo.LatestVersion}) is available for download. Do you want to go to browser and download it?", "TinyDRPC Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Information); + if (result == DialogResult.Yes) + { + new OpenBrowser(versionInfo.Download); + } + }; + anUpdateIsAvailableToDownloadToolStripMenuItem.Visible = true; + anUpdateIsAvailableToDownloadToolStripMenuItem.Click += (object sender, EventArgs e) => + { + DialogResult result = MessageBox.Show($"A newer version ({versionInfo.LatestVersion}) is available for download. Do you want to go to browser and download it?", "TinyDRPC Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Information); + if (result == DialogResult.Yes) + { + new OpenBrowser(versionInfo.Download); + } + }; + if (tinyDrpcNotifyIcon.Visible == true) + { + tinyDrpcNotifyIcon.BalloonTipIcon = ToolTipIcon.Info; + tinyDrpcNotifyIcon.BalloonTipText = $"A newer version ({versionInfo.LatestVersion}) is available for download. Click this notification to download now!"; + tinyDrpcNotifyIcon.BalloonTipTitle = "An update of TinyRDPC is available to download"; + tinyDrpcNotifyIcon.BalloonTipClicked += (object sender, EventArgs e) => + { + DialogResult result = MessageBox.Show($"A newer version ({versionInfo.LatestVersion}) is available for download. Do you want to go to browser and download it?", "TinyDRPC Update Available", MessageBoxButtons.YesNo, MessageBoxIcon.Information); + if (result == DialogResult.Yes) + { + new OpenBrowser(versionInfo.Download); + } + }; + tinyDrpcNotifyIcon.ShowBalloonTip(5000); + } + } + } + } + catch (HttpRequestException ex) + { + checkUpdateBtn.Text = "Got error during check update"; + checkUpdateBtn.Enabled = true; + } + })); + } + private void MainForm_Load(object sender, EventArgs e) { ConfigurationManager configManager = new ConfigurationManager(); @@ -43,8 +114,10 @@ private void MainForm_Load(object sender, EventArgs e) runOnStartup.CheckState = config.runOnStartup ? CheckState.Checked : CheckState.Unchecked; saveState.CheckState = config.saveRunningState ? CheckState.Checked : CheckState.Unchecked; runMinimized.CheckState = config.runMinimized ? CheckState.Checked : CheckState.Unchecked; + checkUpdateOnStartup.CheckState = config.checkUpdateOnStartup ? CheckState.Checked : CheckState.Unchecked; runMinimized.Enabled = runOnStartup.Checked; + versionLabel.Text = $"Version: {CurrentVersion} - powered by michioxd"; if (config.runMinimized && config.runOnStartup) { @@ -58,6 +131,11 @@ private void MainForm_Load(object sender, EventArgs e) }), null, 50, Timeout.Infinite); } + if (checkUpdateOnStartup.Checked) + { + CheckForUpdate(); + } + if (config.saveRunningState == true && config.lastStateIsRunning == true) { prepareDaemon(); @@ -223,6 +301,15 @@ private void runMinimized_CheckedChanged(object sender, EventArgs e) configManager.SaveConfiguration(config); } + private void checkUpdateOnStartup_CheckedChanged(object sender, EventArgs e) + { + ConfigurationManager configManager = new ConfigurationManager(); + TinyDRPC.Utils.Configuration config = configManager.LoadConfiguration(); + + config.checkUpdateOnStartup = checkUpdateOnStartup.Checked; + configManager.SaveConfiguration(config); + } + private void changeLastRunningState(Boolean state) { ConfigurationManager configManager = new ConfigurationManager(); @@ -382,7 +469,7 @@ private void MainFormOnResize(object sender, EventArgs e) tinyDrpcNotifyIcon.Visible = true; ConfigurationManager configManager = new ConfigurationManager(); TinyDRPC.Utils.Configuration config = configManager.LoadConfiguration(); - if(config.minimizedAtFirst == false) + if (config.minimizedAtFirst == false) { tinyDrpcNotifyIcon.BalloonTipIcon = ToolTipIcon.Info; tinyDrpcNotifyIcon.BalloonTipText = "TinyDRPC is minimized in the system tray; to open the main window, double-click on this icon; you only see this tip once. Enjoy!"; @@ -427,5 +514,12 @@ private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs { new OpenBrowser("https://github.com/michioxd/TinyDRPC/tree/master?tab=readme-ov-file#how-to-get-image-key"); } + + private void checkUpdateBtn_Click(object sender, EventArgs e) + { + CheckForUpdate(); + } + + } } diff --git a/Properties/Resources.Designer.cs b/Properties/Resources.Designer.cs index 5608cfa..060c465 100644 --- a/Properties/Resources.Designer.cs +++ b/Properties/Resources.Designer.cs @@ -60,6 +60,36 @@ internal Resources() { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap dialog_close { + get { + object obj = ResourceManager.GetObject("dialog_close", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap dialog_more { + get { + object obj = ResourceManager.GetObject("dialog_more", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap lightning { + get { + object obj = ResourceManager.GetObject("lightning", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -69,5 +99,15 @@ internal static System.Drawing.Bitmap tinydrpc_100x100 { return ((System.Drawing.Bitmap)(obj)); } } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap update_drivers { + get { + object obj = ResourceManager.GetObject("update_drivers", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } } } diff --git a/Properties/Resources.resx b/Properties/Resources.resx index 45ff40a..d789876 100644 --- a/Properties/Resources.resx +++ b/Properties/Resources.resx @@ -118,7 +118,19 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + ..\Resources\dialog-close.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\dialog-more.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\lightning.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + ..\Resources\tinydrpc_100x100.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\update_drivers.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/Resources/dialog-close.png b/Resources/dialog-close.png new file mode 100644 index 0000000000000000000000000000000000000000..5efd28341c75d9c8e8c5e5dcfa2734e740829521 GIT binary patch literal 991 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE0z%d<2gY`4S99w&sfq}{0)5S5w;`GvBNB>6-61Bm*CQREV(Y(8R z%F_e)e0tpVv!nMEKG?!upLBk&pm6TjCyhrYNchV+L~K*)-4dZQ_vM>|tsU(8b<0nF zzgP3~UbS&cao_nVJFIq0Q+<|ZEZx$Od8@Os&hNfZ>}jFm#0=&e2Ug%-QH5)^>r{S!&L_Sr-dlFf^=sy(~{c z=xZ&TmUUoYis4cqrUXE9!h~ov5JJt7$8Lsdwp5ZFU;(GAG8y&vm z$?s3!jlKP3&ZJN-J;kJ;_10NSlm1v(P1^iZ#xj(ZVS_=-f>jbRF-I;|yb=BNciTzJ z*!&G<-2#ORU-xa>{d;v)#fpZ1{7xci2QcT zC-{O2?G2CF{Ds`Np;pE%g zKSHi?KY#AzW$5p*tgo_7e*WBFa*nch@P_a259o``X<8(~FyYMed)rkaU;p8_Z%{br z^i76<#5YfJL*ySm*?j+}{Fd*r-YtGv-N5vvTH+c}l9E`GYL#4+3Zxi}3=9o)4UBXR z%|i^#tqhEK5xN(&Z@6a?xnX{ssFLZgnWUTIb8Lwztf2x0%>P?t>g5MTJfaizl7x ztFk#>Tyo6#{mjby&v(8TyX>aElzZLX(!V=)?vx3(n*06U7x_2$&A+eY*t@AGwLakQ zm+Q^#^Iv~G|F6bMcG)j>v-GZS^Z4&qzW`5ul)3o2y*BaR^z9G)W1BvYzoIZs zCiD8!rMwr@eE0XP_}qGB8$-Iy2Ns8A438Vli*x#?KGc|a#h^jw`F;@w`;VCqmZe|F zJ=G&@>XEf1B_TmCbwk(z_qrh4DGzc))9zapu2DRD-6T`JU_!>VFz@v%w6;nG_9m#! zy#Bp>|J~?;(k{CI!L>Sig^!&h$H=&IRYF@MSA}fm4m0 zleMP&{nTFZdVBfVHJNR}!JLj(dC&Lhv^9mj%bfPQCvSaT=)L|nrH+nSFQ4tW^8S!~ z_iFXso4NN+nR=Gb;N6c_KRG|s@;zVL&bKIuSD5rkmtWiO6Z&`U`M*Ct3K&H-yBAff zZYX;9E}?ZdgL8xO{5Ny6-&Wk<#vjwMLhtIY@eDl>$XQnyLZqGD7bv7SJ z@x45Y&1BcfGg|~@*4ED#+tc9kx4yx8cGi!r3rbHVb*}e{S+!mCX2rEB^RK-B{P&>T z-(UC6K8@7hcD=iMW!LrE{~z@~xPC49BY*9n-kl}dNA~~|rEH07M2T~LZf9nN|ta z0JOm{#L&db$kNKx5~5+2;TA@q1{08zd@_?$^NLd$GD=Dctn~H4c4d~OCIh{cpI5Ax zUzDz&15r|}?;hZzZ=`3SpOeM50%jq^E&^U+6OZW!YLEa~7@S{Pl$^@onO9PjnO>Tz z;F+ACrx2W4vQB-WJy4AsLQQ;VkPpmV#hJMUIjNa>dHH3DC7JnodU>fO`k8qtsTFz! p83pzQiRr1fMn-DIV8d;V)G||Sjix&OJO(t8!PC{xWt~$(698ox>R12( literal 0 HcmV?d00001 diff --git a/Resources/lightning.png b/Resources/lightning.png new file mode 100644 index 0000000000000000000000000000000000000000..6dbe6e39cce9aac60f7d56bb1519d3fcf6276cc0 GIT binary patch literal 1106 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Ea{HEjtmUzPnffIy#(^vlDyqr zfHV;NblzPLq&N#aB8!2v2N=7Z%(epwmK8Xr18J~%3^B*n9%f)*67Y0!46!)9G}t#g zI8eaWbMka0->p&_8J?PIx*mariH--g^t#FxD|vOs{$#&%!~Vij?f(rO3NKCt9o)L^ zkKgM>8J~mJ1RdGZ`_g^V_h0YkTIwau-m+|kML|MZ;ki3Ajm=$z{tHh$w#cIN9plu+ zDvqHJoL;)ivuwrx-ZGu?_MdOVsWbQH@vLBRahzziX2GsMV*ge}-&4sKj;O0IyVJS+ zaKHhP`3=XMdKsCUGahmMncDv$Jocs3sbkW!+g{%-T~m7B(BrFc2CIpwi|}-TDdG>- z?g+TJZ>}{5^MOmVjl&mLPvUdpTVli<)!60geVcQ|$^-Ey9nG$_O%`ANd=^*0*L}kN z&D)rwerKn37wB-VH|bumr@-3M=I@%B+zSt#zRaxa_b7DFYo?~Bo*4-a$qV-JFaK=R z_0BoSp`io%jTcv3UaB>ts^UTw-!CoxIXha}WcLw$ z|9-oC`-(b)M=}g+5B~aI{=sXfY1g-9?$5b)$32?1bW!uf2&Sn=`9E}Rp0J?Gd}?97 zY3!qO;%EH7_-{QHe0*h7mf`p2Meae8+Z$q&W*_+DQZFqLw_M{0OL>s;&W-iId_-#3 zCW&iSS(r}J{@)p+JTdx&{VVB=HUHV{8J)a(Qj`T641oznwZt`|B)KRxu_RSD1xPR$ z85mgV8XD>vnuQn{Ss7Yb8Jg=Fm|GbbL^J$52-5&kX$8>*)L>|!YXH<>7-C>%Wol$) zVg}Lhm+e?HiiX_$l+3hB+!}hK>+FFVl0Z)K$xKeoD^6v|C@Cqh($@#um06aWoS&PU zpI5AxUzDz&15r|}pH!)DtY@IFkYA)gq;exYQ~mBXn^c(dATEOk0MG-*x`sv}Mut|V zCRT<<5dTEnGkgHlAPI6_aDG}zd16s2gJVj5QmTSyZen_BP- z#KdTEKd5Tpn6vwluul71#g aqkb{a4E;k#czJ=^89ZJ6T-G@yGywpF;-K^Z literal 0 HcmV?d00001 diff --git a/Resources/update_drivers.png b/Resources/update_drivers.png new file mode 100644 index 0000000000000000000000000000000000000000..ca3dd733a0052226c41a72d0c125c47a26cbf98d GIT binary patch literal 1201 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE(}6TtKSRv1wTBrPm>zk$IEGl9PMzqR5fdtMy#D*$-}h=%CL8=* za5S?yWQ&HckKqjwao^cZTNIqkr{*15JEcr9!>ijnI(r49p@4YnGNq2$D!mdcrkSAv zx>waUwl+=c$b9W%JhyVP`R9G_N+-@-cxcFr6N)zh$iZh%nSyWnZ+}n10N!RUFFPJ9J{`S1FoAP!bAScs+Xi9_x)Y7pI$sY&mygW8?Y;rhssPgbh2s z8XR5!^s$Dv!qs_+SN9(GIxX9@&E4nEPp-l%uD>2K-m}}a`{hEZOQ)u}Ogz?Qyyr)h z^tn|}e%r4L%+kK_z0J9@)SCPK?wrzZ3w!TzaBYxMSt)YWV1c^fsjJ?r?_{6<{P@uJ zKXs4IT=Qo^^*=gFwVIhYq(R(&wU@lQS26`rGFC zx#_3;y4YINshRE^-5Pxh-mU6o*%521LFP6dPfUw@{iV)zhIBckI#R* ze(KbR6N8oK-#C@_-W%jWWe_w37-Z8Fl^O`v=NNMSkpp^<;N0sj0z02U_b@S52 ziysf2Zs)6?=eN}OZSLCB4VqK$#Kv9KKI7vr`_1P4dyTFbg>%n8OEkwu81xs{=Xm63(6fw`4|f#JkWIxr0&l~xd4Kn;clx(0?oJs}1bRwhPP z#!wA&rlfC2(U6;;l9^VCTf^Iv_ql-@OhHca$xKeoD^6v|C@Cqh($@#um06aWoS&PU zpI5AxUzDz&15r|}@8cfeqi>{VsBe96iv-L@h-H|5GO;o?1R{u^^cL1n0BR5e*%+K( zT9lm1;9OK$T#}fh5Kxq#m6}}g`tg%)pbB+_iulkVADFXJ%TkLHb5ip4fbIgi5v)^x T>BPy=KrIZOu6{1-oD!Mtinydrpc_100x100.png https://github.com/michioxd/TinyDRPC README.md + 1.1 diff --git a/TinyDRPC.iss b/TinyDRPC.iss index e342d2c..581692d 100644 --- a/TinyDRPC.iss +++ b/TinyDRPC.iss @@ -5,7 +5,7 @@ #include "CodeDependencies.iss" #define MyAppName "TinyDRPC" -#define MyAppVersion "1.0" +#define MyAppVersion "1.1" #define MyAppPublisher "michioxd" #define MyAppURL "https://github.com/michioxd/TinyDRPC" #define MyAppExeName "TinyDRPC.exe" diff --git a/Utils/Configuration.cs b/Utils/Configuration.cs index 2e577f5..f85cba7 100644 --- a/Utils/Configuration.cs +++ b/Utils/Configuration.cs @@ -22,6 +22,7 @@ public class Configuration public bool lastStateIsRunning { get; set; } public bool runMinimized { get; set; } public bool minimizedAtFirst { get; set; } + public bool checkUpdateOnStartup { get; set; } } public class ConfigurationManager @@ -77,6 +78,7 @@ public void SaveConfiguration(Configuration config) writer.WriteLine($"lastStateIsRunning={(config.lastStateIsRunning ? "1" : "0")}"); writer.WriteLine($"runMinimized={(config.runMinimized ? "1" : "0")}"); writer.WriteLine($"minimizedAtFirst={(config.minimizedAtFirst ? "1" : "0")}"); + writer.WriteLine($"checkUpdateOnStartup={(config.checkUpdateOnStartup ? "1" : "0")}"); } } @@ -135,6 +137,9 @@ private void SetProperty(Configuration config, string key, string value) case "minimizedAtFirst": config.minimizedAtFirst = (value == "1") ? true : false; break; + case "checkUpdateOnStartup": + config.checkUpdateOnStartup = (value == "1") ? true : false; + break; default: throw new Exception($"Unknown key: {key}"); } @@ -160,7 +165,8 @@ private Configuration CreateDefaultConfiguration() saveRunningState = true, lastStateIsRunning = false, runMinimized = true, - minimizedAtFirst = false + minimizedAtFirst = false, + checkUpdateOnStartup = true }; SaveConfiguration(config); return config;