0.1.1 code

This commit is contained in:
EverythingWindows 2022-11-02 08:52:31 +07:00
parent cbc32f3aba
commit e6f8b7c77b
10 changed files with 164 additions and 31 deletions

View file

@ -1,5 +1,5 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class Form1 Partial Class ShiftOSMenu
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list. 'Form overrides dispose to clean up the component list.
@ -108,10 +108,7 @@ Partial Class Form1
Me.btn_Exit.Text = "Exit" Me.btn_Exit.Text = "Exit"
Me.btn_Exit.UseVisualStyleBackColor = True Me.btn_Exit.UseVisualStyleBackColor = True
' '
'BackgroundWorker1 'ShiftOSMenu
'
'
'Form1
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
@ -125,7 +122,7 @@ Partial Class Form1
Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.Label1)
Me.MaximizeBox = False Me.MaximizeBox = False
Me.Name = "Form1" Me.Name = "ShiftOSMenu"
Me.ShowIcon = False Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Main Menu" Me.Text = "Main Menu"

View file

@ -1,24 +1,27 @@
Imports System.IO Imports System.IO
Public Class Form1 Public Class ShiftOSMenu
Public Shared ActualBuildLab As String Public Shared ActualBuildLab As String
Public Shared BuildLab() As String Public Shared BuildLab() As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try Try
BuildLab = File.ReadAllLines("D:\ShiftOSBuildLab.txt") If File.Exists("D:\ShiftOSBuildLab.txt") Then
If BuildLab(0) = "No" Then BuildLab = File.ReadAllLines("D:\ShiftOSBuildLab.txt")
Dim BuildNum As Integer = BuildLab(1) If BuildLab(0) = "No" Then
BuildNum = BuildLab(1) + 1 Dim BuildNum As Integer = BuildLab(1)
ActualBuildLab = "ShiftOS_TheRevival." & BuildLab(3) & "." & BuildNum & "." & Date.Today.Year & Date.Today.Month & Date.Today.Day BuildNum = BuildLab(1) + 1
BuildLab(1) = BuildNum ActualBuildLab = "ShiftOS_TheRevival." & BuildLab(3) & "." & BuildNum & "." & Date.Today.Year & Date.Today.Month & Date.Today.Day
File.WriteAllLines("D:\ShiftOSBuildLab.txt", BuildLab) BuildLab(1) = BuildNum
File.WriteAllLines("D:\ShiftOSBuildLab.txt", BuildLab)
End If
lbl_BuildString.Text = ActualBuildLab
Else
End If End If
lbl_BuildString.Text = ActualBuildLab
Catch ex As Exception Catch ex As Exception
MsgBox("Why? Because of " & ex.Message) MsgBox("Why? Because of " & ex.Message)
lbl_BuildString.Text = ActualBuildLab
End Try End Try
End Sub End Sub

View file

@ -3,6 +3,8 @@
Public Shared ComputerInfo(1) As String Public Shared ComputerInfo(1) As String
Public Shared IsFree As Boolean Public Shared IsFree As Boolean
Public Shared OnceInfo(0) As String Public Shared OnceInfo(0) As String
Public Shared StoryChapter As Integer
Public Shared AvailableFeature() As String
'STRING CATEGORIZATION WRITING RULES! 'STRING CATEGORIZATION WRITING RULES!
'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS! 'THIS IS IN ORDER TO REMAIN COMPATIBLE WITH OLDER VERSIONS!
@ -24,10 +26,10 @@
'0 = OSVersion (default : dependant) '0 = OSVersion (default : dependant)
' '
'OnceInfo Strings: 'OnceInfo Strings:
'0 = IsRoot? (default : 0) '0 = IsRoot? (0.1) (default : 0)
' '
'ComputerInfo Strings: 'ComputerInfo Strings:
'0 = Computer Name (default : shiftos) '0 = Computer Name (0.1) (default : shiftos)
'1 = Username (default : user) '1 = Username (0.1) (default : user)
' '
End Class End Class

View file

@ -28,6 +28,7 @@ Partial Class Terminal
'TextBox1 'TextBox1
' '
Me.TextBox1.BackColor = System.Drawing.Color.Black Me.TextBox1.BackColor = System.Drawing.Color.Black
Me.TextBox1.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill Me.TextBox1.Dock = System.Windows.Forms.DockStyle.Fill
Me.TextBox1.Font = New System.Drawing.Font("Consolas", 11.0!) Me.TextBox1.Font = New System.Drawing.Font("Consolas", 11.0!)
Me.TextBox1.ForeColor = System.Drawing.Color.Silver Me.TextBox1.ForeColor = System.Drawing.Color.Silver

