1 |
Option Strict On |
2 |
Imports System.Net |
3 |
|
4 |
Public Module Globals |
5 |
Sub New() |
6 |
Settings.OpenRegistry() |
7 |
End Sub |
8 |
Public Enum WizardTask ' Wizard modes |
9 |
USER_SELECTED_DISTRIBUTION |
10 |
USER_SELECTED_DISTRIBUTION_DATA2 |
11 |
DHCP_CONFIG |
12 |
End Enum |
13 |
|
14 |
Public strAppdir, strTFTPdir As String 'Path sets directory strAppdir=AnywhereTS root directory strTFTPdir=TFTP root directory |
15 |
Public Const strVersion As String = "2.20" ' The version string for AnywhereTS |
16 |
Public WizardMode As WizardTask ' Startup mode for wizard, as defined in WizardTask |
17 |
Public isPro As Boolean ' The program version. True = we are running the pro version. |
18 |
Public bolCheckForUpdates As Boolean ' True = Automatic update checking enabled |
19 |
Public bolDhcpNotInst As Boolean ' True = Run for the firs time |
20 |
Public intNoOfValidAdapters As Integer |
21 |
Public strComputerIPAddress As String 'This computer's IP address. If serveral, the one the user has selected. |
22 |
Public Sub WriteCheckUpdatesRegkey() |
23 |
Dim objRegkey As Microsoft.Win32.RegistryKey |
24 |
|
25 |
On Error GoTo NoRegWrite |
26 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\AnywhereTS\ts-config", True) |
27 |
If (objRegkey Is Nothing) Then |
28 |
objRegkey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey("SOFTWARE\AnywhereTS\ts-config") |
29 |
End If |
30 |
If (objRegkey Is Nothing) Then |
31 |
GoTo NoRegWrite |
32 |
End If |
33 |
|
34 |
If Globals.bolCheckForUpdates Then |
35 |
objRegkey.SetValue("CheckUpdate", 1) |
36 |
Else |
37 |
objRegkey.SetValue("CheckUpdate", 0) |
38 |
End If |
39 |
|
40 |
Return |
41 |
|
42 |
NoRegWrite: |
43 |
On Error GoTo -1 |
44 |
MessageBox.Show("Failed to write to registry. Aborting.", "AnywhereTS", MessageBoxButtons.OK, MessageBoxIcon.Asterisk) |
45 |
Application.Exit() |
46 |
End Sub |
47 |
End Module |