diff options
| author | EverythingWindows <[email protected]> | 2022-11-03 14:40:32 +0700 |
|---|---|---|
| committer | EverythingWindows <[email protected]> | 2022-11-03 14:40:32 +0700 |
| commit | f7533bbd5465954f670b210cc5e4b02d273a9908 (patch) | |
| tree | 13711d4bbe10c3805cc041ccd0ada3881cc78136 | |
| parent | ec630f54d67fa37e0ad79936c3eaf9cf1cd2ac1f (diff) | |
| download | shiftos-therevival-old-f7533bbd5465954f670b210cc5e4b02d273a9908.tar.gz shiftos-therevival-old-f7533bbd5465954f670b210cc5e4b02d273a9908.tar.bz2 shiftos-therevival-old-f7533bbd5465954f670b210cc5e4b02d273a9908.zip | |
Updater works now0.2
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb | 2 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb | 16 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSUpdater.Designer.vb | 101 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSUpdater.resx | 120 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/MainForms/ShiftOSUpdater.vb | 11 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/My Project/Application.Designer.vb | 2 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/My Project/Application.myapp | 4 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/My Project/AssemblyInfo.vb | 4 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/My Project/Resources.Designer.vb | 9 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/My Project/Resources.resx | 4 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/Resources/CurrentVersion.txt | 1 | ||||
| -rw-r--r-- | ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj | 10 |
12 files changed, 278 insertions, 6 deletions
diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb index a613e25..de8b732 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.Designer.vb @@ -54,7 +54,7 @@ Partial Class ShiftOSMenu Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(162, 19) Me.Label2.TabIndex = 1 - Me.Label2.Text = "Shift is your way" + Me.Label2.Text = "Shift it your way" ' 'btn_Aboot ' diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb index bd1edb2..82af7be 100644 --- a/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb +++ b/ShiftOS-TheRevival/MainForms/ShiftOSMenu.vb @@ -23,6 +23,7 @@ Public Class ShiftOSMenu Catch ex As Exception MsgBox("Why? Because of " & ex.Message) End Try + CheckUpdate() End Sub Private Sub btn_Exit_Click(sender As Object, e As EventArgs) Handles btn_Exit.Click @@ -73,4 +74,19 @@ Public Class ShiftOSMenu btn_Exit.Visible = True End Select End Sub + + Private Sub CheckUpdate() + If File.Exists("C:\SOS_NewVer.txt") = True Then + File.Delete("C:\SOS_NewVer.txt") + End If + My.Computer.Network.DownloadFile("http://148.251.124.62:8080/ShiftOS/data/NewVer.txt", "C:\SOS_NewVer.txt") + Dim CurrentVersion As String = My.Resources.CurrentVersion + Dim NewVersion As String = File.ReadAllText("C:\SOS_NewVer.txt") + If CurrentVersion = NewVersion Then + + Else + ShiftOSUpdater.Show() + ShiftOSUpdater.Label2.Text = "A new version, " & NewVersion & " is available." & Environment.NewLine & "Your version is " & CurrentVersion + End If + End Sub End Class diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.Designer.vb b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.Designer.vb new file mode 100644 index 0000000..24f54ab --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.Designer.vb @@ -0,0 +1,101 @@ +<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ +Partial Class ShiftOSUpdater + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + <System.Diagnostics.DebuggerNonUserCode()> _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + <System.Diagnostics.DebuggerStepThrough()> _ + Private Sub InitializeComponent() + Me.Label1 = New System.Windows.Forms.Label() + Me.Label2 = New System.Windows.Forms.Label() + Me.Button1 = New System.Windows.Forms.Button() + Me.ProgressBar1 = New System.Windows.Forms.ProgressBar() + Me.SuspendLayout() + ' + 'Label1 + ' + Me.Label1.AutoSize = True + Me.Label1.Font = New System.Drawing.Font("Consolas", 24.0!, CType((System.Drawing.FontStyle.Bold Or System.Drawing.FontStyle.Italic), System.Drawing.FontStyle)) + Me.Label1.Location = New System.Drawing.Point(13, 13) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(287, 37) + Me.Label1.TabIndex = 0 + Me.Label1.Text = "ShiftOS Updater" + ' + 'Label2 + ' + Me.Label2.AutoSize = True + Me.Label2.Font = New System.Drawing.Font("Consolas", 12.0!) + Me.Label2.Location = New System.Drawing.Point(20, 54) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(171, 19) + Me.Label2.TabIndex = 1 + Me.Label2.Text = "Checking update..." + ' + 'Button1 + ' + Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button1.Font = New System.Drawing.Font("Consolas", 10.0!) + Me.Button1.Location = New System.Drawing.Point(286, 220) + Me.Button1.Name = "Button1" + Me.Button1.Size = New System.Drawing.Size(86, 29) + Me.Button1.TabIndex = 2 + Me.Button1.Text = "Cancel" + Me.Button1.UseVisualStyleBackColor = True + ' + 'ProgressBar1 + ' + Me.ProgressBar1.BackColor = System.Drawing.Color.Black + Me.ProgressBar1.Cursor = System.Windows.Forms.Cursors.AppStarting + Me.ProgressBar1.ForeColor = System.Drawing.Color.White + Me.ProgressBar1.Location = New System.Drawing.Point(20, 98) + Me.ProgressBar1.Name = "ProgressBar1" + Me.ProgressBar1.Size = New System.Drawing.Size(352, 29) + Me.ProgressBar1.Style = System.Windows.Forms.ProgressBarStyle.Marquee + Me.ProgressBar1.TabIndex = 3 + ' + 'ShiftOSUpdater + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.BackColor = System.Drawing.Color.Black + Me.ClientSize = New System.Drawing.Size(384, 261) + Me.ControlBox = False + Me.Controls.Add(Me.ProgressBar1) + Me.Controls.Add(Me.Button1) + Me.Controls.Add(Me.Label2) + Me.Controls.Add(Me.Label1) + Me.ForeColor = System.Drawing.Color.White + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Name = "ShiftOSUpdater" + Me.ShowIcon = False + Me.ShowInTaskbar = False + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "ShiftOSUpdate" + Me.TopMost = True + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents Label1 As Label + Friend WithEvents Label2 As Label + Friend WithEvents Button1 As Button + Friend WithEvents ProgressBar1 As ProgressBar +End Class diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.resx b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.resx @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root>
\ No newline at end of file diff --git a/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.vb b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.vb new file mode 100644 index 0000000..d264230 --- /dev/null +++ b/ShiftOS-TheRevival/MainForms/ShiftOSUpdater.vb @@ -0,0 +1,11 @@ +Imports System.IO + +Public Class ShiftOSUpdater + Public HasChecked As Boolean + Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click + Close() + End Sub + Private Sub ShiftOSUpdate_Load(sender As Object, e As EventArgs) Handles MyBase.Load + + End Sub +End Class
\ No newline at end of file diff --git a/ShiftOS-TheRevival/My Project/Application.Designer.vb b/ShiftOS-TheRevival/My Project/Application.Designer.vb index 3ab54de..ca29170 100644 --- a/ShiftOS-TheRevival/My Project/Application.Designer.vb +++ b/ShiftOS-TheRevival/My Project/Application.Designer.vb @@ -25,7 +25,7 @@ Namespace My Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) Me.IsSingleInstance = false - Me.EnableVisualStyles = true + Me.EnableVisualStyles = false Me.SaveMySettingsOnExit = true Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterAllFormsClose End Sub diff --git a/ShiftOS-TheRevival/My Project/Application.myapp b/ShiftOS-TheRevival/My Project/Application.myapp index effc3c8..3825827 100644 --- a/ShiftOS-TheRevival/My Project/Application.myapp +++ b/ShiftOS-TheRevival/My Project/Application.myapp @@ -1,10 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MySubMain>true</MySubMain> - <MainForm>Form1</MainForm> + <MainForm>ShiftOSMenu</MainForm> <SingleInstance>false</SingleInstance> <ShutdownMode>1</ShutdownMode> - <EnableVisualStyles>true</EnableVisualStyles> + <EnableVisualStyles>false</EnableVisualStyles> <AuthenticationMode>0</AuthenticationMode> <SaveMySettingsOnExit>true</SaveMySettingsOnExit> </MyApplicationData>
\ No newline at end of file diff --git a/ShiftOS-TheRevival/My Project/AssemblyInfo.vb b/ShiftOS-TheRevival/My Project/AssemblyInfo.vb index 9b0c356..0ef265c 100644 --- a/ShiftOS-TheRevival/My Project/AssemblyInfo.vb +++ b/ShiftOS-TheRevival/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' <Assembly: AssemblyVersion("1.0.*")> -<Assembly: AssemblyVersion("1.0.0.0")> -<Assembly: AssemblyFileVersion("1.0.0.0")> +<Assembly: AssemblyVersion("0.2.0.0")> +<Assembly: AssemblyFileVersion("0.2.0.0")> diff --git a/ShiftOS-TheRevival/My Project/Resources.Designer.vb b/ShiftOS-TheRevival/My Project/Resources.Designer.vb index 413136f..62a3fe0 100644 --- a/ShiftOS-TheRevival/My Project/Resources.Designer.vb +++ b/ShiftOS-TheRevival/My Project/Resources.Designer.vb @@ -68,5 +68,14 @@ Namespace My.Resources Return ResourceManager.GetString("BuildString", resourceCulture) End Get End Property + + '''<summary> + ''' Looks up a localized string similar to 0.2.0. + '''</summary> + Friend ReadOnly Property CurrentVersion() As String + Get + Return ResourceManager.GetString("CurrentVersion", resourceCulture) + End Get + End Property End Module End Namespace diff --git a/ShiftOS-TheRevival/My Project/Resources.resx b/ShiftOS-TheRevival/My Project/Resources.resx index 008acd0..c74daae 100644 --- a/ShiftOS-TheRevival/My Project/Resources.resx +++ b/ShiftOS-TheRevival/My Project/Resources.resx @@ -120,4 +120,8 @@ <data name="BuildString" xml:space="preserve"> <value /> </data> + <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <data name="CurrentVersion" type="System.Resources.ResXFileRef, System.Windows.Forms"> + <value>..\Resources\CurrentVersion.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value> + </data> </root>
\ No newline at end of file diff --git a/ShiftOS-TheRevival/Resources/CurrentVersion.txt b/ShiftOS-TheRevival/Resources/CurrentVersion.txt new file mode 100644 index 0000000..341cf11 --- /dev/null +++ b/ShiftOS-TheRevival/Resources/CurrentVersion.txt @@ -0,0 +1 @@ +0.2.0
\ No newline at end of file diff --git a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj index 0c96be9..d03e8c9 100644 --- a/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj +++ b/ShiftOS-TheRevival/ShiftOS-TheRevival.vbproj @@ -113,6 +113,12 @@ <DependentUpon>ShiftOSMenu.vb</DependentUpon> <SubType>Form</SubType> </Compile> + <Compile Include="MainForms\ShiftOSUpdater.Designer.vb"> + <DependentUpon>ShiftOSUpdater.vb</DependentUpon> + </Compile> + <Compile Include="MainForms\ShiftOSUpdater.vb"> + <SubType>Form</SubType> + </Compile> <Compile Include="MainForms\Strings.vb" /> <Compile Include="MainForms\Terminal.Designer.vb"> <DependentUpon>Terminal.vb</DependentUpon> @@ -145,6 +151,9 @@ <EmbeddedResource Include="MainForms\IntroStory.resx"> <DependentUpon>IntroStory.vb</DependentUpon> </EmbeddedResource> + <EmbeddedResource Include="MainForms\ShiftOSUpdater.resx"> + <DependentUpon>ShiftOSUpdater.vb</DependentUpon> + </EmbeddedResource> <EmbeddedResource Include="MainForms\Terminal.resx"> <DependentUpon>Terminal.vb</DependentUpon> </EmbeddedResource> @@ -185,6 +194,7 @@ </BootstrapperPackage> </ItemGroup> <ItemGroup> + <None Include="Resources\CurrentVersion.txt" /> <Content Include="ShiftOS.ico" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> |
