0.2.4 final code

This commit is contained in:
EverythingWindows 2022-11-09 08:42:46 +07:00
parent e2051f44b8
commit 850353a885
5 changed files with 95 additions and 18 deletions

View file

@ -27,7 +27,6 @@ Public Class ShiftOSMenu
' MsgBox("Why? Because of " & ex.Message) ' MsgBox("Why? Because of " & ex.Message)
'End Try 'End Try
CheckInstall() CheckInstall()
CheckUpdate()
BannerChange.Start() BannerChange.Start()
End Sub End Sub
@ -56,8 +55,8 @@ Public Class ShiftOSMenu
Case "Continue" Case "Continue"
Strings.IsFree = False Strings.IsFree = False
Strings.OnceInfo(6) = "story" Strings.OnceInfo(6) = "story"
Terminal.Show()
Terminal.StayAtChapter = True Terminal.StayAtChapter = True
Terminal.Show()
Close() Close()
Case "No" Case "No"
Label3.Visible = False Label3.Visible = False
@ -156,17 +155,25 @@ Public Class ShiftOSMenu
Private Sub CheckInstall() Private Sub CheckInstall()
If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then
'Dim WhatVersion As String = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt") Dim CurrentVersion As String = My.Resources.CurrentVersion
'If WhatVersion = My.Resources.CurrentVersion Then If File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt") = True Then
TheUpdater.WhatVersion = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt")
'Else Else
' btn_Aboot.Enabled = False TheUpdater.WhatVersion = "0.2.3"
' btn_Exit.Enabled = False End If
' btn_FreeRoam.Enabled = False If TheUpdater.WhatVersion = My.Resources.CurrentVersion Then
' btn_StoryMode.Enabled = False File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt", My.Resources.CurrentVersion)
' ShouldUpdate = True CheckUpdate()
' ShiftOSUpdater.Show() Else
'End If btn_Aboot.Enabled = False
btn_Exit.Enabled = False
btn_FreeRoam.Enabled = False
btn_StoryMode.Enabled = False
ShouldUpdate = True
ShiftOSUpdater.Show()
ShiftOSUpdater.Label2.Text = "A new version, " & CurrentVersion & " is available." & Environment.NewLine & "Update now to get more features."
ShiftOSUpdater.Button2.Text = "Update"
End If
Else Else
If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS") = True Then If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS") = True Then
If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then If Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\ShiftFS") = True Then

View file

@ -40,15 +40,15 @@ Public Class ShiftOSUpdater
Button2.Text = "Saved" Button2.Text = "Saved"
End If End If
ElseIf Button2.Text = "Update" Then ElseIf Button2.Text = "Update" Then
Label2.Text = "Updating ShiftOS from" & My.Resources.CurrentVersion & " to " & NewVersion Label2.Text = "Updating ShiftOS to " & My.Resources.CurrentVersion
UpdateToNew()
Else Else
Close()
End If End If
End Sub End Sub
Private Sub ShiftOSUpdate_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub ShiftOSUpdate_Load(sender As Object, e As EventArgs) Handles MyBase.Load
If ShiftOSMenu.ShouldUpdate = True Then If ShiftOSMenu.ShouldUpdate = True Then
Button1.Text = "Update" Button2.Text = "Update"
End If End If
End Sub End Sub

View file

@ -0,0 +1,69 @@
Imports System.IO
Module TheUpdater
Public WhatVersion As String
Public Sub UpdateToNew()
Dim AvailableFeatureHere As String() = File.ReadAllLines(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\saved\AvailableFeature.sos")
Dim ComputerInfoHere As String() = File.ReadAllLines(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\saved\ComputerInfo.sos")
Select Case WhatVersion
Case "0.2.3"
Strings.AvailableFeature(0) = AvailableFeatureHere(0)
Strings.AvailableFeature(1) = AvailableFeatureHere(1)
Strings.AvailableFeature(2) = AvailableFeatureHere(2)
Strings.AvailableFeature(3) = AvailableFeatureHere(3)
Strings.AvailableFeature(4) = AvailableFeatureHere(4)
Strings.AvailableFeature(5) = AvailableFeatureHere(5)
Strings.AvailableFeature(6) = AvailableFeatureHere(6)
Strings.AvailableFeature(7) = AvailableFeatureHere(7)
Strings.AvailableFeature(8) = AvailableFeatureHere(8)
Strings.AvailableFeature(9) = AvailableFeatureHere(9)
Strings.AvailableFeature(10) = AvailableFeatureHere(10)
Strings.AvailableFeature(11) = AvailableFeatureHere(11)
Strings.AvailableFeature(12) = AvailableFeatureHere(12)
Strings.AvailableFeature(13) = AvailableFeatureHere(13)
Strings.AvailableFeature(14) = AvailableFeatureHere(14)
Strings.AvailableFeature(15) = AvailableFeatureHere(15)
Strings.AvailableFeature(16) = "0"
Strings.AvailableFeature(17) = "0"
Strings.AvailableFeature(18) = "0"
Strings.AvailableFeature(19) = "0"
Strings.AvailableFeature(20) = "0"
Strings.AvailableFeature(21) = "0"
Strings.AvailableFeature(22) = "0"
If Strings.AvailableFeature(15) = 1 Then
Strings.AvailableFeature(16) = "0"
Else
Strings.AvailableFeature(16) = "2"
End If
Strings.AvailableFeature(17) = "2"
If Strings.AvailableFeature(2) = 1 Then
Strings.AvailableFeature(18) = "0"
Strings.AvailableFeature(21) = "0"
Else
Strings.AvailableFeature(18) = "2"
Strings.AvailableFeature(21) = "2"
End If
If Strings.AvailableFeature(0) = 1 Then
Strings.AvailableFeature(19) = "0"
Strings.AvailableFeature(20) = "0"
Else
Strings.AvailableFeature(19) = "2"
Strings.AvailableFeature(20) = "2"
End If
Strings.AvailableFeature(22) = "2"
Strings.ComputerInfo(0) = ComputerInfoHere(0)
Strings.ComputerInfo(1) = ComputerInfoHere(1)
Strings.ComputerInfo(2) = ComputerInfoHere(2)
Strings.ComputerInfo(3) = ComputerInfoHere(3)
Strings.ComputerInfo(4) = ComputerInfoHere(4)
Strings.ComputerInfo(5) = "0F"
Strings.ComputerInfo(6) = "F0"
ShiftOSUpdater.Button2.Text = "Updated!"
End Select
File.WriteAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\version.txt", My.Resources.CurrentVersion)
File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\saved\AvailableFeature.sos", Strings.AvailableFeature)
File.WriteAllLines(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) & "\ShiftOS\saved\ComputerInfo.sos", Strings.ComputerInfo)
ShiftOSMenu.ShouldUpdate = False
End Sub
End Module

View file

@ -1 +1 @@
0.2.3 0.2.4

View file

@ -132,6 +132,7 @@
<Compile Include="MainForms\TerminalApps.vb" /> <Compile Include="MainForms\TerminalApps.vb" />
<Compile Include="MainForms\TerminalColorSystem.vb" /> <Compile Include="MainForms\TerminalColorSystem.vb" />
<Compile Include="MainForms\TerminalInternalApps.vb" /> <Compile Include="MainForms\TerminalInternalApps.vb" />
<Compile Include="MainForms\TheUpdater.vb" />
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>