Add Updater.exe that can update to latest release and debug

This commit is contained in:
Kamil Trzciński 2022-12-11 02:35:46 +01:00
parent 275ce48509
commit 2259e17b21
18 changed files with 623 additions and 59 deletions

View file

@ -55,6 +55,7 @@ namespace FanControl
this.helpLabel = new System.Windows.Forms.Label();
this.sensorWarningLabel = new System.Windows.Forms.Label();
this.propertyGrid1 = new System.Windows.Forms.PropertyGrid();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.contextMenu.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
@ -84,58 +85,59 @@ namespace FanControl
this.toolStripMenuItemStartupOnBootContext,
this.toolStripMenuItemAlwaysOnTopContext,
this.toolStripMenuItem3,
this.toolStripMenuItem5,
this.toolStripSeparator1,
this.toolStripMenuItem1});
this.contextMenu.Name = "fanModeSelectMenu";
this.contextMenu.Size = new System.Drawing.Size(257, 212);
this.contextMenu.Size = new System.Drawing.Size(211, 194);
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Size = new System.Drawing.Size(256, 38);
this.toolStripMenuItem2.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItem2.Text = "&Show";
this.toolStripMenuItem2.Click += new System.EventHandler(this.formShow_Event);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(253, 6);
this.toolStripSeparator3.Size = new System.Drawing.Size(207, 6);
//
// toolStripSeparatorEndOfModes
//
this.toolStripSeparatorEndOfModes.Name = "toolStripSeparatorEndOfModes";
this.toolStripSeparatorEndOfModes.Size = new System.Drawing.Size(253, 6);
this.toolStripSeparatorEndOfModes.Size = new System.Drawing.Size(207, 6);
//
// toolStripMenuItemStartupOnBootContext
//
this.toolStripMenuItemStartupOnBootContext.Name = "toolStripMenuItemStartupOnBootContext";
this.toolStripMenuItemStartupOnBootContext.Size = new System.Drawing.Size(256, 38);
this.toolStripMenuItemStartupOnBootContext.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItemStartupOnBootContext.Text = "Run On &Startup";
this.toolStripMenuItemStartupOnBootContext.Click += new System.EventHandler(this.toolStripMenuItemStartupOnBoot_Click);
//
// toolStripMenuItemAlwaysOnTopContext
//
this.toolStripMenuItemAlwaysOnTopContext.Name = "toolStripMenuItemAlwaysOnTopContext";
this.toolStripMenuItemAlwaysOnTopContext.Size = new System.Drawing.Size(256, 38);
this.toolStripMenuItemAlwaysOnTopContext.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItemAlwaysOnTopContext.Text = "&Always on Top";
this.toolStripMenuItemAlwaysOnTopContext.Click += new System.EventHandler(this.toolStripMenuItemAlwaysOnTop_Click);
//
// toolStripMenuItem3
//
this.toolStripMenuItem3.Name = "toolStripMenuItem3";
this.toolStripMenuItem3.Size = new System.Drawing.Size(256, 38);
this.toolStripMenuItem3.Text = "Help";
this.toolStripMenuItem3.Click += new System.EventHandler(this.help_DoubleClick);
this.toolStripMenuItem3.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItem3.Text = "&Check for Updates";
this.toolStripMenuItem3.Click += new System.EventHandler(this.checkForUpdates_Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(253, 6);
this.toolStripSeparator1.Size = new System.Drawing.Size(207, 6);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(256, 38);
this.toolStripMenuItem1.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItem1.Text = "&Exit";
this.toolStripMenuItem1.Click += new System.EventHandler(this.formClose_Event);
//
@ -146,7 +148,8 @@ namespace FanControl
this.controlToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(711, 44);
this.menuStrip1.Padding = new System.Windows.Forms.Padding(4, 1, 0, 1);
this.menuStrip1.Size = new System.Drawing.Size(438, 30);
this.menuStrip1.TabIndex = 3;
this.menuStrip1.Text = "menuStrip1";
//
@ -156,7 +159,7 @@ namespace FanControl
this.fanModeSelectMenu.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.fanModeSelectMenu.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.fanModeSelectMenu.Name = "fanModeSelectMenu";
this.fanModeSelectMenu.Size = new System.Drawing.Size(249, 40);
this.fanModeSelectMenu.Size = new System.Drawing.Size(155, 28);
this.fanModeSelectMenu.SelectedIndexChanged += new System.EventHandler(this.fanModeSelectMenu_SelectedIndexChanged);
//
// controlToolStripMenuItem
@ -168,39 +171,39 @@ namespace FanControl
this.toolStripSeparator2,
this.exitToolStripMenuItem});
this.controlToolStripMenuItem.Name = "controlToolStripMenuItem";
this.controlToolStripMenuItem.Size = new System.Drawing.Size(113, 40);
this.controlToolStripMenuItem.Size = new System.Drawing.Size(72, 28);
this.controlToolStripMenuItem.Text = "&Control";
//
// toolStripMenuItemStartupOnBoot
//
this.toolStripMenuItemStartupOnBoot.Name = "toolStripMenuItemStartupOnBoot";
this.toolStripMenuItemStartupOnBoot.Size = new System.Drawing.Size(315, 44);
this.toolStripMenuItemStartupOnBoot.Size = new System.Drawing.Size(192, 26);
this.toolStripMenuItemStartupOnBoot.Text = "Run On &Startup";
this.toolStripMenuItemStartupOnBoot.Click += new System.EventHandler(this.toolStripMenuItemStartupOnBoot_Click);
//
// toolStripMenuItemAlwaysOnTop
//
this.toolStripMenuItemAlwaysOnTop.Name = "toolStripMenuItemAlwaysOnTop";
this.toolStripMenuItemAlwaysOnTop.Size = new System.Drawing.Size(315, 44);
this.toolStripMenuItemAlwaysOnTop.Size = new System.Drawing.Size(192, 26);
this.toolStripMenuItemAlwaysOnTop.Text = "&Always on Top";
this.toolStripMenuItemAlwaysOnTop.Click += new System.EventHandler(this.toolStripMenuItemAlwaysOnTop_Click);
//
// toolStripMenuItem4
//
this.toolStripMenuItem4.Name = "toolStripMenuItem4";
this.toolStripMenuItem4.Size = new System.Drawing.Size(315, 44);
this.toolStripMenuItem4.Size = new System.Drawing.Size(192, 26);
this.toolStripMenuItem4.Text = "Help";
this.toolStripMenuItem4.Click += new System.EventHandler(this.help_DoubleClick);
//
// toolStripSeparator2
//
this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(312, 6);
this.toolStripSeparator2.Size = new System.Drawing.Size(189, 6);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(315, 44);
this.exitToolStripMenuItem.Size = new System.Drawing.Size(192, 26);
this.exitToolStripMenuItem.Text = "&Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.formClose_Event);
//
@ -219,8 +222,8 @@ namespace FanControl
this.tableLayoutPanel1.Controls.Add(this.sensorWarningLabel, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.propertyGrid1, 0, 0);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 44);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 30);
this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 4;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
@ -228,7 +231,7 @@ namespace FanControl
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(711, 1046);
this.tableLayoutPanel1.Size = new System.Drawing.Size(438, 454);
this.tableLayoutPanel1.TabIndex = 5;
//
// label1
@ -238,10 +241,10 @@ namespace FanControl
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.label1.ForeColor = System.Drawing.Color.Red;
this.label1.Location = new System.Drawing.Point(4, 950);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Location = new System.Drawing.Point(2, 394);
this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(703, 64);
this.label1.Size = new System.Drawing.Size(434, 40);
this.label1.TabIndex = 9;
this.label1.Text = "This application is highly experimental.\r\nUse at your own risk!";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -254,10 +257,10 @@ namespace FanControl
this.helpLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.helpLabel.Font = new System.Drawing.Font("Segoe UI", 9F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Underline))), System.Drawing.GraphicsUnit.Point);
this.helpLabel.ForeColor = System.Drawing.SystemColors.HotTrack;
this.helpLabel.Location = new System.Drawing.Point(4, 1014);
this.helpLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.helpLabel.Location = new System.Drawing.Point(2, 434);
this.helpLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.helpLabel.Name = "helpLabel";
this.helpLabel.Size = new System.Drawing.Size(703, 32);
this.helpLabel.Size = new System.Drawing.Size(434, 20);
this.helpLabel.TabIndex = 8;
this.helpLabel.Text = "https://steam-deck-tools.ayufan.dev";
this.helpLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -270,10 +273,10 @@ namespace FanControl
this.sensorWarningLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.sensorWarningLabel.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.sensorWarningLabel.ForeColor = System.Drawing.Color.Red;
this.sensorWarningLabel.Location = new System.Drawing.Point(4, 854);
this.sensorWarningLabel.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.sensorWarningLabel.Location = new System.Drawing.Point(2, 334);
this.sensorWarningLabel.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.sensorWarningLabel.Name = "sensorWarningLabel";
this.sensorWarningLabel.Size = new System.Drawing.Size(703, 96);
this.sensorWarningLabel.Size = new System.Drawing.Size(434, 60);
this.sensorWarningLabel.TabIndex = 6;
this.sensorWarningLabel.Text = "Some sensors are missing.\r\nThe fan behavior might be incorrect.\r\nWhich might resu" +
"lt in device overheating.\r\n";
@ -285,24 +288,30 @@ namespace FanControl
this.propertyGrid1.DisabledItemForeColor = System.Drawing.SystemColors.ControlText;
this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.propertyGrid1.HelpVisible = false;
this.propertyGrid1.Location = new System.Drawing.Point(4, 2);
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(4, 2, 4, 2);
this.propertyGrid1.Location = new System.Drawing.Point(2, 1);
this.propertyGrid1.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.propertyGrid1.Name = "propertyGrid1";
this.propertyGrid1.Size = new System.Drawing.Size(703, 850);
this.propertyGrid1.Size = new System.Drawing.Size(434, 332);
this.propertyGrid1.TabIndex = 1;
this.propertyGrid1.ToolbarVisible = false;
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(210, 24);
this.toolStripMenuItem5.Text = "Help";
//
// FanControlForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 32F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 20F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.AutoSize = true;
this.ClientSize = new System.Drawing.Size(711, 1090);
this.ClientSize = new System.Drawing.Size(438, 484);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MainMenuStrip = this.menuStrip1;
this.Margin = new System.Windows.Forms.Padding(6, 6, 6, 6);
this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FanControlForm";
@ -348,5 +357,6 @@ namespace FanControl
private ToolStripMenuItem toolStripMenuItem3;
private ToolStripSeparator toolStripSeparator1;
private ToolStripMenuItem toolStripMenuItem4;
private ToolStripMenuItem toolStripMenuItem5;
}
}

View file

@ -19,6 +19,7 @@ namespace FanControl
Text += " v" + Application.ProductVersion.ToString();
Instance.Open(Text, true, "Global\\FanControlOnce");
Instance.RunUpdater(Text);
if (Instance.WantsRunOnStartup)
startupManager.Startup = true;
@ -147,6 +148,9 @@ namespace FanControl
private void fanLoopTimer_Tick(object sender, EventArgs e)
{
if (fanControl is null)
return;
SharedData_Update();
fanControl.Update(Visible);
}
@ -184,5 +188,10 @@ namespace FanControl
toolStripMenuItemAlwaysOnTopContext.Checked = TopMost;
Settings.Default.AlwaysOnTop = toolStripMenuItemAlwaysOnTop.Checked;
}
private void checkForUpdates_Click(object sender, EventArgs e)
{
Instance.RunUpdater(Text, true);
}
}
}