Skip to content

Commit

Permalink
Store Windows version in database
Browse files Browse the repository at this point in the history
  • Loading branch information
ocdtrekkie committed Jun 17, 2024
1 parent c49dfbc commit 620a363
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions modComputer.vb
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ Module modComputer
End Function

Function GetOSVersion() As String
Dim strBuild1, strBuild2, strBuild3, strBuild4 As String
Dim strBuild1, strBuild2, strBuild3, strBuild4, strWinVer As String
Dim regKey As Microsoft.Win32.RegistryKey
regKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion")
strBuild1 = regKey.GetValue("CurrentMajorVersionNumber")
strBuild2 = regKey.GetValue("CurrentMinorVersionNumber")
strBuild3 = regKey.GetValue("CurrentBuild")
strBuild4 = regKey.GetValue("UBR")
Return strBuild1 & "." & strBuild2 & "." & strBuild3 & "." & strBuild4
strWinVer = strBuild1 & "." & strBuild2 & "." & strBuild3 & "." & strBuild4
modDatabase.Execute("INSERT INTO CONFIG (Key, Value) VALUES('System_LastKnownWindowsVersion', '" & strWinVer & "') ON CONFLICT(Key) DO UPDATE SET Value=excluded.Value")
Return strWinVer
End Function

Function GetProcessList() As String
Expand Down
1 change: 1 addition & 0 deletions modDatabase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Module modDatabase
Public conn As SQLiteConnection = New SQLiteConnection

Sub CreateDb()
Execute("CREATE TABLE If Not EXISTS ""CONFIG"" (""Key"" varchar(100) primary key not null ,""Value"" varchar )")
Execute("CREATE TABLE IF NOT EXISTS DEVICES(Id INTEGER PRIMARY KEY, Name TEXT, Type TEXT, Model TEXT, Location TEXT, Address TEXT UNIQUE)")
Execute("CREATE TABLE IF NOT EXISTS ENVIRONMENT(Id INTEGER PRIMARY KEY, Date TEXT, Source TEXT, Location TEXT, Temperature INTEGER, Humidity INTEGER, Condition TEXT)")
Execute("CREATE TABLE IF NOT EXISTS LOCATION(Id INTEGER PRIMARY KEY, Date TEXT, Latitude REAL, Longitude REAL, Speed REAL)")
Expand Down
4 changes: 2 additions & 2 deletions modGlobal.vb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ Public Module modGlobal
LoadModuleTasks.Add(Task.Run(Function() modDreamCheeky.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modStreamDeck.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modMusic.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modComputer.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modPihole.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modLibrary.Load())) 'Dependencies: None
LoadModuleTasks.Add(Task.Run(Function() modSync.Load())) 'Dependencies: None

Task.WaitAll(LoadModuleTasks.ToArray())

LoadModuleTasks.Add(Task.Run(Function() modComputer.Load())) 'Dependencies: Database
LoadModuleTasks.Add(Task.Run(Function() modMail.Load())) 'Dependencies: Database
LoadModuleTasks.Add(Task.Run(Function() modOpenWeatherMap.Load())) 'Dependencies: Database
LoadModuleTasks.Add(Task.Run(Function() modMatrixLCD.Load())) 'Dependencies: Speech
LoadModuleTasks.Add(Task.Run(Function() modGPS.Load())) 'Dependencies: Database
LoadModuleTasks.Add(Task.Run(Function() modSync.Load())) 'Dependencies: Database

Task.WaitAll(LoadModuleTasks.ToArray())

Expand Down

0 comments on commit 620a363

Please sign in to comment.