diff --git a/GBM/Classes/clsBackup.vb b/GBM/Classes/clsBackup.vb index b45fa0e..eef77cc 100644 --- a/GBM/Classes/clsBackup.vb +++ b/GBM/Classes/clsBackup.vb @@ -41,7 +41,11 @@ Property FileName As String Get - Return sFileName + If mgrCommon.IsUnix Then + Return sFileName.Replace("\", "/") + Else + Return sFileName.Replace("/", "\") + End If End Get Set(value As String) sFileName = value diff --git a/GBM/Forms/frmAddWizard.vb b/GBM/Forms/frmAddWizard.vb index fbaeb0d..c98340e 100644 --- a/GBM/Forms/frmAddWizard.vb +++ b/GBM/Forms/frmAddWizard.vb @@ -178,7 +178,7 @@ Public Class frmAddWizard Return False End If - If Path.GetExtension(strPath.ToLower) <> ".exe" Then + If Path.GetExtension(strPath.ToLower) <> ".exe" And Not mgrCommon.IsUnix Then sErrorMessage = frmAddWizard_ErrorNotAProcess txtProcessPath.Focus() Return False diff --git a/GBM/Forms/frmFileFolderSearch.Designer.vb b/GBM/Forms/frmFileFolderSearch.Designer.vb index 0f11111..ebe0bbd 100644 --- a/GBM/Forms/frmFileFolderSearch.Designer.vb +++ b/GBM/Forms/frmFileFolderSearch.Designer.vb @@ -22,23 +22,14 @@ Partial Class frmFileFolderSearch 'Do not modify it using the code editor. _ Private Sub InitializeComponent() - Me.pgbProgress = New System.Windows.Forms.ProgressBar() Me.txtCurrentLocation = New System.Windows.Forms.TextBox() Me.btnCancel = New System.Windows.Forms.Button() Me.bwSearch = New System.ComponentModel.BackgroundWorker() Me.SuspendLayout() ' - 'pgbProgress - ' - Me.pgbProgress.Location = New System.Drawing.Point(12, 12) - Me.pgbProgress.MarqueeAnimationSpeed = 0 - Me.pgbProgress.Name = "pgbProgress" - Me.pgbProgress.Size = New System.Drawing.Size(460, 23) - Me.pgbProgress.TabIndex = 0 - ' 'txtCurrentLocation ' - Me.txtCurrentLocation.Location = New System.Drawing.Point(12, 43) + Me.txtCurrentLocation.Location = New System.Drawing.Point(12, 12) Me.txtCurrentLocation.Name = "txtCurrentLocation" Me.txtCurrentLocation.ReadOnly = True Me.txtCurrentLocation.Size = New System.Drawing.Size(379, 20) @@ -47,7 +38,7 @@ Partial Class frmFileFolderSearch ' 'btnCancel ' - Me.btnCancel.Location = New System.Drawing.Point(397, 41) + Me.btnCancel.Location = New System.Drawing.Point(397, 10) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 0 @@ -62,10 +53,9 @@ Partial Class frmFileFolderSearch ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(484, 77) + Me.ClientSize = New System.Drawing.Size(484, 46) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.txtCurrentLocation) - Me.Controls.Add(Me.pgbProgress) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.MinimizeBox = False @@ -77,7 +67,6 @@ Partial Class frmFileFolderSearch Me.PerformLayout() End Sub - Friend WithEvents pgbProgress As System.Windows.Forms.ProgressBar Friend WithEvents txtCurrentLocation As System.Windows.Forms.TextBox Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents bwSearch As System.ComponentModel.BackgroundWorker diff --git a/GBM/Forms/frmFileFolderSearch.vb b/GBM/Forms/frmFileFolderSearch.vb index f82236c..8bf3085 100644 --- a/GBM/Forms/frmFileFolderSearch.vb +++ b/GBM/Forms/frmFileFolderSearch.vb @@ -3,6 +3,7 @@ Imports System.IO Public Class frmFileFolderSearch Private sSearchItem As String + Private sGameName As String = String.Empty Private bIsFolder As Boolean Private sFoundItem As String Private oDrives As List(Of DriveInfo) @@ -12,6 +13,15 @@ Public Class frmFileFolderSearch Delegate Sub UpdateInfoCallBack(ByVal sCurrentFolder As String) + Public Property GameName As String + Get + Return sGameName + End Get + Set(value As String) + sGameName = value + End Set + End Property + Public Property SearchItem As String Get Return sSearchItem @@ -50,17 +60,28 @@ Public Class frmFileFolderSearch Private Function SearchDirectory(ByVal dir As DirectoryInfo, ByVal sDirectoryName As String) As String Dim sSubSearch As String = String.Empty + Dim sFoundItem As String = String.Empty If bwSearch.CancellationPending Then Return "Cancel" End If + 'Ignore Symlinks + If (dir.Attributes And FileAttributes.ReparsePoint) = FileAttributes.ReparsePoint Then + Return String.Empty + End If + UpdateInfo(dir.FullName) Try 'Search Current Directory If dir.GetDirectories(sDirectoryName).Length > 0 Then - Return dir.FullName & "\" & sDirectoryName + sFoundItem = dir.FullName & Path.DirectorySeparatorChar & sDirectoryName + If mgrCommon.ShowMessage(mgrPath_ConfirmPathCorrect, New String() {GameName, sFoundItem}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + Return sFoundItem + Else + Return String.Empty + End If End If 'Search Sub Directory @@ -82,26 +103,38 @@ Public Class frmFileFolderSearch Private Function SearchFile(ByVal dir As DirectoryInfo, ByVal sFileName As String) As String Dim sSubSearch As String = String.Empty + Dim sFoundItem As String = String.Empty If bwSearch.CancellationPending Then Return "Cancel" End If + 'Ignore Symlinks + If (dir.Attributes And FileAttributes.ReparsePoint) = FileAttributes.ReparsePoint Then + Return String.Empty + End If + UpdateInfo(dir.FullName) Try 'Search Current Directory If dir.GetFiles(sFileName).Length > 0 Then - Return dir.FullName & "\" & sFileName + sFoundItem = Path.GetDirectoryName(dir.FullName & Path.DirectorySeparatorChar & sFileName) + If mgrCommon.ShowMessage(mgrPath_ConfirmPathCorrect, New String() {GameName, sFoundItem}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + Return sFoundItem + Else + Return String.Empty + End If End If 'Search Sub Directory Dim subdirs() As DirectoryInfo = dir.GetDirectories("*") For Each newDir As DirectoryInfo In subdirs - sSubSearch = SearchFile(newDir, sFileName) - If sSubSearch <> String.Empty Then - Return sSubSearch - End If + sSubSearch = SearchFile(newDir, sFileName) + + If sSubSearch <> String.Empty Then + Return sSubSearch + End If Next Catch e As System.UnauthorizedAccessException 'Do Nothing @@ -122,8 +155,6 @@ Public Class frmFileFolderSearch End Sub Private Sub Search(ByVal oDrive As DriveInfo) - pgbProgress.Style = ProgressBarStyle.Marquee - pgbProgress.MarqueeAnimationSpeed = 5 oSearchDrive = oDrive.RootDirectory bwSearch.RunWorkerAsync() iCurrentDrive += 1 @@ -131,7 +162,6 @@ Public Class frmFileFolderSearch Private Sub EndSearch() Dim oResult As MsgBoxResult - pgbProgress.MarqueeAnimationSpeed = 0 If FoundItem = "Cancel" Then FoundItem = String.Empty diff --git a/GBM/Forms/frmFilter.Designer.vb b/GBM/Forms/frmFilter.Designer.vb index 3794e82..833d5b8 100644 --- a/GBM/Forms/frmFilter.Designer.vb +++ b/GBM/Forms/frmFilter.Designer.vb @@ -99,7 +99,6 @@ Partial Class frmFilter ' 'optAll ' - Me.optAll.AutoSize = True Me.optAll.Location = New System.Drawing.Point(77, 19) Me.optAll.Name = "optAll" Me.optAll.Size = New System.Drawing.Size(63, 17) @@ -110,7 +109,6 @@ Partial Class frmFilter ' 'optAny ' - Me.optAny.AutoSize = True Me.optAny.Checked = True Me.optAny.Location = New System.Drawing.Point(6, 19) Me.optAny.Name = "optAny" @@ -213,7 +211,6 @@ Partial Class frmFilter ' 'optOr ' - Me.optOr.AutoSize = True Me.optOr.Location = New System.Drawing.Point(56, 19) Me.optOr.Name = "optOr" Me.optOr.Size = New System.Drawing.Size(36, 17) @@ -224,7 +221,6 @@ Partial Class frmFilter ' 'optAnd ' - Me.optAnd.AutoSize = True Me.optAnd.Checked = True Me.optAnd.Location = New System.Drawing.Point(6, 19) Me.optAnd.Name = "optAnd" @@ -302,11 +298,9 @@ Partial Class frmFilter Me.grpTagFilter.ResumeLayout(False) Me.grpTagFilter.PerformLayout() Me.grpTagOptions.ResumeLayout(False) - Me.grpTagOptions.PerformLayout() Me.grpGameFilter.ResumeLayout(False) Me.grpGameFilter.PerformLayout() Me.grpGameInfoOptions.ResumeLayout(False) - Me.grpGameInfoOptions.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 3bae567..9221a5c 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -630,7 +630,6 @@ Partial Class frmGameManager Me.lstGames.Name = "lstGames" Me.lstGames.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstGames.Size = New System.Drawing.Size(228, 381) - Me.lstGames.Sorted = True Me.lstGames.TabIndex = 1 ' 'btnCancel diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index cff0a5a..574ed32 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -34,7 +34,7 @@ Public Class frmGameManager Property BackupFolder As String Get - Return sBackupFolder & "\" + Return sBackupFolder & Path.DirectorySeparatorChar End Get Set(value As String) sBackupFolder = value @@ -175,7 +175,7 @@ Public Class frmGameManager sFileName = BackupFolder & oBackupItem.FileName 'Rename Backup File - sNewFileName = Path.GetDirectoryName(sFileName) & "\" & Path.GetFileName(sFileName).Replace(oOriginalApp.Name, oNewApp.Name) + sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(oOriginalApp.Name, oNewApp.Name) If File.Exists(sFileName) Then FileSystem.Rename(sFileName, sNewFileName) End If @@ -265,7 +265,7 @@ Public Class frmGameManager Next End If - lstGames.Items.Clear() + lstGames.DataSource = Nothing FormatAndFillList() End Sub @@ -336,8 +336,14 @@ Public Class frmGameManager End If End If - sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseCustomIcon, "ico", _ - frmGameManager_Icon, sDefaultFolder, False) + 'Unix Handler + If Not mgrCommon.IsUnix Then + sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseCustomIcon, "ico", _ + frmGameManager_Icon, sDefaultFolder, False) + Else + sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseCustomIcon, "png", _ + "PNG", sDefaultFolder, False) + End If If sNewPath <> String.Empty Then txtIcon.Text = sNewPath @@ -365,38 +371,50 @@ Public Class frmGameManager End Function + Public Shared Function CompareByName(sItem1 As KeyValuePair(Of String, String), sItem2 As KeyValuePair(Of String, String)) As Integer + Return String.Compare(sItem1.Value, sItem2.value) + End Function + Private Sub FormatAndFillList() IsLoading = True Dim oApp As clsGame Dim oData As KeyValuePair(Of String, String) + Dim oList As New List(Of KeyValuePair(Of String, String)) lstGames.ValueMember = "Key" lstGames.DisplayMember = "Value" - lstGames.BeginUpdate() - For Each de As DictionaryEntry In AppData oApp = DirectCast(de.Value, clsGame) - oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name) - lstGames.Items.Add(oData) + oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name) + oList.Add(oData) Next - lstGames.EndUpdate() + oList.Sort(AddressOf CompareByName) + lstGames.BeginUpdate() + lstGames.DataSource = oList + lstGames.EndUpdate() + lstGames.ClearSelected() IsLoading = False End Sub Private Sub OpenBackupFile() Dim sFileName As String + Dim oProcessStartInfo As ProcessStartInfo + sFileName = BackupFolder & CurrentBackupItem.FileName If File.Exists(sFileName) Then - Process.Start("explorer.exe", "/select," & sFileName) + oProcessStartInfo = New ProcessStartInfo + oProcessStartInfo.FileName = sFileName + oProcessStartInfo.UseShellExecute = True + oProcessStartInfo.Verb = "open" + Process.Start(oProcessStartInfo) Else mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation) End If - End Sub Private Sub UpdateBuilderButtonLabel(ByVal sBuilderString As String, ByVal sLabel As String, ByVal btn As Button, ByVal bDirty As Boolean) @@ -424,8 +442,8 @@ Public Class frmGameManager End If Else If txtAppPath.Text <> String.Empty Then - If Directory.Exists(txtAppPath.Text & "\" & txtSavePath.Text) Then - sRoot = txtAppPath.Text & "\" & txtSavePath.Text + If Directory.Exists(txtAppPath.Text & Path.DirectorySeparatorChar & txtSavePath.Text) Then + sRoot = txtAppPath.Text & Path.DirectorySeparatorChar & txtSavePath.Text End If End If End If @@ -451,14 +469,14 @@ Public Class frmGameManager If Not CurrentBackupItem.AbsolutePath Then If CurrentGame.ProcessPath <> String.Empty Then - CurrentBackupItem.RelativeRestorePath = CurrentGame.ProcessPath & "\" & CurrentBackupItem.RestorePath + CurrentBackupItem.RelativeRestorePath = CurrentGame.ProcessPath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath Else sProcess = CurrentGame.TrueProcess If mgrCommon.IsProcessNotSearchable(CurrentGame) Then bNoAuto = True sRestorePath = mgrPath.ProcessPathSearch(CurrentBackupItem.Name, sProcess, mgrCommon.FormatString(frmGameManager_ErrorPathNotSet, CurrentBackupItem.Name), bNoAuto) If sRestorePath <> String.Empty Then - CurrentBackupItem.RelativeRestorePath = sRestorePath & "\" & CurrentBackupItem.RestorePath + CurrentBackupItem.RelativeRestorePath = sRestorePath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath txtAppPath.Text = sRestorePath Else Return False @@ -471,21 +489,25 @@ Public Class frmGameManager Private Sub OpenRestorePath() Dim sPath As String = String.Empty + Dim oProcessStartInfo As ProcessStartInfo If CurrentBackupItem.AbsolutePath Then - sPath = CurrentBackupItem.RestorePath - Else - If FindRestorePath() Then - sPath = CurrentBackupItem.RelativeRestorePath + sPath = CurrentBackupItem.RestorePath + Else + If FindRestorePath() Then + sPath = CurrentBackupItem.RelativeRestorePath + End If End If - End If If Directory.Exists(sPath) Then - Process.Start("explorer.exe", sPath) + oProcessStartInfo = New ProcessStartInfo + oProcessStartInfo.FileName = sPath + oProcessStartInfo.UseShellExecute = True + oProcessStartInfo.Verb = "open" + Process.Start(oProcessStartInfo) Else mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation) End If - End Sub Private Sub OpenTags() @@ -519,7 +541,6 @@ Public Class frmGameManager Dim oBackupInfo As clsBackup Dim sFileName As String - If oRemoteBackupData.Contains(oApp.Name) Then CurrentBackupItem = DirectCast(oRemoteBackupData(oApp.Name), clsBackup) txtCurrentBackup.Text = mgrCommon.FormatString(frmGameManager_BackupTimeAndName, New String() {CurrentBackupItem.DateUpdated, CurrentBackupItem.UpdatedBy}) @@ -535,6 +556,8 @@ Public Class frmGameManager Else txtFileSize.Text = frmGameManager_ErrorNoBackupExists End If + + mgrRestore.DoPathOverride(CurrentBackupItem, oApp) txtRestorePath.Text = CurrentBackupItem.RestorePath Else txtCurrentBackup.Text = frmGameManager_Never @@ -582,10 +605,10 @@ Public Class frmGameManager mgrManifest.DoManifestDelete(CurrentBackupItem, mgrSQLite.Database.Remote) 'Delete referenced backup file from the backup folder - If File.Exists(BackupFolder & CurrentBackupItem.FileName) Then My.Computer.FileSystem.DeleteFile(BackupFolder & CurrentBackupItem.FileName, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + mgrCommon.DeleteFile(BackupFolder & CurrentBackupItem.FileName) 'Check if using backup sub-directories (Probably not the best way to check for this) - If CurrentBackupItem.FileName.StartsWith(CurrentBackupItem.Name & "\") Then + If CurrentBackupItem.FileName.StartsWith(CurrentBackupItem.Name & Path.DirectorySeparatorChar) Then 'Build sub-dir backup path sSubDir = BackupFolder & CurrentBackupItem.Name @@ -595,11 +618,11 @@ Public Class frmGameManager If oDir.GetDirectories.Length > 0 Or oDir.GetFiles.Length > 0 Then 'Confirm If mgrCommon.ShowMessage(frmGameManager_ConfirmBackupFolderDelete, New String() {sSubDir, oDir.GetDirectories.Length, oDir.GetFiles.Length}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then - If Directory.Exists(sSubDir) Then My.Computer.FileSystem.DeleteDirectory(sSubDir, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + If Directory.Exists(sSubDir) Then mgrCommon.DeleteDirectory(sSubDir, True) End If Else 'Folder is empty, delete the empty sub-folder - If Directory.Exists(sSubDir) Then My.Computer.FileSystem.DeleteDirectory(sSubDir, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + If Directory.Exists(sSubDir) Then mgrCommon.DeleteDirectory(sSubDir) End If End If End If @@ -812,6 +835,7 @@ Public Class frmGameManager btnAdd.Enabled = True btnDelete.Enabled = False btnBackup.Enabled = False + btnOpenRestorePath.Enabled = False btnTags.Enabled = False lblTags.Visible = False btnInclude.Text = frmGameManager_btnInclude @@ -979,13 +1003,10 @@ Public Class frmGameManager End Select If bSuccess Then - Dim iSelected As Integer IsDirty = False LoadData() - iSelected = lstGames.Items.IndexOf(New KeyValuePair(Of String, String)(oApp.ID, oApp.Name)) - If iSelected = -1 Then eCurrentMode = eModes.Disabled ModeChange() - If eCurrentMode = eModes.View Then lstGames.SelectedIndex = iSelected + If eCurrentMode = eModes.View Then lstGames.SelectedValue = oApp.ID End If End Sub @@ -1021,13 +1042,15 @@ Public Class frmGameManager End Sub Private Sub SwitchApp() - If lstGames.SelectedItems.Count = 1 Then - eCurrentMode = eModes.View - FillData() - ModeChange() - ElseIf lstGames.SelectedItems.Count > 1 Then - eCurrentMode = eModes.MultiSelect - ModeChange() + If Not bIsLoading Then + If lstGames.SelectedItems.Count = 1 Then + eCurrentMode = eModes.View + FillData() + ModeChange() + ElseIf lstGames.SelectedItems.Count > 1 Then + eCurrentMode = eModes.MultiSelect + ModeChange() + End If End If End Sub @@ -1206,13 +1229,17 @@ Public Class frmGameManager End Sub Private Sub ImportOfficialGameList() + If mgrCommon.IsUnix Then + If mgrCommon.ShowMessage(frmGameManager_ConfirmUnixImportWarning, MsgBoxStyle.YesNo) = MsgBoxResult.No Then + Exit Sub + End If + End If If mgrCommon.ShowMessage(frmGameManager_ConfirmOfficialImport, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrMonitorList.DoImport(App_URLImport) Then LoadData() End If End If - End Sub Private Sub SetForm() @@ -1293,6 +1320,9 @@ Public Class frmGameManager AssignDirtyHandlers(grpExtra.Controls) AssignDirtyHandlers(grpStats.Controls) AssignDirtyHandlersMisc() + + LoadData(False) + ModeChange() End Sub Private Sub lstGames_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstGames.SelectedIndexChanged @@ -1422,4 +1452,4 @@ Public Class frmGameManager Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click ExportGameList() End Sub -End Class \ No newline at end of file +End Class diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index fb70520..73e8c03 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -170,7 +170,6 @@ Partial Class frmIncludeExclude ' 'optFileTypes ' - Me.optFileTypes.AutoSize = True Me.optFileTypes.Location = New System.Drawing.Point(6, 19) Me.optFileTypes.Name = "optFileTypes" Me.optFileTypes.Size = New System.Drawing.Size(73, 17) @@ -181,7 +180,6 @@ Partial Class frmIncludeExclude ' 'optIndividualFiles ' - Me.optIndividualFiles.AutoSize = True Me.optIndividualFiles.Location = New System.Drawing.Point(85, 19) Me.optIndividualFiles.Name = "optIndividualFiles" Me.optIndividualFiles.Size = New System.Drawing.Size(94, 17) @@ -250,7 +248,6 @@ Partial Class frmIncludeExclude Me.Text = "Include / Exclude Builder" Me.cmsItems.ResumeLayout(False) Me.grpFileOptions.ResumeLayout(False) - Me.grpFileOptions.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index 487828b..c7440a4 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 - CQAAAk1TRnQBSQFMAgEBAwEAAbABAAGwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAwEAAbgBAAG4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index c466b10..3b5ae2f 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -30,7 +30,7 @@ Public Class frmIncludeExclude Return sRootFolder End Get Set(value As String) - sRootFolder = value.TrimEnd("\") + sRootFolder = value.TrimEnd(Path.DirectorySeparatorChar) End Set End Property @@ -52,7 +52,7 @@ Public Class frmIncludeExclude If sFolders.Length <> 0 Then 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.Tag = 0 oNode.Nodes.Add(oChild) @@ -64,7 +64,7 @@ Public Class frmIncludeExclude If sFiles.Length <> 0 Then 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 oNode.Nodes.Add(oChild) Next @@ -195,7 +195,7 @@ Public Class frmIncludeExclude If Path.GetFileName(txtRootFolder.Text) = sNewLabel Then sFolderCheck = txtRootFolder.Text Else - sFolderCheck = txtRootFolder.Text & "\" & sNewLabel + sFolderCheck = txtRootFolder.Text & Path.DirectorySeparatorChar & sNewLabel End If If Directory.Exists(sFolderCheck) Then iType = 0 diff --git a/GBM/Forms/frmMain.Designer.vb b/GBM/Forms/frmMain.Designer.vb index 69fd37e..7164289 100644 --- a/GBM/Forms/frmMain.Designer.vb +++ b/GBM/Forms/frmMain.Designer.vb @@ -47,9 +47,9 @@ Partial Class frmMain Me.bwMonitor = New System.ComponentModel.BackgroundWorker() Me.txtLog = New System.Windows.Forms.TextBox() Me.gMonStatusStrip = New System.Windows.Forms.StatusStrip() - Me.gMonStripAdminButton = New System.Windows.Forms.ToolStripSplitButton() + Me.gMonStripAdminButton = New System.Windows.Forms.ToolStripStatusLabel() Me.gMonStripTxtStatus = New System.Windows.Forms.ToolStripStatusLabel() - Me.gMonStripStatusButton = New System.Windows.Forms.ToolStripSplitButton() + Me.gMonStripStatusButton = New System.Windows.Forms.ToolStripStatusLabel() Me.gMonMainMenu = New System.Windows.Forms.MenuStrip() Me.gMonFile = New System.Windows.Forms.ToolStripMenuItem() Me.gMonFileMonitor = New System.Windows.Forms.ToolStripMenuItem() @@ -99,7 +99,6 @@ Partial Class frmMain Me.gMonTray.ContextMenuStrip = Me.gMonTrayMenu Me.gMonTray.Icon = CType(resources.GetObject("gMonTray.Icon"), System.Drawing.Icon) Me.gMonTray.Text = "GBM" - Me.gMonTray.Visible = True ' 'gMonTrayMenu ' @@ -238,7 +237,7 @@ Partial Class frmMain ' Me.gMonStatusStrip.Font = New System.Drawing.Font("Segoe UI", 9.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.gMonStatusStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonStripAdminButton, Me.gMonStripTxtStatus, Me.gMonStripStatusButton}) - Me.gMonStatusStrip.Location = New System.Drawing.Point(0, 364) + Me.gMonStatusStrip.Location = New System.Drawing.Point(0, 379) Me.gMonStatusStrip.Name = "gMonStatusStrip" Me.gMonStatusStrip.ShowItemToolTips = True Me.gMonStatusStrip.Size = New System.Drawing.Size(524, 22) @@ -248,33 +247,26 @@ Partial Class frmMain 'gMonStripAdminButton ' Me.gMonStripAdminButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image - Me.gMonStripAdminButton.DropDownButtonWidth = 0 Me.gMonStripAdminButton.Image = Global.GBM.My.Resources.Resources.Icon_User - Me.gMonStripAdminButton.ImageTransparentColor = System.Drawing.Color.Magenta Me.gMonStripAdminButton.Name = "gMonStripAdminButton" - Me.gMonStripAdminButton.Size = New System.Drawing.Size(21, 20) - Me.gMonStripAdminButton.Text = "Elevation" - Me.gMonStripAdminButton.ToolTipText = "Elevation" + Me.gMonStripAdminButton.Size = New System.Drawing.Size(16, 17) + Me.gMonStripAdminButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage ' 'gMonStripTxtStatus ' + Me.gMonStripTxtStatus.Margin = New System.Windows.Forms.Padding(5, 0, 0, 0) Me.gMonStripTxtStatus.Name = "gMonStripTxtStatus" - Me.gMonStripTxtStatus.Size = New System.Drawing.Size(395, 17) + Me.gMonStripTxtStatus.Size = New System.Drawing.Size(400, 22) Me.gMonStripTxtStatus.Spring = True Me.gMonStripTxtStatus.Text = "Monitor Status" Me.gMonStripTxtStatus.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'gMonStripStatusButton ' - Me.gMonStripStatusButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right - Me.gMonStripStatusButton.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center - Me.gMonStripStatusButton.DropDownButtonWidth = 0 - Me.gMonStripStatusButton.ImageTransparentColor = System.Drawing.Color.Magenta Me.gMonStripStatusButton.Name = "gMonStripStatusButton" - Me.gMonStripStatusButton.Size = New System.Drawing.Size(93, 20) + Me.gMonStripStatusButton.Size = New System.Drawing.Size(88, 17) Me.gMonStripStatusButton.Text = "Monitor Status:" Me.gMonStripStatusButton.TextImageRelation = System.Windows.Forms.TextImageRelation.TextBeforeImage - Me.gMonStripStatusButton.ToolTipText = "Click to toggle monitoring on or off." ' 'gMonMainMenu ' @@ -531,7 +523,7 @@ Partial Class frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(524, 386) + Me.ClientSize = New System.Drawing.Size(524, 401) Me.Controls.Add(Me.pbTime) Me.Controls.Add(Me.lblStatus3) Me.Controls.Add(Me.lblStatus2) @@ -593,7 +585,6 @@ Partial Class frmMain Friend WithEvents gMonHelpAbout As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupGameManager As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupCustomVariables As System.Windows.Forms.ToolStripMenuItem - Friend WithEvents gMonStripStatusButton As System.Windows.Forms.ToolStripSplitButton Friend WithEvents pbIcon As System.Windows.Forms.PictureBox Friend WithEvents btnLogToggle As System.Windows.Forms.Button Friend WithEvents lblGameTitle As System.Windows.Forms.Label @@ -611,7 +602,6 @@ Partial Class frmMain Friend WithEvents gMonHelpManual As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonHelpCheckforUpdates As System.Windows.Forms.ToolStripMenuItem Friend WithEvents btnCancelOperation As System.Windows.Forms.Button - Friend WithEvents gMonStripAdminButton As ToolStripSplitButton Friend WithEvents gMonTraySetupTags As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonSetupTags As System.Windows.Forms.ToolStripMenuItem Friend WithEvents lblStatus1 As Label @@ -629,4 +619,6 @@ Partial Class frmMain Friend WithEvents gMonTrayToolsLog As ToolStripMenuItem Friend WithEvents gMonTrayLogClear As ToolStripMenuItem Friend WithEvents gMonTrayLogSave As ToolStripMenuItem + Friend WithEvents gMonStripAdminButton As System.Windows.Forms.ToolStripStatusLabel + Friend WithEvents gMonStripStatusButton As System.Windows.Forms.ToolStripStatusLabel End Class diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 16be855..d3f862f 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -29,6 +29,7 @@ Public Class frmMain Private bFirstRun As Boolean = False Private bProcessIsAdmin As Boolean = False Private bLogToggle As Boolean = False + Private bShowToggle As Boolean = True Private bAllowIcon As Boolean = False Private bAllowDetails As Boolean = False Private oPriorImage As Image @@ -36,6 +37,9 @@ Public Class frmMain Private sPriorCompany As String Private sPriorVersion As String + 'Developer Debug Flags + Private bProcessDebugMode As Boolean = False + WithEvents oFileWatcher As New System.IO.FileSystemWatcher WithEvents tmScanTimer As New Timer @@ -93,7 +97,7 @@ Public Class frmMain If oGame.AbsolutePath Then sStatus2 = oGame.Path Else - sStatus2 = oGame.ProcessPath & "\" & oGame.Path + sStatus2 = oGame.ProcessPath & System.IO.Path.DirectorySeparatorChar & oGame.Path End If sStatus3 = String.Empty @@ -329,8 +333,16 @@ Public Class frmMain Dim fbBrowser As New OpenFileDialog fbBrowser.Title = mgrCommon.FormatString(frmMain_ChooseIcon, oProcess.GameInfo.CroppedName) - fbBrowser.DefaultExt = "ico" - fbBrowser.Filter = frmMain_IconFilter + + 'Unix Handler + If Not mgrCommon.IsUnix Then + fbBrowser.DefaultExt = "ico" + fbBrowser.Filter = frmMain_IconFilter + Else + fbBrowser.DefaultExt = "png" + fbBrowser.Filter = frmMain_PNGFilter + End If + Try fbBrowser.InitialDirectory = IO.Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName) Catch ex As Exception @@ -559,8 +571,11 @@ Public Class frmMain sMainCommand = sFullCommand.Split(cDelimters, 2)(0) 'Parse Command - Select Case sMainCommand - Case "SQL" + Select Case sMainCommand.ToLower + Case "sql" + 'Run a SQL command directly on any database + 'Usage: SQL {Local or Remote} SQL Command + Dim oDatabase As mgrSQLite Dim bSuccess As Boolean @@ -572,9 +587,9 @@ Public Class frmMain Exit Select End If - If sCommand(1) = "Local" Then + If sCommand(1).ToLower = "local" Then oDatabase = New mgrSQLite(mgrSQLite.Database.Local) - ElseIf sCommand(1) = "Remote" Then + ElseIf sCommand(1).ToLower = "remote" Then oDatabase = New mgrSQLite(mgrSQLite.Database.Remote) Else mgrCommon.ShowMessage(frmMain_ErrorCommandBadParam, New String() {sCommand(1), sCommand(0)}, MsgBoxStyle.Exclamation) @@ -589,6 +604,34 @@ Public Class frmMain mgrCommon.ShowMessage(frmMain_CommandFail, MsgBoxStyle.Exclamation) End If + Case "debug" + 'Enable or disable various debug modes + 'Usage: DEBUG Mode {Enable or Disable} + + sCommand = sFullCommand.Split(cDelimters, 3) + + Dim bDebugEnable As Boolean = False + + 'Check Paramters + If sCommand.Length < 3 Then + mgrCommon.ShowMessage(frmMain_ErrorMissingParams, sCommand(0), MsgBoxStyle.Exclamation) + Exit Select + End If + + If sCommand(2).ToLower = "enable" Then + bDebugEnable = True + ElseIf sCommand(2).ToLower = "disable" Then + bDebugEnable = False + Else + mgrCommon.ShowMessage(frmMain_ErrorCommandBadParam, New String() {sCommand(1), sCommand(0)}, MsgBoxStyle.Exclamation) + Exit Select + End If + + Select Case sCommand(1).ToLower + Case "process" + bProcessDebugMode = bDebugEnable + mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) + End Select Case Else mgrCommon.ShowMessage(frmMain_ErrorCommandInvalid, sMainCommand, MsgBoxStyle.Exclamation) End Select @@ -798,26 +841,35 @@ Public Class frmMain Private Sub ToggleLog() If bLogToggle = False Then txtLog.Visible = True - Me.Size = New System.Drawing.Size(540, 425) + + 'Unix Handler + If mgrCommon.IsUnix Then + Me.Size = New System.Drawing.Size(Me.Size.Width, 440) + Else + Me.Size = New System.Drawing.Size(Me.Size.Width, 425) + End If + bLogToggle = True btnLogToggle.Text = frmMain_btnToggleLog_Hide txtLog.Select(txtLog.TextLength, 0) txtLog.ScrollToCaret() Else txtLog.Visible = False - Me.Size = New System.Drawing.Size(540, 245) + Me.Size = New System.Drawing.Size(Me.Size.Width, 245) bLogToggle = False btnLogToggle.Text = frmMain_btnToggleLog_Show End If End Sub Private Sub ToggleState() - 'Toggle State with Tray Clicks - If Me.Visible = False Then + 'Toggle State with Tray Clicks + If Not bShowToggle Then + bShowToggle = True Me.Visible = True Me.ShowInTaskbar = True Me.Focus() Else + bShowToggle = False Me.Visible = False Me.ShowInTaskbar = False End If @@ -1080,7 +1132,7 @@ Public Class frmMain lblLastAction.Text = String.Empty pbTime.SizeMode = PictureBoxSizeMode.AutoSize pbTime.Image = Icon_Clock - Me.Size = New System.Drawing.Size(540, 245) + Me.Size = New System.Drawing.Size(Me.Size.Width, 245) AddHandler mgrMonitorList.UpdateLog, AddressOf UpdateLog ResetGameInfo() End Sub @@ -1245,14 +1297,19 @@ Public Class frmMain 'Functions to handle other features Private Sub RestartAsAdmin() - If mgrCommon.IsElevated Then - mgrCommon.ShowMessage(frmMain_ErrorAlreadyAdmin, MsgBoxStyle.Information) - Else - If mgrCommon.ShowMessage(frmMain_ConfirmRunAsAdmin, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then - mgrCommon.RestartAsAdmin() - bShutdown = True - ShutdownApp(False) + 'Unix Hanlder + If Not mgrCommon.IsUnix Then + If mgrCommon.IsElevated Then + mgrCommon.ShowMessage(frmMain_ErrorAlreadyAdmin, MsgBoxStyle.Information) + Else + If mgrCommon.ShowMessage(frmMain_ConfirmRunAsAdmin, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + mgrCommon.RestartAsAdmin() + bShutdown = True + ShutdownApp(False) + End If End If + Else + mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation) End If End Sub @@ -1386,7 +1443,7 @@ Public Class frmMain ToggleLog() End Sub - Private Sub gMonStripSplitButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.ButtonClick + Private Sub gMonStripSplitStatusButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.Click ScanToggle() End Sub @@ -1397,6 +1454,7 @@ Public Class frmMain End Sub Private Sub gMonTray_BalloonTipClicked(sender As System.Object, e As System.EventArgs) Handles gMonTray.BalloonTipClicked + bShowToggle = True Me.Visible = True Me.ShowInTaskbar = True Me.Focus() @@ -1406,7 +1464,7 @@ Public Class frmMain OperationCancel() End Sub - Private Sub gMonStripAdminButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripAdminButton.ButtonClick + Private Sub gMonStripAdminButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripAdminButton.Click RestartAsAdmin() End Sub @@ -1416,11 +1474,19 @@ Public Class frmMain End Sub 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 e.Cancel = True - Me.Visible = False - Me.ShowInTaskbar = False + If Not mgrCommon.IsUnix Then + bShowToggle = False + Me.Visible = False + Me.ShowInTaskbar = False + End If End If End Sub @@ -1431,7 +1497,7 @@ Public Class frmMain Dim iErrorCode As Integer = 0 Dim sErrorMessage As String = String.Empty - If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode) Then + If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then PauseScan() If bNeedsPath Then @@ -1534,7 +1600,6 @@ Public Class frmMain End Sub Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load - 'Init Try SetForm() @@ -1542,7 +1607,8 @@ Public Class frmMain LoadAndVerify() VerifyCustomPathVariables() - If oSettings.StartToTray Then + If oSettings.StartToTray And Not mgrCommon.IsUnix Then + bShowToggle = False Me.Visible = False Me.ShowInTaskbar = False End If @@ -1554,26 +1620,31 @@ Public Class frmMain End If HandleScan() - CheckForNewBackups() - Catch niex As NotImplementedException - 'Ignore for Mono runtime tests + CheckForNewBackups() Catch ex As Exception - mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.Critical) - bInitFail = True + If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.YesNo) = MsgBoxResult.No Then + bInitFail = True + End If End Try + 'Unix Handler + If mgrCommon.IsUnix Then + Me.MinimizeBox = True + Else + Me.gMonTray.Visible = True + End If + End Sub Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown - - If bFirstRun And Not bInitFail Then - OpenStartupWizard() - End If - If bInitFail Then bShutdown = True Me.Close() End If + + If bFirstRun And Not bShutdown Then + OpenStartupWizard() + End If End Sub Private Sub txtGameInfo_Enter(sender As Object, e As EventArgs) diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index a36f79a..3face0c 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -113,6 +113,12 @@ Public Class frmSettings nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked cboCompression.SelectedValue = oSettings.CompressionLevel + + 'Unix Handler + If mgrCommon.IsUnix Then + chkStartToTray.Checked = False + chkStartWindows.Checked = False + End If End Sub Private Sub LoadCombos() @@ -159,6 +165,12 @@ Public Class frmSettings chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup grp7z.Text = frmSettings_grp7z lblCompression.Text = frmSettings_lblCompression + + 'Unix Handler + If mgrCommon.IsUnix Then + chkStartToTray.Enabled = False + chkStartWindows.Enabled = False + End If End Sub Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click diff --git a/GBM/Forms/frmStartUpWizard.Designer.vb b/GBM/Forms/frmStartUpWizard.Designer.vb index 3617741..36628c1 100644 --- a/GBM/Forms/frmStartUpWizard.Designer.vb +++ b/GBM/Forms/frmStartUpWizard.Designer.vb @@ -96,11 +96,10 @@ Partial Class frmStartUpWizard ' 'llbManual ' - Me.llbManual.AutoSize = True Me.llbManual.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!) Me.llbManual.Location = New System.Drawing.Point(14, 158) Me.llbManual.Name = "llbManual" - Me.llbManual.Size = New System.Drawing.Size(151, 13) + Me.llbManual.Size = New System.Drawing.Size(303, 13) Me.llbManual.TabIndex = 3 Me.llbManual.TabStop = True Me.llbManual.Text = "Game Backup Monitor Manual" diff --git a/GBM/Forms/frmStartUpWizard.vb b/GBM/Forms/frmStartUpWizard.vb index 82de3e7..1020093 100644 --- a/GBM/Forms/frmStartUpWizard.vb +++ b/GBM/Forms/frmStartUpWizard.vb @@ -98,6 +98,12 @@ Public Class frmStartUpWizard End Sub Private Sub DownloadSettings() + If mgrCommon.IsUnix Then + If mgrCommon.ShowMessage(frmGameManager_ConfirmUnixImportWarning, MsgBoxStyle.YesNo) = MsgBoxResult.No Then + Exit Sub + End If + End If + If mgrCommon.ShowMessage(frmStartUpWizard_ConfirmOfficialImport, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrMonitorList.DoImport(App_URLImport) Then oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList) diff --git a/GBM/Game Backup Monitor.vbproj b/GBM/Game Backup Monitor.vbproj index b21035e..c9f2855 100644 --- a/GBM/Game Backup Monitor.vbproj +++ b/GBM/Game Backup Monitor.vbproj @@ -1,4 +1,4 @@ - + Debug @@ -90,13 +90,21 @@ x64 ManagedMinimumRules.ruleset + + echo Running x64 Post Build Event... + COPY /Y "$(SolutionDir)\GBM\x64\sqlite3.dll" . + RMDIR /S /Q Utilities\x86 + echo Running x86 Post Build Event... + COPY /Y "$(SolutionDir)\GBM\x86\sqlite3.dll" . + RMDIR /S /Q Utilities\x64 + + + False + References\Mono.Data.Sqlite.dll + - - False - References\System.Data.SQLite.dll - @@ -320,7 +328,8 @@ PreserveNewest - + + @@ -332,6 +341,7 @@ + PreserveNewest @@ -350,12 +360,6 @@ PreserveNewest - - PreserveNewest - - - PreserveNewest - @@ -387,6 +391,7 @@ True + \ No newline at end of file diff --git a/GBM/Managers/mgrBackup.vb b/GBM/Managers/mgrBackup.vb index 1f94a3c..f6c5ba8 100644 --- a/GBM/Managers/mgrBackup.vb +++ b/GBM/Managers/mgrBackup.vb @@ -117,7 +117,7 @@ Public Class mgrBackup End If If oSettings.CreateSubFolder Then - sBackupFile = sBackupFile & "\" & oGame.Name + sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name Try If Not Directory.Exists(sBackupFile) Then Directory.CreateDirectory(sBackupFile) @@ -168,7 +168,12 @@ Public Class mgrBackup End If If Directory.Exists(sSavePath) Then - prs7z.StartInfo.Arguments = "a -bb1 -bt -t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r" + 'The Linux version of 7za doesn't support the new verbose parameters and fails out. Just split this up for now until we have a better solution. + If mgrCommon.IsUnix Then + prs7z.StartInfo.Arguments = "a -t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r" + Else + prs7z.StartInfo.Arguments = "a -bb1 -bt -t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r" + End If prs7z.StartInfo.FileName = mgrPath.Utility7zLocation prs7z.StartInfo.UseShellExecute = False prs7z.StartInfo.RedirectStandardOutput = True @@ -203,7 +208,7 @@ Public Class mgrBackup If bBackupCompleted Then If oSettings.CheckSum Then RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True) - sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) + sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) End If If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then diff --git a/GBM/Managers/mgrCommon.vb b/GBM/Managers/mgrCommon.vb index e23bbdd..b4b345f 100644 --- a/GBM/Managers/mgrCommon.vb +++ b/GBM/Managers/mgrCommon.vb @@ -1,6 +1,7 @@ Imports GBM.My.Resources Imports System.Net Imports System.IO +Imports System.Security.Principal Public Class mgrCommon @@ -97,6 +98,11 @@ Public Class mgrCommon Dim sExemptList As String() = {"dosbox", "scummvm"} Dim bFound As Boolean = False + 'We can't search if we don't have a configuration + If oGame.Temporary Then + Return True + End If + For Each s As String In sExemptList If oGame.ProcessName.ToLower.Contains(s) Then bFound = True Next @@ -108,12 +114,18 @@ Public Class mgrCommon End If End Function - Public Shared Function IsElevated() As Boolean - If My.User.IsInRole(ApplicationServices.BuiltInRole.Administrator) Then + Public Shared Function IsUnix() As Boolean + If Path.DirectorySeparatorChar = "/" Then Return True - Else - Return False End If + + Return False + End Function + + Public Shared Function IsElevated() As Boolean + Dim oID As WindowsIdentity = WindowsIdentity.GetCurrent + Dim oPrincipal As New WindowsPrincipal(oID) + Return oPrincipal.IsInRole(WindowsBuiltInRole.Administrator) End Function Public Shared Sub RestartAsAdmin() @@ -127,12 +139,38 @@ Public Class mgrCommon oProcess.Start() End Sub + 'Delete file based on OS type + Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True) + If File.Exists(sPath) Then + If IsUnix() Then + File.Delete(sPath) + Else + If bRecycle Then + My.Computer.FileSystem.DeleteFile(sPath, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + Else + File.Delete(sPath) + End If + End If + End If + End Sub + + 'Delete directory based on OS type + Public Shared Sub DeleteDirectory(ByVal sPath As String, Optional ByVal bRecursive As Boolean = False) + If Directory.Exists(sPath) Then + If IsUnix() Then + Directory.Delete(sPath, bRecursive) + Else + My.Computer.FileSystem.DeleteDirectory(sPath, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + End If + End If + End Sub + 'Save string as text file Public Shared Sub SaveText(ByVal sText As String, ByVal sPath As String) Dim oStream As StreamWriter Try - If File.Exists(sPath) Then My.Computer.FileSystem.DeleteFile(sPath, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.SendToRecycleBin) + If File.Exists(sPath) Then DeleteFile(sPath, False) oStream = New StreamWriter(sPath) oStream.Write(sText) oStream.Flush() diff --git a/GBM/Managers/mgrPath.vb b/GBM/Managers/mgrPath.vb index 93950a3..4f78348 100644 --- a/GBM/Managers/mgrPath.vb +++ b/GBM/Managers/mgrPath.vb @@ -39,6 +39,10 @@ Public Class mgrPath Shared ReadOnly Property Utility7zLocation As String Get + If mgrCommon.IsUnix Then + Return "/usr/bin/7za" + End If + Select Case oReleaseType Case ProcessorArchitecture.Amd64 Return Application.StartupPath & "/Utilities/x64/7za.exe" @@ -91,7 +95,7 @@ Public Class mgrPath Return sRemoteDatabaseLocation End Get Set(value As String) - sRemoteDatabaseLocation = value & "\gbm.s3db" + sRemoteDatabaseLocation = value & "/gbm.s3db" End Set End Property @@ -121,10 +125,14 @@ Public Class mgrPath Dim bDeep As Boolean Dim cDS As Char = Path.DirectorySeparatorChar 'Set the directory seperator based on the OS - 'If we are working with a case insenstive file system, use a uniform case. **Look into removing this completely** - If cDS <> "/" Then 'Checking the seperator to determine OS is better than messing with enumerations that weren't always supported + If Not mgrCommon.IsUnix Then + 'If we are working with a case insenstive file system, use a uniform case to reduce possible issues sProcessPath = sProcessPath.ToLower sSavePath = sSavePath.ToLower + Else + 'If we are on Unix trim the root off + sProcessPath = sProcessPath.TrimStart(cDS) + sSavePath = sSavePath.TrimStart(cDS) End If 'We need to ensure we have a single trailing slash on the parameters @@ -133,6 +141,7 @@ Public Class mgrPath sProcessPath &= cDS sSavePath &= cDS + 'Determines the direction we need to go, we always want to be relative to the process location If sSavePath.Split(cDS).Length > sProcessPath.Split(cDS).Length Then sPath1 = sProcessPath @@ -191,13 +200,12 @@ Public Class mgrPath Dim sCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) Dim oCustomVariable As clsPathVariable - If sValue.Contains("*mydocs*") Then - Return sValue.Replace("*mydocs*", sMyDocs) - End If - If sValue.Contains("*publicdocs*") Then - Return sValue.Replace("*publicdocs*", sPublicDocs) - End If + For Each oCustomVariable In hshCustomVariables.Values + If sValue.Contains(oCustomVariable.FormattedName) Then + Return sValue.Replace(oCustomVariable.FormattedName, oCustomVariable.Path) + End If + Next If sValue.Contains("*appdatalocal*") Then Return sValue.Replace("*appdatalocal*", sAppDataLocal) @@ -207,15 +215,21 @@ Public Class mgrPath Return sValue.Replace("*appdataroaming*", sAppDataRoaming) End If - If sValue.Contains("*currentuser*") Then - Return sValue.Replace("*currentuser*", sCurrentUser) + 'This needs to be tested last for Unix compatability + If sValue.Contains("*mydocs*") Then + Return sValue.Replace("*mydocs*", sMyDocs) End If - For Each oCustomVariable In hshCustomVariables.Values - If sValue.Contains(oCustomVariable.FormattedName) Then - Return sValue.Replace(oCustomVariable.FormattedName, oCustomVariable.Path) + 'Don't use these in Unix + If Not mgrCommon.IsUnix Then + If sValue.Contains("*publicdocs*") Then + Return sValue.Replace("*publicdocs*", sPublicDocs) End If - Next + + If sValue.Contains("*currentuser*") Then + Return sValue.Replace("*currentuser*", sCurrentUser) + End If + End If Return sValue End Function @@ -228,13 +242,11 @@ Public Class mgrPath Dim sCurrentUser As String = "*currentuser*" Dim oCustomVariable As clsPathVariable - If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) Then - Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), sMyDocs) - End If - - If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)) Then - Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), sPublicDocs) - End If + For Each oCustomVariable In hshCustomVariables.Values + If sValue.Contains(oCustomVariable.Path) Then + Return sValue.Replace(oCustomVariable.Path, oCustomVariable.FormattedName) + End If + Next If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)) Then Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), sAppDataLocal) @@ -244,15 +256,21 @@ Public Class mgrPath Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), sAppDataRoaming) End If - If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) Then - Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), sCurrentUser) + 'This needs to be tested last for Unix compatability + If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) Then + Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), sMyDocs) End If - For Each oCustomVariable In hshCustomVariables.Values - If sValue.Contains(oCustomVariable.Path) Then - Return sValue.Replace(oCustomVariable.Path, oCustomVariable.FormattedName) + 'Don't use these in Unix + If Not mgrCommon.IsUnix Then + If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)) Then + Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), sPublicDocs) End If - Next + + If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) Then + Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), sCurrentUser) + End If + End If Return sValue End Function @@ -262,11 +280,16 @@ Public Class mgrPath Dim hshCustomVariables As Hashtable = mgrVariables.ReadVariables Dim oCustomVariable As clsPathVariable - hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) - hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)) + hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)) hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) - hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) + + 'Don't use these in Unix + If Not mgrCommon.IsUnix Then + hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) + hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)) + hshFolders.Add(Guid.NewGuid.ToString, Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) + End If 'Load Custom Variables For Each oCustomVariable In hshCustomVariables.Values @@ -323,6 +346,7 @@ Public Class mgrPath Dim sFolder As String = String.Empty Dim bSearchFailed As Boolean = False + frmFind.GameName = sGameName frmFind.SearchItem = sProcess & ".*" frmFind.FolderSearch = False @@ -343,13 +367,7 @@ Public Class mgrPath frmFind.ShowDialog() If frmFind.FoundItem <> String.Empty Then - sFolder = IO.Path.GetDirectoryName(frmFind.FoundItem) - sMessage = mgrCommon.FormatString(mgrPath_ConfirmPathCorrect, New String() {sGameName, sFolder}) - If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then - Return sFolder - Else - sFolder = String.Empty - End If + Return frmFind.FoundItem Else bSearchFailed = True End If @@ -363,6 +381,8 @@ Public Class mgrPath If mgrCommon.ShowMessage(sMessage, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then sFolder = SetManualgamePath() End If + + frmFind.Dispose() End If Return sFolder diff --git a/GBM/Managers/mgrProcesses.vb b/GBM/Managers/mgrProcesses.vb index 58725f2..d0c5557 100644 --- a/GBM/Managers/mgrProcesses.vb +++ b/GBM/Managers/mgrProcesses.vb @@ -85,12 +85,69 @@ Public Class mgrProcesses Next End Sub - Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef iErrorCode As Integer) As Boolean + 'This function will only work correctly on Unix + Private Function GetUnixProcessArguments(ByVal prs As Process) As String() + Dim sArguments As String + Try + sArguments = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline") + Return sArguments.Split(vbNullChar) + Catch ex As Exception + Return New String() {String.Empty} + End Try + End Function + + 'This function will only work correctly on Unix + Private Function GetUnixSymLinkDirectory(ByVal prs As Process) As String + Dim prsls As Process + Dim slsinfo As String() + + 'This is the best way I can think of to determine the end point of a symlink without doing even more crazy shit + Try + prsls = New Process + prsls.StartInfo.FileName = "/bin/bash" + prsls.StartInfo.Arguments = "-c ""ls -l /proc/" & prs.Id.ToString & " | grep cwd""" + prsls.StartInfo.UseShellExecute = False + prsls.StartInfo.RedirectStandardOutput = True + prsls.StartInfo.CreateNoWindow = True + prsls.Start() + slsinfo = prsls.StandardOutput.ReadToEnd().Split(">") + Return slsinfo(slsinfo.Length - 1).Trim + Catch ex As Exception + Return String.Empty + End Try + End Function + + Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef iErrorCode As Integer, ByVal bDebugMode As Boolean) As Boolean Dim prsList() As Process = Process.GetProcesses Dim sProcessCheck As String = String.Empty + Dim sProcessList As String = String.Empty + Dim bWineProcess As Boolean = False For Each prsCurrent As Process In prsList - sProcessCheck = prsCurrent.ProcessName + 'This needs to be wrapped due to issues with Mono. + Try + sProcessCheck = prsCurrent.ProcessName + + 'Unix Handler + 'We need some special handling for Wine processes + If mgrCommon.IsUnix And sProcessCheck.ToLower = "wine-preloader" Then + Dim sWinePath As String() + 'We can't use Path.GetFileName here, Wine uses the Windows seperator in arguments and the Unix version of the function expects a different one. + sWinePath = GetUnixProcessArguments(prsCurrent)(0).Split("\") + sProcessCheck = sWinePath(sWinePath.Length - 1).Replace(".exe", "") + bWineProcess = True + Else + bWineProcess = False + End If + + If bDebugMode And mgrCommon.IsUnix Then + sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetUnixProcessArguments(prsCurrent)(0) & vbCrLf + ElseIf bDebugMode Then + sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & vbCrLf + End If + Catch ex As Exception + 'Do Nothing + End Try If hshScanList.ContainsKey(sProcessCheck) Then prsFoundProcess = prsCurrent @@ -105,7 +162,11 @@ Public Class mgrProcesses If Not oGame.AbsolutePath Or oGame.Duplicate Then Try - oGame.ProcessPath = Path.GetDirectoryName(prsCurrent.MainModule.FileName) + If Not bWineProcess Then + oGame.ProcessPath = Path.GetDirectoryName(prsCurrent.MainModule.FileName) + Else + oGame.ProcessPath = GetUnixSymLinkDirectory(prsCurrent) + End If Catch exWin32 As System.ComponentModel.Win32Exception 'If an exception occurs the process is: 'Running as administrator and the app isn't. @@ -117,10 +178,12 @@ Public Class mgrProcesses bNeedsPath = True iErrorCode = 299 Else + If bDebugMode Then mgrCommon.ShowMessage(exWin32.NativeErrorCode & " " & exWin32.Message & vbCrLf & vbCrLf & exWin32.StackTrace, MsgBoxStyle.Critical) 'A different failure occured, drop out and continue to scan. Return False End If Catch exAll As Exception + If bDebugMode Then mgrCommon.ShowMessage(exAll.Message & vbCrLf & vbCrLf & exAll.StackTrace, MsgBoxStyle.Critical) 'A different failure occured, drop out and continue to scan. Return False End Try @@ -137,6 +200,8 @@ Public Class mgrProcesses End If Next + If bDebugMode Then mgrCommon.SaveText(sProcessList, mgrPath.SettingsRoot & "/gbm_process_list.txt") + Return False End Function diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index c8a2ac1..091f06e 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -28,35 +28,24 @@ Public Class mgrRestore Public Event UpdateRestoreInfo(oRestoreInfo As clsBackup) Public Event SetLastAction(sMessage As String) - Private Shared Function CheckForPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame) As Boolean - Dim oResult As MsgBoxResult - - If oCheckBackup.RestorePath <> oCheckGame.Path Then - oResult = mgrCommon.ShowMessage(mgrRestore_ConfirmPathMismatch, oCheckBackup.CroppedName, MsgBoxStyle.YesNoCancel) - If oResult = MsgBoxResult.Yes Then - If Path.IsPathRooted(oCheckGame.Path) Then - oCheckBackup.AbsolutePath = True - oCheckBackup.RestorePath = oCheckGame.Path - Else - oCheckBackup.RestorePath = oCheckGame.Path - End If - ElseIf oResult = MsgBoxResult.Cancel Then - Return False + Public Shared Sub DoPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame) + 'Always override the manifest restore path with the current configuration path if possible + If Not oCheckGame.Temporary Then + If Path.IsPathRooted(oCheckGame.Path) Then + oCheckBackup.AbsolutePath = True + Else + oCheckBackup.AbsolutePath = False End If + oCheckBackup.RestorePath = oCheckGame.Path End If - - Return True - End Function + End Sub Public Shared Function CheckPath(ByRef oRestoreInfo As clsBackup, ByVal oGame As clsGame, ByRef bTriggerReload As Boolean) As Boolean Dim sProcess As String Dim sRestorePath As String Dim bNoAuto As Boolean - 'Before we do anything check if we need to override the current path - If Not CheckForPathOverride(oRestoreInfo, oGame) Then - Return False - End If + DoPathOverride(oRestoreInfo, oGame) If Not oRestoreInfo.AbsolutePath Then If oGame.ProcessPath <> String.Empty Then @@ -232,7 +221,11 @@ Public Class mgrRestore If bDoRestore Then Try If File.Exists(sBackupFile) Then - prs7z.StartInfo.Arguments = "x """ & sBackupFile & """ -o""" & sExtractPath & "\"" -aoa -r" + If mgrCommon.IsUnix Then + prs7z.StartInfo.Arguments = "x """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r" + Else + prs7z.StartInfo.Arguments = "x -bb1 -bt """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r" + End If prs7z.StartInfo.FileName = mgrPath.Utility7zLocation prs7z.StartInfo.UseShellExecute = False prs7z.StartInfo.RedirectStandardOutput = True @@ -262,14 +255,14 @@ Public Class mgrRestore RaiseEvent UpdateLog(mgrRestore_ErrorNoBackup, True, ToolTipIcon.Error, True) End If - If bRestoreCompleted Then - 'Save Local Manifest - If mgrManifest.DoManifestCheck(oBackupInfo.Name, mgrSQLite.Database.Local) Then - mgrManifest.DoManifestUpdate(oBackupInfo, mgrSQLite.Database.Local) - Else - mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local) + If bRestoreCompleted Then + 'Save Local Manifest + If mgrManifest.DoManifestCheck(oBackupInfo.Name, mgrSQLite.Database.Local) Then + mgrManifest.DoManifestUpdate(oBackupInfo, mgrSQLite.Database.Local) + Else + mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local) + End If End If - End If Catch ex As Exception RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorOtherFailure, ex.Message), False, ToolTipIcon.Error, True) End Try diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index decdbfc..7821f90 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -1,6 +1,6 @@ Imports GBM.My.Resources Imports System.IO -Imports System.Data.SQLite +Imports Mono.Data.Sqlite Public Class mgrSQLite @@ -232,7 +232,8 @@ Public Class mgrSQLite BuildParams(command, hshParams) Try - adapter = New SQLiteDataAdapter(command) + adapter = New SqliteDataAdapter() + adapter.SelectCommand = command adapter.Fill(oData) Catch ex As Exception mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation) diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index f638bd3..7ca21e5 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -78,6 +78,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to This function is currently not available on a Unix based operating system.. + ''' + Friend ReadOnly Property App_ErrorUnixNotAvailable() As String + Get + Return ResourceManager.GetString("App_ErrorUnixNotAvailable", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to [PARAM] KB. ''' @@ -1374,6 +1383,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to You appear to be using a Unix based operating system. The official list currently contains only Microsoft Windows game configurations.[BR][BR]Do you wish to continue?. + ''' + Friend ReadOnly Property frmGameManager_ConfirmUnixImportWarning() As String + Get + Return ResourceManager.GetString("frmGameManager_ConfirmUnixImportWarning", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Game Backup Monitor Export. ''' @@ -2212,7 +2230,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to 7-Zip was not found in the Game Backup Monitor utilities folder. The application cannot continue.. + ''' Looks up a localized string similar to 7-Zip was not found. The application cannot continue.. ''' Friend ReadOnly Property frmMain_Error7zip() As String Get @@ -2329,7 +2347,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]The application will now exit.. + ''' Looks up a localized string similar to An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]Do you wish to continue anyway? (Not Recommended). ''' Friend ReadOnly Property frmMain_ErrorInitFailure() As String Get @@ -2850,6 +2868,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to PNG files (*.png)|*.png. + ''' + Friend ReadOnly Property frmMain_PNGFilter() As String + Get + Return ResourceManager.GetString("frmMain_PNGFilter", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Remote Database Vacuum Completed: [PARAM] KB. ''' @@ -4016,7 +4043,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM]. + ''' Looks up a localized string similar to [PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.*. ''' Friend ReadOnly Property mgrCommon_FilesFilter() As String Get diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 9dd1530..c3db190 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -194,7 +194,7 @@ [PARAM] is a 64-bit game, GBM cannot detect the required information to save your backup. - 7-Zip was not found in the Game Backup Monitor utilities folder. The application cannot continue. + 7-Zip was not found. The application cannot continue. [PARAM] is running as Administrator and GBM is not, GBM cannot detect the required information to save your backup. @@ -1355,7 +1355,7 @@ Generating SHA-256 hash for [PARAM] backup file. - [PARAM] files (*.[PARAM])|*.[PARAM] + [PARAM] files (*.[PARAM])|*.[PARAM]|All files (*.*)|*.* No @@ -1559,6 +1559,15 @@ The command [PARAM] requires more parameters. - An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]The application will now exit. + An unexpected error occured while initializing GBM.[BR][BR][PARAM][BR][BR]Do you wish to continue anyway? (Not Recommended) + + + This function is currently not available on a Unix based operating system. + + + You appear to be using a Unix based operating system. The official list currently contains only Microsoft Windows game configurations.[BR][BR]Do you wish to continue? + + + PNG files (*.png)|*.png \ No newline at end of file diff --git a/GBM/References/Mono.Data.Sqlite.dll b/GBM/References/Mono.Data.Sqlite.dll new file mode 100644 index 0000000..b092a1c Binary files /dev/null and b/GBM/References/Mono.Data.Sqlite.dll differ diff --git a/GBM/References/System.Data.SQLite.dll b/GBM/References/System.Data.SQLite.dll deleted file mode 100644 index 3ac522b..0000000 Binary files a/GBM/References/System.Data.SQLite.dll and /dev/null differ diff --git a/GBM/readme.txt b/GBM/readme.txt index 8d26a59..96adaca 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -2,7 +2,7 @@ Game Backup Monitor v0.96 Preview Readme http://mikemaximus.github.io/gbm-web/ gamebackupmonitor@gmail.com -February 19, 2016 +March 4, 2016 Disclaimer: @@ -10,10 +10,32 @@ This is beta release software. You may still encounter some bugs. New in 0.96 -- Fixes for multi-select edits and various minor bugs. -- GBM now deletes all user files to the Windows recycle bin by default. -- Added the ability to clear and save the session log from the Tools menu. -- GBM now auto-saves and clears the session log to %localappdata%\gbm if it reaches it's limit (2 MB). -- The file size will be displayed in the session log after each backup. +For more information regarding Linux support read the FAQ at http://mikemaximus.github.io/gbm-web/linux.html -The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html \ No newline at end of file +- (Linux) Added Linux support via Mono! +- (All) Replaced System.Data.SQLite with the Mono.Data.Sqlite for cross-platform support. +- (Windows) Updated GBM's version of 7-Zip to 15.14 (2015-12-31) +- (All) Added the ability to set the 7-Zip compression level on the Settings screen. +- (Windows) GBM now deletes all user files to the Windows recycle bin by default. +- (All) Added the ability to clear and save the session log from the Tools menu. +- (All) GBM now auto-saves and clears the session log to %localappdata%\gbm if it reaches it's limit (2 MB). +- (All) The file size will be displayed in the session log after each backup. + +The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html + +Important Upgrade Information: + +A very small percentage of users may experience the following error message after upgrading to this version: + +Column 'CompressionLevel' does not belong to table Table. + +If you get this error follow these steps: + +1. Start GBM and click "Yes" to continue past the error. +2. Press CTRL and ~ (Tilde) to open the Developer Console. +3. Enter the command exactly as follows (or copy & paste it) then click OK. + +SQL Local PRAGMA user_version=95 + +4. You'll receive confirmation that the command was executed. Click OK and immediately close GBM via the File menu. +5. Restart GBM and the error will no longer appear! \ No newline at end of file diff --git a/GBM/x64/SQLite.Interop.dll b/GBM/x64/SQLite.Interop.dll deleted file mode 100644 index 7132e34..0000000 Binary files a/GBM/x64/SQLite.Interop.dll and /dev/null differ diff --git a/GBM/x64/sqlite3.dll b/GBM/x64/sqlite3.dll new file mode 100644 index 0000000..3021560 Binary files /dev/null and b/GBM/x64/sqlite3.dll differ diff --git a/GBM/x86/SQLite.Interop.dll b/GBM/x86/SQLite.Interop.dll deleted file mode 100644 index c6ba428..0000000 Binary files a/GBM/x86/SQLite.Interop.dll and /dev/null differ diff --git a/GBM/x86/sqlite3.dll b/GBM/x86/sqlite3.dll new file mode 100644 index 0000000..315ade8 Binary files /dev/null and b/GBM/x86/sqlite3.dll differ