mirror of
https://github.com/TheUltimateHacker/ShiftOS.git
synced 2025-01-23 00:12:15 +00:00
55795509e5
Added a Browse button to the First Boot Setup's "ShiftOS Executable Path" setting, allowing the user to pick a directory in a more user-friendly way, rather than manually typing a directory in.
43 lines
No EOL
2.3 KiB
VB.net
43 lines
No EOL
2.3 KiB
VB.net
Public Class FirstBootSetup
|
|
|
|
Public FinishedFirstBoot As Boolean = False
|
|
|
|
Private Sub FirstBootSetup_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
|
|
If FinishedFirstBoot = False Then
|
|
e.Cancel = True
|
|
MsgBox("You need to finish the first boot setup!")
|
|
End If
|
|
End Sub
|
|
|
|
Private Sub TextBox1_MouseDown(sender As Object, e As MouseEventArgs) Handles TextBox1.MouseDown
|
|
If TextBox1.Text = "Where do you want your ShiftOS executables to be save to? Nothing = C:\ShiftOS\SoftwareData\Launcher\ShiftOSEXE\" Then TextBox1.Text = Nothing
|
|
End Sub
|
|
|
|
Private Sub TextBox2_MouseDown(sender As Object, e As MouseEventArgs) Handles TextBox2.MouseDown
|
|
If TextBox2.Text = "Type in a nickname here" Then TextBox2.Text = Nothing
|
|
End Sub
|
|
|
|
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
|
|
If RadioButton1.Checked = True Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\BuildOption.dat", "Stable", False)
|
|
If RadioButton2.Checked = True Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\BuildOption.dat", "Unstable", False)
|
|
|
|
If TextBox1.Text = Nothing Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\ExecFolder.dat", "C:\ShiftOS\SoftwareData\Launcher\ShiftOSEXE", False)
|
|
If Not TextBox1.Text = Nothing Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\ExecFolder.dat", TextBox1.Text, False)
|
|
|
|
If TextBox2.Text = Nothing Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\Nickname.dat", "ShiftOS User", False)
|
|
If Not TextBox2.Text = Nothing Then My.Computer.FileSystem.WriteAllText("C:\ShiftOS\SoftwareData\Launcher\UserPreferences\Nickname.dat", TextBox2.Text, False)
|
|
|
|
MsgBox("Completed!")
|
|
FinishedFirstBoot = True
|
|
Me.Close()
|
|
|
|
Main_Launcher.UpdateOptions()
|
|
End Sub
|
|
|
|
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
|
|
Dim folDialog As New FolderBrowserDialog
|
|
If folDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
|
TextBox1.Text = folDialog.SelectedPath
|
|
End If
|
|
End Sub
|
|
End Class |