Unix fixes and feature lock outs

This commit is contained in:
Michael J. Seiferling
2016-03-02 01:07:27 -06:00
parent 7a7fa65ce6
commit e531ec5701
10 changed files with 3435 additions and 529 deletions
+5 -5
View File
@@ -178,11 +178,11 @@ Public Class frmAddWizard
Return False Return False
End If End If
If Path.GetExtension(strPath.ToLower) <> ".exe" Then 'If Path.GetExtension(strPath.ToLower) <> ".exe" Then
sErrorMessage = frmAddWizard_ErrorNotAProcess ' sErrorMessage = frmAddWizard_ErrorNotAProcess
txtProcessPath.Focus() ' txtProcessPath.Focus()
Return False ' Return False
End If 'End If
If Not Path.IsPathRooted(strPath) Then If Not Path.IsPathRooted(strPath) Then
sErrorMessage = frmAddWizard_ErrorBadProcessPath sErrorMessage = frmAddWizard_ErrorBadProcessPath
+9 -1
View File
@@ -395,6 +395,8 @@ Public Class frmGameManager
End Sub End Sub
Private Sub OpenBackupFile() Private Sub OpenBackupFile()
'Unix Hanlder
If Not mgrCommon.IsUnix Then
Dim sFileName As String Dim sFileName As String
sFileName = BackupFolder & CurrentBackupItem.FileName sFileName = BackupFolder & CurrentBackupItem.FileName
@@ -403,6 +405,9 @@ Public Class frmGameManager
Else Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
End If End If
Else
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
End If
End Sub End Sub
@@ -477,6 +482,7 @@ Public Class frmGameManager
End Function End Function
Private Sub OpenRestorePath() Private Sub OpenRestorePath()
If Not mgrCommon.IsUnix Then
Dim sPath As String = String.Empty Dim sPath As String = String.Empty
If CurrentBackupItem.AbsolutePath Then If CurrentBackupItem.AbsolutePath Then
@@ -492,7 +498,9 @@ Public Class frmGameManager
Else Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
End If End If
Else
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
End If
End Sub End Sub
Private Sub OpenTags() Private Sub OpenTags()
+4 -4
View File
@@ -30,7 +30,7 @@ Public Class frmIncludeExclude
Return sRootFolder Return sRootFolder
End Get End Get
Set(value As String) Set(value As String)
sRootFolder = value.TrimEnd("\") sRootFolder = value.TrimEnd(Path.DirectorySeparatorChar)
End Set End Set
End Property End Property
@@ -52,7 +52,7 @@ Public Class frmIncludeExclude
If sFolders.Length <> 0 Then If sFolders.Length <> 0 Then
For Each sFolder As String In sFolders For Each sFolder As String In sFolders
oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart("\"), 0, 0) oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart(Path.DirectorySeparatorChar), 0, 0)
oChild.Name = sFolder oChild.Name = sFolder
oChild.Tag = 0 oChild.Tag = 0
oNode.Nodes.Add(oChild) oNode.Nodes.Add(oChild)
@@ -64,7 +64,7 @@ Public Class frmIncludeExclude
If sFiles.Length <> 0 Then If sFiles.Length <> 0 Then
For Each sFile As String In sFiles For Each sFile As String In sFiles
oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart("\"), 1, 1) oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart(Path.DirectorySeparatorChar), 1, 1)
oChild.Tag = 1 oChild.Tag = 1
oNode.Nodes.Add(oChild) oNode.Nodes.Add(oChild)
Next Next
@@ -195,7 +195,7 @@ Public Class frmIncludeExclude
If Path.GetFileName(txtRootFolder.Text) = sNewLabel Then If Path.GetFileName(txtRootFolder.Text) = sNewLabel Then
sFolderCheck = txtRootFolder.Text sFolderCheck = txtRootFolder.Text
Else Else
sFolderCheck = txtRootFolder.Text & "\" & sNewLabel sFolderCheck = txtRootFolder.Text & Path.DirectorySeparatorChar & sNewLabel
End If End If
If Directory.Exists(sFolderCheck) Then If Directory.Exists(sFolderCheck) Then
iType = 0 iType = 0
+2 -1
View File
@@ -255,8 +255,9 @@ Partial Class frmMain
' '
'gMonStripTxtStatus 'gMonStripTxtStatus
' '
Me.gMonStripTxtStatus.Margin = New System.Windows.Forms.Padding(5, 0, 0, 0)
Me.gMonStripTxtStatus.Name = "gMonStripTxtStatus" Me.gMonStripTxtStatus.Name = "gMonStripTxtStatus"
Me.gMonStripTxtStatus.Size = New System.Drawing.Size(405, 17) Me.gMonStripTxtStatus.Size = New System.Drawing.Size(369, 22)
Me.gMonStripTxtStatus.Spring = True Me.gMonStripTxtStatus.Spring = True
Me.gMonStripTxtStatus.Text = "Monitor Status" Me.gMonStripTxtStatus.Text = "Monitor Status"
Me.gMonStripTxtStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft Me.gMonStripTxtStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
+2891 -30
View File
File diff suppressed because it is too large Load Diff
+20 -4
View File
@@ -1245,6 +1245,8 @@ Public Class frmMain
'Functions to handle other features 'Functions to handle other features
Private Sub RestartAsAdmin() Private Sub RestartAsAdmin()
'Unix Hanlder
If Not mgrCommon.IsUnix Then
If mgrCommon.IsElevated Then If mgrCommon.IsElevated Then
mgrCommon.ShowMessage(frmMain_ErrorAlreadyAdmin, MsgBoxStyle.Information) mgrCommon.ShowMessage(frmMain_ErrorAlreadyAdmin, MsgBoxStyle.Information)
Else Else
@@ -1254,6 +1256,9 @@ Public Class frmMain
ShutdownApp(False) ShutdownApp(False)
End If End If
End If End If
Else
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
End If
End Sub End Sub
Private Sub CleanLocalManifest() Private Sub CleanLocalManifest()
@@ -1416,12 +1421,19 @@ Public Class frmMain
End Sub End Sub
Private Sub Main_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing Private Sub Main_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
'Intercept Exit & Minimize 'Unix Handler
If mgrCommon.IsUnix And Not bShutdown Then
ShutdownApp()
End If
'Intercept Exit
If bShutdown = False Then If bShutdown = False Then
e.Cancel = True e.Cancel = True
If Not mgrCommon.IsUnix Then
Me.Visible = False Me.Visible = False
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
End If End If
End If
End Sub End Sub
Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick
@@ -1541,7 +1553,7 @@ Public Class frmMain
LoadAndVerify() LoadAndVerify()
VerifyCustomPathVariables() VerifyCustomPathVariables()
If oSettings.StartToTray Then If oSettings.StartToTray And Not mgrCommon.IsUnix Then
Me.Visible = False Me.Visible = False
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
End If End If
@@ -1554,13 +1566,17 @@ Public Class frmMain
HandleScan() HandleScan()
CheckForNewBackups() CheckForNewBackups()
Catch niex As NotImplementedException
'Ignore for Mono runtime tests
Catch ex As Exception Catch ex As Exception
mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.Critical) mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.Critical)
bInitFail = True bInitFail = True
End Try End Try
'Unix Handler
If mgrCommon.IsUnix Then
gMonTray.Visible = False
Me.MinimizeBox = True
End If
End Sub End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
+12
View File
@@ -113,6 +113,12 @@ Public Class frmSettings
nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked
cboCompression.SelectedValue = oSettings.CompressionLevel cboCompression.SelectedValue = oSettings.CompressionLevel
'Unix Handler
If mgrCommon.IsUnix Then
chkStartToTray.Checked = False
chkStartWindows.Checked = False
End If
End Sub End Sub
Private Sub LoadCombos() Private Sub LoadCombos()
@@ -159,6 +165,12 @@ Public Class frmSettings
chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup
grp7z.Text = frmSettings_grp7z grp7z.Text = frmSettings_grp7z
lblCompression.Text = frmSettings_lblCompression lblCompression.Text = frmSettings_lblCompression
'Unix Handler
If mgrCommon.IsUnix Then
chkStartToTray.Enabled = False
chkStartWindows.Enabled = False
End If
End Sub End Sub
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
+4 -8
View File
@@ -1,6 +1,7 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Net Imports System.Net
Imports System.IO Imports System.IO
Imports System.Security.Principal
Public Class mgrCommon Public Class mgrCommon
@@ -117,14 +118,9 @@ Public Class mgrCommon
End Function End Function
Public Shared Function IsElevated() As Boolean Public Shared Function IsElevated() As Boolean
If IsUnix() Then Dim oID As WindowsIdentity = WindowsIdentity.GetCurrent
Return True Dim oPrincipal As New WindowsPrincipal(oID)
End If Return oPrincipal.IsInRole(WindowsBuiltInRole.Administrator)
If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then
Return True
Else
Return False
End If
End Function End Function
Public Shared Sub RestartAsAdmin() Public Shared Sub RestartAsAdmin()
+23 -14
View File
@@ -78,6 +78,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to This function is currently not available on a Unix based operating system..
'''</summary>
Friend ReadOnly Property App_ErrorUnixNotAvailable() As String
Get
Return ResourceManager.GetString("App_ErrorUnixNotAvailable", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to [PARAM] KB. ''' Looks up a localized string similar to [PARAM] KB.
'''</summary> '''</summary>
@@ -3729,7 +3738,7 @@ Namespace My.Resources
Friend ReadOnly Property GBM_Tray_Detected() As System.Drawing.Icon Friend ReadOnly Property GBM_Tray_Detected() As System.Drawing.Icon
Get Get
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Detected", resourceCulture) Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Detected", resourceCulture)
Return CType(obj,System.Drawing.Icon) Return CType(obj, System.Drawing.Icon)
End Get End Get
End Property End Property
@@ -3739,7 +3748,7 @@ Namespace My.Resources
Friend ReadOnly Property GBM_Tray_Ready() As System.Drawing.Icon Friend ReadOnly Property GBM_Tray_Ready() As System.Drawing.Icon
Get Get
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Ready", resourceCulture) Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Ready", resourceCulture)
Return CType(obj,System.Drawing.Icon) Return CType(obj, System.Drawing.Icon)
End Get End Get
End Property End Property
@@ -3749,7 +3758,7 @@ Namespace My.Resources
Friend ReadOnly Property GBM_Tray_Stopped() As System.Drawing.Icon Friend ReadOnly Property GBM_Tray_Stopped() As System.Drawing.Icon
Get Get
Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Stopped", resourceCulture) Dim obj As Object = ResourceManager.GetObject("GBM_Tray_Stopped", resourceCulture)
Return CType(obj,System.Drawing.Icon) Return CType(obj, System.Drawing.Icon)
End Get End Get
End Property End Property
@@ -3759,7 +3768,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Admin() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Admin() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Admin", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Admin", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3769,7 +3778,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Clock() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Clock() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Clock", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Clock", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3779,7 +3788,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Detected() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Detected() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Detected", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Detected", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3789,7 +3798,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Inbox() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Inbox() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Inbox", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Inbox", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3799,7 +3808,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Ready() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Ready() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Ready", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Ready", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3809,7 +3818,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Searching() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Searching() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Searching", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Searching", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3819,7 +3828,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Stopped() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Stopped() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Stopped", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Stopped", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3829,7 +3838,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Unknown() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Unknown() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Unknown", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Unknown", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3839,7 +3848,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_User() As System.Drawing.Bitmap Friend ReadOnly Property Icon_User() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_User", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_User", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -3849,7 +3858,7 @@ Namespace My.Resources
Friend ReadOnly Property Icon_Working() As System.Drawing.Bitmap Friend ReadOnly Property Icon_Working() As System.Drawing.Bitmap
Get Get
Dim obj As Object = ResourceManager.GetObject("Icon_Working", resourceCulture) Dim obj As Object = ResourceManager.GetObject("Icon_Working", resourceCulture)
Return CType(obj,System.Drawing.Bitmap) Return CType(obj, System.Drawing.Bitmap)
End Get End Get
End Property End Property
@@ -4016,7 +4025,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM]. ''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.*.
'''</summary> '''</summary>
Friend ReadOnly Property mgrCommon_FilesFilter() As String Friend ReadOnly Property mgrCommon_FilesFilter() As String
Get Get
+4 -1
View File
@@ -1355,7 +1355,7 @@
<value>Generating SHA-256 hash for [PARAM] backup file.</value> <value>Generating SHA-256 hash for [PARAM] backup file.</value>
</data> </data>
<data name="mgrCommon_FilesFilter" xml:space="preserve"> <data name="mgrCommon_FilesFilter" xml:space="preserve">
<value>[PARAM] files (*.[PARAM])|*.[PARAM]</value> <value>[PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.*</value>
</data> </data>
<data name="mgrCommon_No" xml:space="preserve"> <data name="mgrCommon_No" xml:space="preserve">
<value>No</value> <value>No</value>
@@ -1561,4 +1561,7 @@
<data name="frmMain_ErrorInitFailure" xml:space="preserve"> <data name="frmMain_ErrorInitFailure" xml:space="preserve">
<value>An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]The application will now exit.</value> <value>An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]The application will now exit.</value>
</data> </data>
<data name="App_ErrorUnixNotAvailable" xml:space="preserve">
<value>This function is currently not available on a Unix based operating system.</value>
</data>
</root> </root>