View file

@ -2,6 +2,7 @@
Public command As String Public command As String
Public DefaultPrompt As String Public DefaultPrompt As String
Public TrackPos As Integer Public TrackPos As Integer
Public AdvancedCommand As Boolean
Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub Terminal_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormBorderStyle = FormBorderStyle.None FormBorderStyle = FormBorderStyle.None
@ -11,7 +12,11 @@
Strings.ComputerInfo(1) = "user" Strings.ComputerInfo(1) = "user"
PrintPrompt() PrintPrompt()
AssignPrompt() AssignPrompt()
Else
End If End If
TextBox1.Select(TextBox1.TextLength, 0)
TextBox1.ScrollToCaret()
End Sub End Sub
Public Sub PrintPrompt() Public Sub PrintPrompt()
@ -44,6 +49,31 @@
command = command.ToLower() command = command.ToLower()
End Sub End Sub
Private Sub DoCommand()
AdvancedCommand = True
Select Case command
Case "clear"
TextBox1.Text = Nothing
AdvancedCommand = False
Case "ver"
TextBox1.Text = TextBox1.Text & Environment.NewLine & "ShiftOS TheRevival version 0.1.1"
AdvancedCommand = False
Case "shutdown", "shut down"
ShiftOSMenu.Show()
Close()
End Select
If AdvancedCommand = True Then
If command Like "print *" Then
TextBox1.Text = TextBox1.Text & Environment.NewLine & command.Substring(6)
Dim printed As String = command.Replace("print ", "")
''It has the same issue, only displays in lowercase
'TextBox1.Text = TextBox1.Text & Environment.NewLine & printed
End If
AdvancedCommand = False
End If
End Sub
Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown Private Sub txtterm_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.T AndAlso e.Control Then If e.KeyCode = Keys.T AndAlso e.Control Then
Me.Hide() Me.Hide()
@ -85,7 +115,7 @@
If e.KeyCode = Keys.Enter Then If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True e.SuppressKeyPress = True
ReadCommand() ReadCommand()
'DoCommand() DoCommand()
If command = "clear" Then If command = "clear" Then
PrintPrompt() PrintPrompt()

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
</application>
</compatibility>
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config.
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation -->
<!--
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</windowsSettings>
</application>
-->
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->
</assembly>

View file

@ -32,7 +32,7 @@ Namespace My
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm() Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.ShiftOS_TheRevival.Form1 Me.MainForm = Global.ShiftOS_TheRevival.ShiftOSMenu
End Sub End Sub
End Class End Class
End Namespace End Namespace

View file

@ -61,15 +61,11 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to No ''' Looks up a localized string similar to .
'''12
'''Enter your username for the build lab below :
'''ewindows
'''.
'''</summary> '''</summary>
Friend ReadOnly Property ShiftOSBuildLab() As String Friend ReadOnly Property BuildString() As String
Get Get
Return ResourceManager.GetString("ShiftOSBuildLab", resourceCulture) Return ResourceManager.GetString("BuildString", resourceCulture)
End Get End Get
End Property End Property
End Module End Module

View file

@ -117,8 +117,7 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="BuildString" xml:space="preserve">
<data name="ShiftOSBuildLab" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value />
<value>..\Resources\ShiftOSBuildLab.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data> </data>
</root> </root>

View file

@ -13,6 +13,21 @@
<MyType>WindowsForms</MyType> <MyType>WindowsForms</MyType>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>AnyCPU</PlatformTarget>
@ -46,6 +61,9 @@
<PropertyGroup> <PropertyGroup>
<OptionInfer>On</OptionInfer> <OptionInfer>On</OptionInfer>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<ApplicationManifest>MainForms\app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
@ -127,6 +145,7 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="MainForms\app.manifest" />
<None Include="My Project\Application.myapp"> <None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator> <Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput> <LastGenOutput>Application.Designer.vb</LastGenOutput>
@ -144,5 +163,12 @@
<ItemGroup> <ItemGroup>
<None Include="Resources\ShiftOSBuildLab.txt" /> <None Include="Resources\ShiftOSBuildLab.txt" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project> </Project>