Update plików

Kontynuacja pracy z 20 stycznia
This commit is contained in:
Christopher
2021-01-21 20:40:14 +01:00
parent 6f058dfd2f
commit 10fecc540c
49 changed files with 805 additions and 26 deletions
+19 -18
View File
@@ -65,6 +65,8 @@ namespace Notatnik
this.pogrubienieToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.kursywaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.podkreślenieToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.updateSeparator = new System.Windows.Forms.ToolStripSeparator();
this.updateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
@@ -76,8 +78,6 @@ namespace Notatnik
this.printPreviewDialog1 = new System.Windows.Forms.PrintPreviewDialog();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.colorDialog2 = new System.Windows.Forms.ColorDialog();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.updateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.panel1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout();
@@ -513,7 +513,7 @@ namespace Notatnik
this.pogrubienieToolStripMenuItem,
this.kursywaToolStripMenuItem,
this.podkreślenieToolStripMenuItem,
this.toolStripSeparator4,
this.updateSeparator,
this.updateToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(185, 292);
@@ -611,6 +611,21 @@ namespace Notatnik
this.podkreślenieToolStripMenuItem.Text = "Podkreślenie";
this.podkreślenieToolStripMenuItem.Click += new System.EventHandler(this.podkreślenieToolStripMenuItem_Click);
//
// updateSeparator
//
this.updateSeparator.Name = "updateSeparator";
this.updateSeparator.Size = new System.Drawing.Size(181, 6);
this.updateSeparator.Visible = false;
//
// updateToolStripMenuItem
//
this.updateToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.updateToolStripMenuItem.Name = "updateToolStripMenuItem";
this.updateToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.updateToolStripMenuItem.Text = "Update!";
this.updateToolStripMenuItem.Visible = false;
this.updateToolStripMenuItem.Click += new System.EventHandler(this.updateToolStripMenuItem_Click);
//
// openFileDialog1
//
this.openFileDialog1.Filter = "Plik tekstowy (*.txt)|*.txt|Tekst sformatowany (*.rtf)|*.rtf|Strona HTML (*.html)" +
@@ -669,20 +684,6 @@ namespace Notatnik
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.Visible = false;
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(181, 6);
//
// updateToolStripMenuItem
//
this.updateToolStripMenuItem.Enabled = false;
this.updateToolStripMenuItem.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Bold);
this.updateToolStripMenuItem.Name = "updateToolStripMenuItem";
this.updateToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.updateToolStripMenuItem.Text = "Update!";
this.updateToolStripMenuItem.Click += new System.EventHandler(this.updateToolStripMenuItem_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -757,7 +758,7 @@ namespace Notatnik
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator updateSeparator;
private System.Windows.Forms.ToolStripMenuItem updateToolStripMenuItem;
}
}
+7 -4
View File
@@ -10,6 +10,7 @@ using System.Windows.Forms;
using System.IO;
using System.Net;
using System.Net.NetworkInformation;
using System.Diagnostics;
namespace Notatnik
{
@@ -383,26 +384,28 @@ namespace Notatnik
void checkUpdate()
{
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
string urlVersion = "https://raw.githubusercontent.com/KrzysiekSiemv/Notepad/main/version.txt";
WebClient webClient = new WebClient();
Stream stream = webClient.OpenRead(urlVersion);
StreamReader reader = new StreamReader(stream);
String content = reader.ReadToEnd();
string content = reader.ReadLine();
if(Application.ProductVersion != content)
{
toolStripStatusLabel1.Text = "Jest dostępna nowa wersja! Jeżeli chcesz zainstalować, wybierz w Context Menu: Pobierz update!";
statusStrip1.BackColor = Color.FromArgb(255, 202, 81, 0);
updateToolStripMenuItem.Enabled = true;
updateSeparator.Visible = true;
updateToolStripMenuItem.Visible = true;
}
}
private void updateToolStripMenuItem_Click(object sender, EventArgs e)
{
Update update = new Update();
update.Show();
Process.Start("updater.exe");
this.Close();
}
}
}
+1 -1
View File
@@ -27,7 +27,7 @@
<PublisherName>Krzysztof %27KrzysiekSiemv%27 Smaga</PublisherName>
<SuiteName>Notepad</SuiteName>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<ApplicationVersion>1.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.0")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyVersion("1.0.2.0")]
[assembly: AssemblyFileVersion("1.0.2.0")]
+1
View File
@@ -92,6 +92,7 @@ namespace Notatnik
this.button1.TabIndex = 6;
this.button1.Text = "Update";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// progressBar1
//
+5
View File
@@ -38,5 +38,10 @@ namespace Notatnik
{
webClient.DownloadFile("https://github.com/KrzysiekSiemv/Notepad/releases/download/" + content + "/Notatnik.exe", Path.GetTempPath() + "\\Notatnik\\NotatnikUpdate.exe");
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
49ddf053a8af5d6e9369e6d3a8e96ccab85129ad
75f58dc4ce47ae60a4b7e2aa90a185fab752a7be
@@ -18,3 +18,4 @@ C:\Users\Krzysiek\Documents\GitHub\Notepad\Notepad\Notepad v2\obj\Debug\Notepad
C:\Users\Krzysiek\Documents\GitHub\Notepad\Notepad\Notepad v2\obj\Debug\Notepad v2.csproj.CoreCompileInputs.cache
C:\Users\Krzysiek\Documents\GitHub\Notepad\Notepad\Notepad v2\obj\Debug\Notatnik.exe
C:\Users\Krzysiek\Documents\GitHub\Notepad\Notepad\Notepad v2\obj\Debug\Notatnik.pdb
C:\Users\Krzysiek\Documents\GitHub\Notepad\Notepad\Notepad v2\obj\Debug\Notatnik.Update.resources
Binary file not shown.