Compare commits
62 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe6e0d9d37 | ||
|
|
783bf89241 | ||
|
|
21cce19c92 | ||
|
|
c93af8821f | ||
|
|
7dc61e76ab | ||
|
|
54b624a1cb | ||
|
|
1b0f26cea1 | ||
|
|
2e7189f047 | ||
|
|
5a6b7fe2c5 | ||
|
|
f204f6ccc6 | ||
|
|
9fdc35c43d | ||
|
|
9dc409415f | ||
|
|
4e1dc101e5 | ||
|
|
87f8840b72 | ||
|
|
c7565f5487 | ||
|
|
ffe34d29e7 | ||
|
|
4b201fb60e | ||
|
|
02a4a72409 | ||
|
|
376c1ad418 | ||
|
|
b7ebc41ba9 | ||
|
|
d8aa35491d | ||
|
|
b7d62f38af | ||
|
|
58e4c3f3f2 | ||
|
|
9d439e3d12 | ||
|
|
9a046bcb4c | ||
|
|
a556fa5da1 | ||
|
|
42726ac0ab | ||
|
|
58ac76eba0 | ||
|
|
f9b325ae67 | ||
|
|
8d82b2efd3 | ||
|
|
cb49434a46 | ||
|
|
f659edff64 | ||
|
|
e325678e76 | ||
|
|
854d2ed537 | ||
|
|
c7e3e62ce1 | ||
|
|
898e72f163 | ||
|
|
333f7ac36a | ||
|
|
ace287f42a | ||
|
|
0f800565fe | ||
|
|
7a4caab5a5 | ||
|
|
c1b81585a0 | ||
|
|
0fcbfbe430 | ||
|
|
26d33206df | ||
|
|
dcbfad7513 | ||
|
|
8ab209c1a9 | ||
|
|
b674e4e82b | ||
|
|
9fc53e74b1 | ||
|
|
fd6ddd4b85 | ||
|
|
8800c4ebf4 | ||
|
|
9b89af931f | ||
|
|
874dfd4c86 | ||
|
|
cc8d16f4a9 | ||
|
|
748a921d1c | ||
|
|
d74a6d50b1 | ||
|
|
7ca4178631 | ||
|
|
63da6eba19 | ||
|
|
3e141cebb5 | ||
|
|
52c9fe506f | ||
|
|
b04c1bc18b | ||
|
|
647193f933 | ||
|
|
e6277f1ae4 | ||
|
|
ccd6d1fd39 |
Vendored
+1
-3
@@ -186,6 +186,4 @@ FakesAssemblies/
|
||||
GeneratedArtifacts/
|
||||
_Pvt_Extensions/
|
||||
ModelManifest.xml
|
||||
/.vs/slnx.sqlite
|
||||
/.vs/VSWorkspaceState.json
|
||||
/.vs/Game Backup Monitor/v15
|
||||
/.vs
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
Private bMonitorOnly As Boolean
|
||||
Private sComments As String
|
||||
Private bIsRegEx As Boolean
|
||||
Private bRecurseSubFolders As Boolean
|
||||
Private oTags As List(Of Tag)
|
||||
|
||||
Property ID As String
|
||||
@@ -141,6 +142,15 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property RecurseSubFolders As Boolean
|
||||
Set(value As Boolean)
|
||||
bRecurseSubFolders = value
|
||||
End Set
|
||||
Get
|
||||
Return bRecurseSubFolders
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property Tags As List(Of Tag)
|
||||
Get
|
||||
Return oTags
|
||||
|
||||
+27
-30
@@ -1,4 +1,6 @@
|
||||
<Serializable()>
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
<Serializable()>
|
||||
Public Class clsGame
|
||||
Private sGameID As String = Guid.NewGuid.ToString
|
||||
Private sGameName As String = String.Empty
|
||||
@@ -21,9 +23,10 @@ Public Class clsGame
|
||||
Private bMonitorOnly As Boolean = False
|
||||
Private sComments As String = String.Empty
|
||||
Private bIsRegEx As Boolean = False
|
||||
Private bDuplicate As Boolean = False
|
||||
Private bRecurseSubFolders As Boolean = True
|
||||
Private oImportTags As New List(Of Tag)
|
||||
Private bImportUpdate As Boolean = False
|
||||
Private oCompiledRegEx As Regex
|
||||
|
||||
<Flags()> Public Enum eOptionalSyncFields
|
||||
None = 0
|
||||
@@ -46,12 +49,6 @@ Public Class clsGame
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property CompoundKey As String
|
||||
Get
|
||||
Return ProcessName & ":" & ID
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property CroppedName As String
|
||||
Get
|
||||
If Name.Length > 40 Then
|
||||
@@ -248,27 +245,24 @@ Public Class clsGame
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property Duplicate As Boolean
|
||||
Property RecurseSubFolders As Boolean
|
||||
Get
|
||||
Return bDuplicate
|
||||
Return bRecurseSubFolders
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
bDuplicate = value
|
||||
bRecurseSubFolders = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
ReadOnly Property TruePath As String
|
||||
Property TruePath As String
|
||||
Set(value As String)
|
||||
sPath = value
|
||||
End Set
|
||||
Get
|
||||
Return sPath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
ReadOnly Property TrueProcess As String
|
||||
Get
|
||||
Return HandleProcessDuplicates()
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property ImportTags As List(Of Tag)
|
||||
Get
|
||||
Return oImportTags
|
||||
@@ -287,6 +281,15 @@ Public Class clsGame
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CompiledRegEx As Regex
|
||||
Get
|
||||
Return oCompiledRegEx
|
||||
End Get
|
||||
Set(value As Regex)
|
||||
oCompiledRegEx = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
ReadOnly Property IncludeArray As String()
|
||||
Get
|
||||
If FileType = String.Empty Then
|
||||
@@ -361,6 +364,9 @@ Public Class clsGame
|
||||
If IsRegEx <> oGame.IsRegEx Then
|
||||
Return False
|
||||
End If
|
||||
If RecurseSubFolders <> oGame.RecurseSubFolders Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
'Optional Sync Fields
|
||||
If (eSyncFields And eOptionalSyncFields.Company) = eOptionalSyncFields.Company Then
|
||||
@@ -437,6 +443,9 @@ Public Class clsGame
|
||||
If IsRegEx <> oGame.IsRegEx Then
|
||||
Return False
|
||||
End If
|
||||
If RecurseSubFolders <> oGame.RecurseSubFolders Then
|
||||
Return False
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
End Function
|
||||
@@ -457,18 +466,6 @@ Public Class clsGame
|
||||
Return DirectCast(Me.MemberwiseClone(), clsGame)
|
||||
End Function
|
||||
|
||||
Private Function HandleProcessDuplicates() As String
|
||||
Dim sProcessName As String
|
||||
|
||||
'Handle Duplicates
|
||||
sProcessName = Me.ProcessName
|
||||
If Me.Duplicate Then
|
||||
sProcessName = Me.ProcessName.Split(":")(0)
|
||||
End If
|
||||
|
||||
Return sProcessName
|
||||
End Function
|
||||
|
||||
Public Shared Function SetSyncField(ByVal eSyncFields As eOptionalSyncFields, ByVal eSyncField As eOptionalSyncFields) As eOptionalSyncFields
|
||||
Return eSyncFields Or eSyncField
|
||||
End Function
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
ReadOnly Property FormattedName As String
|
||||
Get
|
||||
Return "*" & sVariableName & "*"
|
||||
Return "%" & sVariableName & "%"
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Generated
+14
@@ -68,6 +68,7 @@ Partial Class frmAddWizard
|
||||
Me.btnCancel = New System.Windows.Forms.Button()
|
||||
Me.btnNext = New System.Windows.Forms.Button()
|
||||
Me.btnBack = New System.Windows.Forms.Button()
|
||||
Me.chkRecurseSubFolders = New System.Windows.Forms.CheckBox()
|
||||
Me.tabWizard.SuspendLayout()
|
||||
Me.tbPage1.SuspendLayout()
|
||||
Me.tbPage2.SuspendLayout()
|
||||
@@ -310,6 +311,7 @@ Partial Class frmAddWizard
|
||||
'tbPage3a
|
||||
'
|
||||
Me.tbPage3a.BackColor = System.Drawing.SystemColors.Control
|
||||
Me.tbPage3a.Controls.Add(Me.chkRecurseSubFolders)
|
||||
Me.tbPage3a.Controls.Add(Me.lblIncludePathTitle)
|
||||
Me.tbPage3a.Controls.Add(Me.lblIncludePath)
|
||||
Me.tbPage3a.Controls.Add(Me.lblFileTypes)
|
||||
@@ -540,6 +542,17 @@ Partial Class frmAddWizard
|
||||
Me.btnBack.Text = "&Back"
|
||||
Me.btnBack.UseVisualStyleBackColor = True
|
||||
'
|
||||
'chkRecurseSubFolders
|
||||
'
|
||||
Me.chkRecurseSubFolders.AutoSize = True
|
||||
Me.chkRecurseSubFolders.Location = New System.Drawing.Point(218, 40)
|
||||
Me.chkRecurseSubFolders.Name = "chkRecurseSubFolders"
|
||||
Me.chkRecurseSubFolders.Size = New System.Drawing.Size(15, 14)
|
||||
Me.chkRecurseSubFolders.TabIndex = 0
|
||||
Me.chkRecurseSubFolders.TabStop = False
|
||||
Me.chkRecurseSubFolders.UseVisualStyleBackColor = True
|
||||
Me.chkRecurseSubFolders.Visible = False
|
||||
'
|
||||
'frmAddWizard
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -618,4 +631,5 @@ Partial Class frmAddWizard
|
||||
Friend WithEvents lblExcludePathTitle As Label
|
||||
Friend WithEvents lblLimit As Label
|
||||
Friend WithEvents nudLimit As NumericUpDown
|
||||
Friend WithEvents chkRecurseSubFolders As CheckBox
|
||||
End Class
|
||||
|
||||
@@ -66,6 +66,7 @@ Public Class frmAddWizard
|
||||
|
||||
chkFolderSave.Checked = True
|
||||
chkTimeStamp.Checked = False
|
||||
chkRecurseSubFolders.Checked = True
|
||||
StepHandler()
|
||||
End Sub
|
||||
|
||||
@@ -112,6 +113,7 @@ Public Class frmAddWizard
|
||||
Dim iLimit As Integer = nudLimit.Value
|
||||
Dim sFileType As String = txtFileTypes.Text
|
||||
Dim sExcludeList As String = txtExcludeList.Text
|
||||
Dim bRecurseSubFolders As Boolean = chkRecurseSubFolders.Checked
|
||||
Dim sProcess As String
|
||||
Dim sItem As String()
|
||||
Dim sItems As String()
|
||||
@@ -160,6 +162,7 @@ Public Class frmAddWizard
|
||||
oGame.BackupLimit = iLimit
|
||||
oGame.ExcludeList = sExcludeList
|
||||
oGame.ProcessPath = sProcessPath
|
||||
oGame.RecurseSubFolders = bRecurseSubFolders
|
||||
|
||||
Return oGame
|
||||
End Function
|
||||
@@ -416,7 +419,7 @@ Public Class frmAddWizard
|
||||
End If
|
||||
|
||||
sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe",
|
||||
frmAddWizard_Executable, sDefaultFolder, False, False)
|
||||
frmAddWizard_Executable, sDefaultFolder, False)
|
||||
|
||||
If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath
|
||||
End Sub
|
||||
@@ -452,9 +455,9 @@ Public Class frmAddWizard
|
||||
frm.FormName = sFormText
|
||||
frm.BuilderString = txtBox.Text
|
||||
frm.RootFolder = txtSavePath.Text
|
||||
|
||||
frm.RecurseSubFolders = chkRecurseSubFolders.Checked
|
||||
frm.ShowDialog()
|
||||
|
||||
chkRecurseSubFolders.Checked = frm.RecurseSubFolders
|
||||
txtBox.Text = frm.BuilderString
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ Public Class frmAdvancedImport
|
||||
Private oImportData As ExportData
|
||||
Private hshImportData As Hashtable
|
||||
Private hshFinalData As New Hashtable
|
||||
Private bModWinConfigsForLinux As Boolean
|
||||
Private bSelectAll As Boolean = True
|
||||
Private bIsLoading As Boolean = False
|
||||
Private iCurrentSort As Integer = 0
|
||||
@@ -30,6 +31,15 @@ Public Class frmAdvancedImport
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public Property ModWinConfigsForLinux As Boolean
|
||||
Set(value As Boolean)
|
||||
bModWinConfigsForLinux = value
|
||||
End Set
|
||||
Get
|
||||
Return bModWinConfigsForLinux
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property FinalData As Hashtable
|
||||
Get
|
||||
Return hshFinalData
|
||||
@@ -56,6 +66,62 @@ Public Class frmAdvancedImport
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ModTags(ByRef oTags As List(Of Tag))
|
||||
Dim bExists As Boolean
|
||||
Dim oTag As Tag
|
||||
Dim oNewTag As Tag
|
||||
Dim oRemoveTag As New Tag
|
||||
Dim sTag As String
|
||||
Dim sAddTags() As String = {"Wine"}
|
||||
Dim sRemoveTags() As String = {"Official"}
|
||||
|
||||
For Each sTag In sAddTags
|
||||
bExists = False
|
||||
For Each oTag In oTags
|
||||
If oTag.Name = sTag Then
|
||||
bExists = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bExists Then
|
||||
oNewTag = New Tag
|
||||
oNewTag.Name = sTag
|
||||
oTags.Add(oNewTag)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each sTag In sRemoveTags
|
||||
bExists = False
|
||||
For Each oTag In oTags
|
||||
If oTag.Name = sTag Then
|
||||
bExists = True
|
||||
oRemoveTag = oTag
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bExists Then
|
||||
oTags.Remove(oRemoveTag)
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CheckIgnoreTags(ByVal oTags As List(Of Tag)) As Boolean
|
||||
Dim oTag As Tag
|
||||
Dim sTag As String
|
||||
Dim sIgnoreTags() As String = {"DOSBox", "ScummVM"}
|
||||
|
||||
For Each oTag In oTags
|
||||
For Each sTag In sIgnoreTags
|
||||
If oTag.Name = sTag Then
|
||||
Return False
|
||||
End If
|
||||
Next
|
||||
Next
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub LoadData(Optional ByVal sFilter As String = "", Optional ByVal bAutoDetect As Boolean = False)
|
||||
Dim oApp As clsGame
|
||||
Dim oListViewItem As ListViewItem
|
||||
@@ -75,6 +141,12 @@ Public Class frmAdvancedImport
|
||||
For Each de As DictionaryEntry In ImportData
|
||||
bAddItem = False
|
||||
oApp = DirectCast(de.Value, clsGame)
|
||||
|
||||
'Run any required tag mods
|
||||
If ModWinConfigsForLinux Then
|
||||
ModTags(oApp.ImportTags)
|
||||
End If
|
||||
|
||||
sTags = String.Empty
|
||||
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
|
||||
For Each oTag As Tag In oApp.ImportTags
|
||||
@@ -82,7 +154,7 @@ Public Class frmAdvancedImport
|
||||
Next
|
||||
sTags = sTags.TrimEnd(New Char() {",", " "})
|
||||
|
||||
oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.TrueProcess, sTags})
|
||||
oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.ProcessName, sTags})
|
||||
oListViewItem.Tag = oApp.ID
|
||||
|
||||
If FinalData.ContainsKey(oApp.ID) Then
|
||||
@@ -114,11 +186,16 @@ Public Class frmAdvancedImport
|
||||
If sFilter = String.Empty Then
|
||||
bAddItem = True
|
||||
Else
|
||||
If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.TrueProcess.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then
|
||||
If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.ProcessName.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then
|
||||
bAddItem = True
|
||||
End If
|
||||
End If
|
||||
|
||||
'Check for hardcoded ignore tags
|
||||
If bAddItem And ModWinConfigsForLinux Then
|
||||
bAddItem = CheckIgnoreTags(oApp.ImportTags)
|
||||
End If
|
||||
|
||||
If bAddItem Then
|
||||
If oListViewItem.Checked Then bResetSelectAll = True
|
||||
lstGames.Items.Add(oListViewItem)
|
||||
|
||||
@@ -38,7 +38,7 @@ Public Class frmChooseGame
|
||||
End Sub
|
||||
|
||||
Private Sub SaveSelection()
|
||||
oGame.ProcessPath = oProcess.GameInfo.ProcessPath
|
||||
oGame.ProcessPath = oProcess.ProcessPath
|
||||
mgrMonitorList.DoListUpdate(oGame)
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -202,6 +202,14 @@ Public Class frmFilter
|
||||
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
|
||||
oValidFields.Add(oField)
|
||||
|
||||
'Include Sub Folders
|
||||
oField = New clsGameFilterField
|
||||
oField.FieldName = "RecurseSubFolders"
|
||||
oField.FriendlyFieldName = frmFilter_FieldRecurseSubFolders
|
||||
oField.Type = clsGameFilterField.eDataType.fBool
|
||||
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
|
||||
oValidFields.Add(oField)
|
||||
|
||||
'Delete Folder on Restore
|
||||
oField = New clsGameFilterField
|
||||
oField.FieldName = "CleanFolder"
|
||||
|
||||
Generated
+65
-14
@@ -70,6 +70,7 @@ Partial Class frmGameManager
|
||||
Me.lblHours = New System.Windows.Forms.Label()
|
||||
Me.btnTags = New System.Windows.Forms.Button()
|
||||
Me.grpStats = New System.Windows.Forms.GroupBox()
|
||||
Me.btnImportBackup = New System.Windows.Forms.Button()
|
||||
Me.cboRemoteBackup = New System.Windows.Forms.ComboBox()
|
||||
Me.lblRestorePathData = New System.Windows.Forms.Label()
|
||||
Me.lblBackupFileData = New System.Windows.Forms.Label()
|
||||
@@ -96,6 +97,8 @@ Partial Class frmGameManager
|
||||
Me.btnExport = New System.Windows.Forms.Button()
|
||||
Me.cmsImport = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.cmsOfficial = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmsOfficialWindows = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmsOfficialLinux = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmsFile = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.txtQuickFilter = New System.Windows.Forms.TextBox()
|
||||
Me.lblQuickFilter = New System.Windows.Forms.Label()
|
||||
@@ -103,6 +106,8 @@ Partial Class frmGameManager
|
||||
Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.btnProcesses = New System.Windows.Forms.Button()
|
||||
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
|
||||
Me.chkRecurseSubFolders = New System.Windows.Forms.CheckBox()
|
||||
Me.grpConfig.SuspendLayout()
|
||||
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpExtra.SuspendLayout()
|
||||
@@ -142,7 +147,7 @@ Partial Class frmGameManager
|
||||
Me.btnBackup.Location = New System.Drawing.Point(616, 626)
|
||||
Me.btnBackup.Name = "btnBackup"
|
||||
Me.btnBackup.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnBackup.TabIndex = 18
|
||||
Me.btnBackup.TabIndex = 19
|
||||
Me.btnBackup.Text = "&Backup"
|
||||
Me.btnBackup.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -152,13 +157,14 @@ Partial Class frmGameManager
|
||||
Me.btnClose.Location = New System.Drawing.Point(697, 626)
|
||||
Me.btnClose.Name = "btnClose"
|
||||
Me.btnClose.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnClose.TabIndex = 19
|
||||
Me.btnClose.TabIndex = 20
|
||||
Me.btnClose.Text = "C&lose"
|
||||
Me.btnClose.UseVisualStyleBackColor = True
|
||||
'
|
||||
'grpConfig
|
||||
'
|
||||
Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.grpConfig.Controls.Add(Me.chkRecurseSubFolders)
|
||||
Me.grpConfig.Controls.Add(Me.btnGameID)
|
||||
Me.grpConfig.Controls.Add(Me.chkRegEx)
|
||||
Me.grpConfig.Controls.Add(Me.lblComments)
|
||||
@@ -287,7 +293,7 @@ Partial Class frmGameManager
|
||||
Me.btnInclude.Name = "btnInclude"
|
||||
Me.btnInclude.Size = New System.Drawing.Size(175, 23)
|
||||
Me.btnInclude.TabIndex = 12
|
||||
Me.btnInclude.Text = "In&clude Items..."
|
||||
Me.btnInclude.Text = "Incl&ude Items..."
|
||||
Me.btnInclude.UseVisualStyleBackColor = True
|
||||
'
|
||||
'txtID
|
||||
@@ -565,13 +571,14 @@ Partial Class frmGameManager
|
||||
Me.btnTags.Location = New System.Drawing.Point(535, 437)
|
||||
Me.btnTags.Name = "btnTags"
|
||||
Me.btnTags.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnTags.TabIndex = 12
|
||||
Me.btnTags.Text = "Tags..."
|
||||
Me.btnTags.TabIndex = 13
|
||||
Me.btnTags.Text = "&Tags..."
|
||||
Me.btnTags.UseVisualStyleBackColor = True
|
||||
'
|
||||
'grpStats
|
||||
'
|
||||
Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.grpStats.Controls.Add(Me.btnImportBackup)
|
||||
Me.grpStats.Controls.Add(Me.cboRemoteBackup)
|
||||
Me.grpStats.Controls.Add(Me.lblRestorePathData)
|
||||
Me.grpStats.Controls.Add(Me.lblBackupFileData)
|
||||
@@ -586,10 +593,19 @@ Partial Class frmGameManager
|
||||
Me.grpStats.Location = New System.Drawing.Point(248, 466)
|
||||
Me.grpStats.Name = "grpStats"
|
||||
Me.grpStats.Size = New System.Drawing.Size(525, 154)
|
||||
Me.grpStats.TabIndex = 15
|
||||
Me.grpStats.TabIndex = 16
|
||||
Me.grpStats.TabStop = False
|
||||
Me.grpStats.Text = "Backup Information"
|
||||
'
|
||||
'btnImportBackup
|
||||
'
|
||||
Me.btnImportBackup.Location = New System.Drawing.Point(9, 125)
|
||||
Me.btnImportBackup.Name = "btnImportBackup"
|
||||
Me.btnImportBackup.Size = New System.Drawing.Size(114, 23)
|
||||
Me.btnImportBackup.TabIndex = 8
|
||||
Me.btnImportBackup.Text = "Import B&ackup Files"
|
||||
Me.btnImportBackup.UseVisualStyleBackColor = True
|
||||
'
|
||||
'cboRemoteBackup
|
||||
'
|
||||
Me.cboRemoteBackup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
@@ -664,7 +680,7 @@ Partial Class frmGameManager
|
||||
Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125)
|
||||
Me.btnDeleteBackup.Name = "btnDeleteBackup"
|
||||
Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23)
|
||||
Me.btnDeleteBackup.TabIndex = 8
|
||||
Me.btnDeleteBackup.TabIndex = 9
|
||||
Me.btnDeleteBackup.Text = "&Delete Backup"
|
||||
Me.btnDeleteBackup.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -701,7 +717,7 @@ Partial Class frmGameManager
|
||||
Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 626)
|
||||
Me.btnMarkAsRestored.Name = "btnMarkAsRestored"
|
||||
Me.btnMarkAsRestored.Size = New System.Drawing.Size(100, 23)
|
||||
Me.btnMarkAsRestored.TabIndex = 16
|
||||
Me.btnMarkAsRestored.TabIndex = 17
|
||||
Me.btnMarkAsRestored.Text = "&Mark as Restored"
|
||||
Me.btnMarkAsRestored.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -711,7 +727,7 @@ Partial Class frmGameManager
|
||||
Me.btnRestore.Location = New System.Drawing.Point(535, 626)
|
||||
Me.btnRestore.Name = "btnRestore"
|
||||
Me.btnRestore.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnRestore.TabIndex = 17
|
||||
Me.btnRestore.TabIndex = 18
|
||||
Me.btnRestore.Text = "&Restore"
|
||||
Me.btnRestore.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -721,7 +737,7 @@ Partial Class frmGameManager
|
||||
Me.btnSave.Location = New System.Drawing.Point(616, 437)
|
||||
Me.btnSave.Name = "btnSave"
|
||||
Me.btnSave.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnSave.TabIndex = 13
|
||||
Me.btnSave.TabIndex = 14
|
||||
Me.btnSave.Text = "&Save"
|
||||
Me.btnSave.UseVisualStyleBackColor = True
|
||||
'
|
||||
@@ -740,8 +756,8 @@ Partial Class frmGameManager
|
||||
Me.btnCancel.Location = New System.Drawing.Point(697, 437)
|
||||
Me.btnCancel.Name = "btnCancel"
|
||||
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnCancel.TabIndex = 14
|
||||
Me.btnCancel.Text = "&Cancel"
|
||||
Me.btnCancel.TabIndex = 15
|
||||
Me.btnCancel.Text = "Ca&ncel"
|
||||
Me.btnCancel.UseVisualStyleBackColor = True
|
||||
'
|
||||
'chkEnabled
|
||||
@@ -838,10 +854,23 @@ Partial Class frmGameManager
|
||||
'
|
||||
'cmsOfficial
|
||||
'
|
||||
Me.cmsOfficial.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmsOfficialWindows, Me.cmsOfficialLinux})
|
||||
Me.cmsOfficial.Name = "cmsOfficial"
|
||||
Me.cmsOfficial.Size = New System.Drawing.Size(117, 22)
|
||||
Me.cmsOfficial.Text = "&Official List..."
|
||||
'
|
||||
'cmsOfficialWindows
|
||||
'
|
||||
Me.cmsOfficialWindows.Name = "cmsOfficialWindows"
|
||||
Me.cmsOfficialWindows.Size = New System.Drawing.Size(132, 22)
|
||||
Me.cmsOfficialWindows.Text = "&Windows..."
|
||||
'
|
||||
'cmsOfficialLinux
|
||||
'
|
||||
Me.cmsOfficialLinux.Name = "cmsOfficialLinux"
|
||||
Me.cmsOfficialLinux.Size = New System.Drawing.Size(132, 22)
|
||||
Me.cmsOfficialLinux.Text = "&Linux..."
|
||||
'
|
||||
'cmsFile
|
||||
'
|
||||
Me.cmsFile.Name = "cmsFile"
|
||||
@@ -888,10 +917,27 @@ Partial Class frmGameManager
|
||||
Me.btnProcesses.Location = New System.Drawing.Point(454, 437)
|
||||
Me.btnProcesses.Name = "btnProcesses"
|
||||
Me.btnProcesses.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnProcesses.TabIndex = 20
|
||||
Me.btnProcesses.Text = "Processes..."
|
||||
Me.btnProcesses.TabIndex = 12
|
||||
Me.btnProcesses.Text = "Pro&cesses..."
|
||||
Me.btnProcesses.UseVisualStyleBackColor = True
|
||||
'
|
||||
'ttFullPath
|
||||
'
|
||||
Me.ttFullPath.AutoPopDelay = 5000
|
||||
Me.ttFullPath.InitialDelay = 300
|
||||
Me.ttFullPath.ReshowDelay = 60
|
||||
'
|
||||
'chkRecurseSubFolders
|
||||
'
|
||||
Me.chkRecurseSubFolders.AutoSize = True
|
||||
Me.chkRecurseSubFolders.Location = New System.Drawing.Point(489, 206)
|
||||
Me.chkRecurseSubFolders.Name = "chkRecurseSubFolders"
|
||||
Me.chkRecurseSubFolders.Size = New System.Drawing.Size(15, 14)
|
||||
Me.chkRecurseSubFolders.TabIndex = 0
|
||||
Me.chkRecurseSubFolders.TabStop = False
|
||||
Me.chkRecurseSubFolders.UseVisualStyleBackColor = True
|
||||
Me.chkRecurseSubFolders.Visible = False
|
||||
'
|
||||
'frmGameManager
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -1022,4 +1068,9 @@ Partial Class frmGameManager
|
||||
Friend WithEvents chkRegEx As CheckBox
|
||||
Friend WithEvents btnGameID As Button
|
||||
Friend WithEvents btnProcesses As Button
|
||||
Friend WithEvents ttFullPath As ToolTip
|
||||
Friend WithEvents btnImportBackup As Button
|
||||
Friend WithEvents cmsOfficialWindows As ToolStripMenuItem
|
||||
Friend WithEvents cmsOfficialLinux As ToolStripMenuItem
|
||||
Friend WithEvents chkRecurseSubFolders As CheckBox
|
||||
End Class
|
||||
|
||||
@@ -123,4 +123,7 @@
|
||||
<metadata name="cmsDeleteBackup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>127, 17</value>
|
||||
</metadata>
|
||||
<metadata name="ttFullPath.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>275, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
+265
-85
@@ -8,14 +8,17 @@ Public Class frmGameManager
|
||||
Private sBackupFolder As String
|
||||
Private bPendingRestores As Boolean = False
|
||||
Private oCurrentBackupItem As clsBackup
|
||||
Private oLastPlayedGame As clsGame
|
||||
Private oCurrentGame As clsGame
|
||||
Private oTagsToSave As New List(Of KeyValuePair(Of String, String))
|
||||
Private oProcessesToSave As New List(Of KeyValuePair(Of String, String))
|
||||
Private bDisableExternalFunctions As Boolean = False
|
||||
Private bTriggerBackup As Boolean = False
|
||||
Private bTriggerRestore As Boolean = False
|
||||
Private bTriggerImportBackup As Boolean = False
|
||||
Private oBackupList As New List(Of clsGame)
|
||||
Private oRestoreList As New Hashtable
|
||||
Private oImportBackupList As New Hashtable
|
||||
Private oGameData As OrderedDictionary
|
||||
Private oLocalBackupData As SortedList
|
||||
Private oRemoteBackupData As SortedList
|
||||
@@ -67,6 +70,15 @@ Public Class frmGameManager
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property LastPlayedGame As clsGame
|
||||
Get
|
||||
Return oLastPlayedGame
|
||||
End Get
|
||||
Set(value As clsGame)
|
||||
oLastPlayedGame = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CurrentGame As clsGame
|
||||
Get
|
||||
Return oCurrentGame
|
||||
@@ -121,6 +133,15 @@ Public Class frmGameManager
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property TriggerImportBackup As Boolean
|
||||
Get
|
||||
Return bTriggerImportBackup
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
bTriggerImportBackup = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property BackupList As List(Of clsGame)
|
||||
Get
|
||||
Return oBackupList
|
||||
@@ -139,6 +160,15 @@ Public Class frmGameManager
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property ImportBackupList As Hashtable
|
||||
Get
|
||||
Return oImportBackupList
|
||||
End Get
|
||||
Set(value As Hashtable)
|
||||
oImportBackupList = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Property IsDirty As Boolean
|
||||
Get
|
||||
Return bIsDirty
|
||||
@@ -162,20 +192,24 @@ Public Class frmGameManager
|
||||
oLocalBackupData = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Local)
|
||||
End Sub
|
||||
|
||||
Private Function ConvertToRelativePath(ByVal sSavePath As String, ByVal sAppPath As String) As String
|
||||
Private Function HandleSavePath(ByVal sSavePath As String, ByVal sAppPath As String) As String
|
||||
Dim sPath As String = sSavePath
|
||||
|
||||
'Determine a relative path if possible
|
||||
If sAppPath <> String.Empty And sSavePath <> String.Empty Then
|
||||
If Not mgrPath.IsAbsolute(sSavePath) Then
|
||||
If Not mgrPath.IsAbsolute(sSavePath) Then
|
||||
'Determine a relative path if possible
|
||||
If sAppPath <> String.Empty And sSavePath <> String.Empty Then
|
||||
sPath = mgrPath.DetermineRelativePath(sAppPath, sSavePath)
|
||||
End If
|
||||
Else
|
||||
If Not oSettings.ShowResolvedPaths Then
|
||||
sPath = mgrPath.ReverseSpecialPaths(sPath)
|
||||
End If
|
||||
End If
|
||||
|
||||
Return sPath
|
||||
End Function
|
||||
|
||||
Private Sub CheckManifestandUpdate(ByVal oOriginalApp As clsGame, ByVal oNewApp As clsGame, ByVal bUseGameID As Boolean)
|
||||
Private Function CheckManifestandUpdate(ByVal oOriginalApp As clsGame, ByVal oNewApp As clsGame, ByVal bUseGameID As Boolean) As Boolean
|
||||
Dim oBackupItems As List(Of clsBackup)
|
||||
Dim sDirectory As String
|
||||
Dim sNewDirectory As String
|
||||
@@ -195,6 +229,54 @@ Public Class frmGameManager
|
||||
sOriginalAppItem = oOriginalApp.FileSafeName
|
||||
End If
|
||||
|
||||
'Remote
|
||||
If mgrManifest.DoManifestCheck(oOriginalApp.ID, mgrSQLite.Database.Remote) Then
|
||||
|
||||
'Check for existing folder
|
||||
sDirectory = BackupFolder & sOriginalAppItem
|
||||
sNewDirectory = sDirectory.Replace(sOriginalAppItem, sNewAppItem)
|
||||
If Directory.Exists(sNewDirectory) Then
|
||||
If mgrCommon.ShowMessage(frmGameManager_ErrorRenameFolderExists, New String() {sDirectory, sNewDirectory}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
mgrCommon.DeleteDirectory(sNewDirectory, True)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
|
||||
oBackupItems = mgrManifest.DoManifestGetByMonitorID(oOriginalApp.ID, mgrSQLite.Database.Remote)
|
||||
|
||||
'Check for existing files
|
||||
For Each oBackupItem As clsBackup In oBackupItems
|
||||
sFileName = BackupFolder & oBackupItem.FileName
|
||||
sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(sOriginalAppItem, sNewAppItem)
|
||||
If File.Exists(sNewFileName) Then
|
||||
If mgrCommon.ShowMessage(frmGameManager_ErrorRenameFilesExist, New String() {sOriginalAppItem, sNewAppItem}, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||
Return False
|
||||
End If
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
'Rename files
|
||||
For Each oBackupItem As clsBackup In oBackupItems
|
||||
'Rename Current Backup File
|
||||
sFileName = BackupFolder & oBackupItem.FileName
|
||||
sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(sOriginalAppItem, sNewAppItem)
|
||||
If File.Exists(sFileName) And Not sFileName = sNewFileName Then
|
||||
If File.Exists(sNewFileName) Then mgrCommon.DeleteFile(sNewFileName)
|
||||
FileSystem.Rename(sFileName, sNewFileName)
|
||||
End If
|
||||
oBackupItem.MonitorID = oNewApp.ID
|
||||
oBackupItem.FileName = oBackupItem.FileName.Replace(sOriginalAppItem, sNewAppItem)
|
||||
mgrManifest.DoManifestUpdateByManifestID(oBackupItem, mgrSQLite.Database.Remote)
|
||||
Next
|
||||
|
||||
'Rename folder
|
||||
If Directory.Exists(sDirectory) And Not sDirectory = sNewDirectory Then
|
||||
FileSystem.Rename(sDirectory, sNewDirectory)
|
||||
End If
|
||||
End If
|
||||
|
||||
'Local
|
||||
If mgrManifest.DoManifestCheck(oOriginalApp.ID, mgrSQLite.Database.Local) Then
|
||||
oBackupItems = mgrManifest.DoManifestGetByMonitorID(oOriginalApp.ID, mgrSQLite.Database.Local)
|
||||
@@ -205,33 +287,10 @@ Public Class frmGameManager
|
||||
mgrManifest.DoManifestUpdateByManifestID(oBackupItem, mgrSQLite.Database.Local)
|
||||
Next
|
||||
End If
|
||||
|
||||
'Remote
|
||||
If mgrManifest.DoManifestCheck(oOriginalApp.ID, mgrSQLite.Database.Remote) Then
|
||||
oBackupItems = mgrManifest.DoManifestGetByMonitorID(oOriginalApp.ID, mgrSQLite.Database.Remote)
|
||||
|
||||
For Each oBackupItem As clsBackup In oBackupItems
|
||||
'Rename Current Backup File
|
||||
sFileName = BackupFolder & oBackupItem.FileName
|
||||
sNewFileName = Path.GetDirectoryName(sFileName) & Path.DirectorySeparatorChar & Path.GetFileName(sFileName).Replace(sOriginalAppItem, sNewAppItem)
|
||||
If File.Exists(sFileName) And Not sFileName = sNewFileName Then
|
||||
FileSystem.Rename(sFileName, sNewFileName)
|
||||
End If
|
||||
|
||||
oBackupItem.MonitorID = oNewApp.ID
|
||||
oBackupItem.FileName = oBackupItem.FileName.Replace(sOriginalAppItem, sNewAppItem)
|
||||
mgrManifest.DoManifestUpdateByManifestID(oBackupItem, mgrSQLite.Database.Remote)
|
||||
Next
|
||||
|
||||
'Rename folder if there is one
|
||||
sDirectory = BackupFolder & sOriginalAppItem
|
||||
sNewDirectory = sDirectory.Replace(sOriginalAppItem, sNewAppItem)
|
||||
If Directory.Exists(sDirectory) And Not sDirectory = sNewDirectory Then
|
||||
FileSystem.Rename(sDirectory, sNewDirectory)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub LoadData(Optional ByVal bRetainFilter As Boolean = True)
|
||||
Dim oRestoreData As New SortedList
|
||||
@@ -315,7 +374,7 @@ Public Class frmGameManager
|
||||
End If
|
||||
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Process", frmGameManager_ChooseExe, "exe",
|
||||
frmGameManager_Executable, sDefaultFolder, False, False)
|
||||
frmGameManager_Executable, sDefaultFolder, False)
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
txtAppPath.Text = Path.GetDirectoryName(sNewPath)
|
||||
@@ -355,7 +414,7 @@ Public Class frmGameManager
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
txtSavePath.Text = sNewPath
|
||||
txtSavePath.Text = ConvertToRelativePath(txtSavePath.Text, txtAppPath.Text)
|
||||
txtSavePath.Text = HandleSavePath(txtSavePath.Text, txtAppPath.Text)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -373,10 +432,10 @@ Public Class frmGameManager
|
||||
'Unix Handler
|
||||
If Not mgrCommon.IsUnix Then
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "ico",
|
||||
frmGameManager_Icon, sDefaultFolder, False, False)
|
||||
frmGameManager_Icon, sDefaultFolder, False)
|
||||
Else
|
||||
sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "png",
|
||||
"PNG", sDefaultFolder, False, False)
|
||||
"PNG", sDefaultFolder, False)
|
||||
End If
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
@@ -512,15 +571,18 @@ Public Class frmGameManager
|
||||
|
||||
Private Function GetBuilderRoot() As String
|
||||
Dim sRoot As String = String.Empty
|
||||
Dim sPath As String = txtSavePath.Text
|
||||
|
||||
If Path.IsPathRooted(txtSavePath.Text) Then
|
||||
If Directory.Exists(txtSavePath.Text) Then
|
||||
sRoot = txtSavePath.Text
|
||||
If Not Settings.ShowResolvedPaths Then sPath = mgrPath.ReplaceSpecialPaths(txtSavePath.Text)
|
||||
|
||||
If Path.IsPathRooted(sPath) Then
|
||||
If Directory.Exists(sPath) Then
|
||||
sRoot = sPath
|
||||
End If
|
||||
Else
|
||||
If txtAppPath.Text <> String.Empty Then
|
||||
If Directory.Exists(txtAppPath.Text & Path.DirectorySeparatorChar & txtSavePath.Text) Then
|
||||
sRoot = txtAppPath.Text & Path.DirectorySeparatorChar & txtSavePath.Text
|
||||
If Directory.Exists(txtAppPath.Text & Path.DirectorySeparatorChar & sPath) Then
|
||||
sRoot = txtAppPath.Text & Path.DirectorySeparatorChar & sPath
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
@@ -533,10 +595,11 @@ Public Class frmGameManager
|
||||
frm.FormName = sFormText
|
||||
frm.BuilderString = txtBox.Text
|
||||
frm.RootFolder = GetBuilderRoot()
|
||||
|
||||
frm.RecurseSubFolders = chkRecurseSubFolders.Checked
|
||||
frm.ShowDialog()
|
||||
|
||||
txtBox.Text = frm.BuilderString
|
||||
chkRecurseSubFolders.Checked = frm.RecurseSubFolders
|
||||
VerifyCleanFolder()
|
||||
End Sub
|
||||
|
||||
@@ -549,7 +612,7 @@ Public Class frmGameManager
|
||||
If CurrentGame.ProcessPath <> String.Empty Then
|
||||
CurrentBackupItem.RelativeRestorePath = CurrentGame.ProcessPath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath
|
||||
Else
|
||||
sProcess = CurrentGame.TrueProcess
|
||||
sProcess = CurrentGame.ProcessName
|
||||
If mgrCommon.IsProcessNotSearchable(CurrentGame) Then bNoAuto = True
|
||||
sRestorePath = mgrPath.ProcessPathSearch(CurrentBackupItem.Name, sProcess, mgrCommon.FormatString(frmGameManager_ErrorPathNotSet, CurrentBackupItem.Name), bNoAuto)
|
||||
|
||||
@@ -663,25 +726,6 @@ Public Class frmGameManager
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateBackupInfo(ByVal sManifestID As String)
|
||||
Dim sFileName As String
|
||||
|
||||
If sManifestID <> String.Empty Then
|
||||
CurrentBackupItem = mgrManifest.DoManifestGetByManifestID(sManifestID, mgrSQLite.Database.Remote)
|
||||
|
||||
sFileName = BackupFolder & CurrentBackupItem.FileName
|
||||
|
||||
If File.Exists(sFileName) Then
|
||||
lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.FormatDiskSpace(mgrCommon.GetFileSize(sFileName)) & ")"
|
||||
Else
|
||||
lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists
|
||||
End If
|
||||
|
||||
lblRestorePathData.Text = CurrentBackupItem.RestorePath
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub VerifyBackups(ByVal oApp As clsGame)
|
||||
Dim oCurrentBackup As clsBackup
|
||||
Dim oCurrentBackups As List(Of clsBackup)
|
||||
@@ -712,6 +756,23 @@ Public Class frmGameManager
|
||||
Cursor.Current = Cursors.Default
|
||||
End Sub
|
||||
|
||||
Private Sub SetBackupRestorePath(ByVal oApp As clsGame)
|
||||
Dim sttRestorePath As String
|
||||
|
||||
If Not CurrentBackupItem.AbsolutePath And oApp.ProcessPath <> String.Empty Then
|
||||
lblRestorePathData.Text = oApp.ProcessPath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath
|
||||
Else
|
||||
If oSettings.ShowResolvedPaths Then
|
||||
lblRestorePathData.Text = CurrentBackupItem.RestorePath
|
||||
sttRestorePath = CurrentBackupItem.TruePath
|
||||
Else
|
||||
lblRestorePathData.Text = CurrentBackupItem.TruePath
|
||||
sttRestorePath = CurrentBackupItem.RestorePath
|
||||
End If
|
||||
If CurrentBackupItem.AbsolutePath Then ttFullPath.SetToolTip(lblRestorePathData, sttRestorePath)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub GetBackupInfo(ByVal oApp As clsGame)
|
||||
Dim oBackupInfo As clsBackup
|
||||
Dim oCurrentBackup As clsBackup
|
||||
@@ -721,6 +782,7 @@ Public Class frmGameManager
|
||||
Dim bLocalData As Boolean = False
|
||||
Dim bRemoteData As Boolean = False
|
||||
|
||||
|
||||
'cboRemoteBackup
|
||||
cboRemoteBackup.ValueMember = "Key"
|
||||
cboRemoteBackup.DisplayMember = "Value"
|
||||
@@ -748,7 +810,7 @@ Public Class frmGameManager
|
||||
lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists
|
||||
End If
|
||||
|
||||
lblRestorePathData.Text = CurrentBackupItem.RestorePath
|
||||
SetBackupRestorePath(oApp)
|
||||
Else
|
||||
oComboItems.Add(New KeyValuePair(Of String, String)(String.Empty, frmGameManager_None))
|
||||
lblBackupFileData.Text = String.Empty
|
||||
@@ -785,6 +847,24 @@ Public Class frmGameManager
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub UpdateBackupInfo(ByVal sManifestID As String)
|
||||
Dim sFileName As String
|
||||
|
||||
If sManifestID <> String.Empty Then
|
||||
CurrentBackupItem = mgrManifest.DoManifestGetByManifestID(sManifestID, mgrSQLite.Database.Remote)
|
||||
|
||||
sFileName = BackupFolder & CurrentBackupItem.FileName
|
||||
|
||||
If File.Exists(sFileName) Then
|
||||
lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.FormatDiskSpace(mgrCommon.GetFileSize(sFileName)) & ")"
|
||||
Else
|
||||
lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists
|
||||
End If
|
||||
|
||||
SetBackupRestorePath(CurrentGame)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub DeleteAllBackups()
|
||||
Dim oBackupData As List(Of clsBackup)
|
||||
Dim oBackup As clsBackup
|
||||
@@ -835,17 +915,26 @@ Public Class frmGameManager
|
||||
|
||||
Dim oData As KeyValuePair(Of String, String) = lstGames.SelectedItems(0)
|
||||
Dim oApp As clsGame = DirectCast(GameData(oData.Key), clsGame)
|
||||
Dim sttPath As String
|
||||
|
||||
'Core
|
||||
txtID.Text = oApp.ID
|
||||
txtName.Text = oApp.Name
|
||||
txtProcess.Text = oApp.TrueProcess
|
||||
txtProcess.Text = oApp.ProcessName
|
||||
chkRegEx.Checked = oApp.IsRegEx
|
||||
txtParameter.Text = oApp.Parameter
|
||||
txtSavePath.Text = oApp.Path
|
||||
If oSettings.ShowResolvedPaths Then
|
||||
txtSavePath.Text = oApp.Path
|
||||
sttPath = oApp.TruePath
|
||||
Else
|
||||
txtSavePath.Text = oApp.TruePath
|
||||
sttPath = oApp.Path
|
||||
End If
|
||||
If oApp.AbsolutePath Then ttFullPath.SetToolTip(txtSavePath, sttPath)
|
||||
txtFileType.Text = oApp.FileType
|
||||
txtExclude.Text = oApp.ExcludeList
|
||||
chkFolderSave.Checked = oApp.FolderSave
|
||||
chkRecurseSubFolders.Checked = oApp.RecurseSubFolders
|
||||
chkCleanFolder.Checked = oApp.CleanFolder
|
||||
chkTimeStamp.Checked = oApp.AppendTimeStamp
|
||||
nudLimit.Value = oApp.BackupLimit
|
||||
@@ -979,11 +1068,13 @@ Public Class frmGameManager
|
||||
btnBackup.Enabled = False
|
||||
btnMarkAsRestored.Enabled = False
|
||||
btnRestore.Enabled = False
|
||||
btnImportBackup.Enabled = False
|
||||
btnDeleteBackup.Enabled = False
|
||||
btnOpenBackupFile.Enabled = False
|
||||
btnOpenRestorePath.Enabled = False
|
||||
chkEnabled.Checked = True
|
||||
chkMonitorOnly.Checked = False
|
||||
chkRecurseSubFolders.Checked = True
|
||||
btnTags.Enabled = True
|
||||
btnProcesses.Enabled = True
|
||||
lblTags.Text = String.Empty
|
||||
@@ -1009,6 +1100,7 @@ Public Class frmGameManager
|
||||
btnBackup.Enabled = False
|
||||
btnMarkAsRestored.Enabled = False
|
||||
btnRestore.Enabled = False
|
||||
btnImportBackup.Enabled = False
|
||||
btnDeleteBackup.Enabled = False
|
||||
btnOpenBackupFile.Enabled = False
|
||||
btnOpenRestorePath.Enabled = False
|
||||
@@ -1037,6 +1129,7 @@ Public Class frmGameManager
|
||||
lblTags.Visible = True
|
||||
btnImport.Enabled = True
|
||||
btnExport.Enabled = True
|
||||
btnImportBackup.Enabled = True
|
||||
Case eModes.Disabled
|
||||
grpFilter.Enabled = True
|
||||
lstGames.Enabled = True
|
||||
@@ -1138,7 +1231,6 @@ Public Class frmGameManager
|
||||
btnInclude.Enabled = True
|
||||
btnExclude.Enabled = True
|
||||
FolderSaveModeChange()
|
||||
VerifyCleanFolder()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1154,6 +1246,16 @@ Public Class frmGameManager
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyImportBackup()
|
||||
If Not bIsLoading Then
|
||||
If chkMonitorOnly.Checked Then
|
||||
btnImportBackup.Enabled = False
|
||||
Else
|
||||
btnImportBackup.Enabled = True
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub VerifyCleanFolder()
|
||||
If Not bIsLoading Then
|
||||
If (chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty) And Not chkMonitorOnly.Checked Then
|
||||
@@ -1268,6 +1370,7 @@ Public Class frmGameManager
|
||||
oApp.FileType = txtFileType.Text
|
||||
oApp.ExcludeList = txtExclude.Text
|
||||
oApp.FolderSave = chkFolderSave.Checked
|
||||
oApp.RecurseSubFolders = chkRecurseSubFolders.Checked
|
||||
oApp.CleanFolder = chkCleanFolder.Checked
|
||||
oApp.AppendTimeStamp = chkTimeStamp.Checked
|
||||
oApp.BackupLimit = nudLimit.Value
|
||||
@@ -1291,10 +1394,11 @@ Public Class frmGameManager
|
||||
End If
|
||||
Case eModes.Edit
|
||||
If CoreValidatation(oApp, False) Then
|
||||
bSuccess = True
|
||||
CheckManifestandUpdate(oCurrentGame, oApp, oSettings.UseGameID)
|
||||
mgrMonitorList.DoListUpdate(oApp, CurrentGame.ID)
|
||||
eCurrentMode = eModes.View
|
||||
If CheckManifestandUpdate(oCurrentGame, oApp, oSettings.UseGameID) Then
|
||||
bSuccess = True
|
||||
mgrMonitorList.DoListUpdate(oApp, CurrentGame.ID)
|
||||
eCurrentMode = eModes.View
|
||||
End If
|
||||
End If
|
||||
Case eModes.MultiSelect
|
||||
Dim sMonitorIDs As New List(Of String)
|
||||
@@ -1367,6 +1471,7 @@ Public Class frmGameManager
|
||||
FillData()
|
||||
ModeChange()
|
||||
VerifyCleanFolder()
|
||||
VerifyImportBackup()
|
||||
ElseIf lstGames.SelectedItems.Count > 1 Then
|
||||
eCurrentMode = eModes.MultiSelect
|
||||
ModeChange()
|
||||
@@ -1474,6 +1579,48 @@ Public Class frmGameManager
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TriggerSelectedImportBackup()
|
||||
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
Dim oBackup As New mgrBackup
|
||||
Dim sConfirm As String = frmGameManager_ConfirmBackupImport
|
||||
Dim sFile As String
|
||||
Dim sFiles As String()
|
||||
|
||||
'Show one time warning
|
||||
If Not (oSettings.SuppressMessages And mgrSettings.eSuppressMessages.BackupImport) = mgrSettings.eSuppressMessages.BackupImport Then
|
||||
mgrCommon.ShowMessage(frmGameManager_WarningImportBackup, MsgBoxStyle.Information)
|
||||
oSettings.SuppressMessages = oSettings.SetMessageField(oSettings.SuppressMessages, mgrSettings.eSuppressMessages.BackupImport)
|
||||
oSettings.SaveSettings()
|
||||
End If
|
||||
|
||||
ImportBackupList.Clear()
|
||||
|
||||
sFiles = mgrCommon.OpenMultiFileBrowser("GM_ImportBackup", frmGameManager_Choose7zImport, "7z",
|
||||
frmGameManager_7zBackup, sDefaultFolder, True)
|
||||
|
||||
If sFiles.Length > 0 Then
|
||||
For Each sFile In sFiles
|
||||
If Not ImportBackupList.Contains(sFile) Then
|
||||
ImportBackupList.Add(sFile, oCurrentGame)
|
||||
End If
|
||||
Next
|
||||
|
||||
If sFiles.Length > 1 And Not CurrentGame.AppendTimeStamp Then
|
||||
mgrCommon.ShowMessage(frmGameManager_WarningImportBackupSaveMulti, MsgBoxStyle.Exclamation)
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If sFiles.Length = 1 And Not CurrentGame.AppendTimeStamp And mgrManifest.DoManifestCheck(CurrentGame.ID, mgrSQLite.Database.Remote) Then
|
||||
sConfirm = frmGameManager_ConfirmBackupImportOverwriteSingle
|
||||
End If
|
||||
|
||||
If mgrCommon.ShowMessage(sConfirm, oCurrentGame.CroppedName, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
Me.TriggerImportBackup = True
|
||||
Me.Close()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub TriggerSelectedBackup(Optional ByVal bPrompt As Boolean = True)
|
||||
Dim oData As KeyValuePair(Of String, String)
|
||||
Dim sMsg As String = String.Empty
|
||||
@@ -1594,17 +1741,9 @@ Public Class frmGameManager
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub ImportOfficialGameList()
|
||||
Dim sImportURL As String
|
||||
|
||||
If mgrCommon.IsUnix Then
|
||||
sImportURL = App_URLImportLinux
|
||||
Else
|
||||
sImportURL = App_URLImport
|
||||
End If
|
||||
|
||||
Private Sub ImportOfficialGameList(ByVal sImportUrl As String, ByVal bWinConfigsInLinux As Boolean)
|
||||
If mgrCommon.ShowMessage(frmGameManager_ConfirmOfficialImport, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
If mgrMonitorList.DoImport(sImportURL, True, Settings) Then
|
||||
If mgrMonitorList.DoImport(sImportUrl, True, Settings,, bWinConfigsInLinux) Then
|
||||
mgrMonitorList.SyncMonitorLists(Settings)
|
||||
LoadData()
|
||||
LoadBackupData()
|
||||
@@ -1664,6 +1803,8 @@ Public Class frmGameManager
|
||||
btnDelete.Text = frmGameManager_btnDelete
|
||||
btnAdd.Text = frmGameManager_btnAdd
|
||||
cmsOfficial.Text = frmGameManager_cmsOfficial
|
||||
cmsOfficialLinux.Text = frmGameManager_cmsOfficialLinux
|
||||
cmsOfficialWindows.Text = frmGameManager_cmsOfficialWindows
|
||||
cmsFile.Text = frmGameManager_cmsFile
|
||||
lblQuickFilter.Text = frmGameManager_lblQuickFilter
|
||||
lblLimit.Text = frmGameManager_lblLimit
|
||||
@@ -1672,11 +1813,23 @@ Public Class frmGameManager
|
||||
lblComments.Text = frmGameManager_lblComments
|
||||
chkRegEx.Text = frmGameManager_chkRegEx
|
||||
btnGameID.Text = frmGameManager_btnGameID
|
||||
btnImportBackup.Text = frmGameManager_btnImportBackup
|
||||
btnProcesses.Text = frmGameManager_btnProcesses
|
||||
|
||||
'Init Official Import Menu
|
||||
If mgrCommon.IsUnix Then
|
||||
cmsOfficial.Text = cmsOfficial.Text.TrimEnd(".")
|
||||
RemoveHandler cmsOfficial.Click, AddressOf cmsOfficialWindows_Click
|
||||
Else
|
||||
cmsOfficialLinux.Visible = False
|
||||
cmsOfficialWindows.Visible = False
|
||||
End If
|
||||
|
||||
'Init Filter Timer
|
||||
tmFilterTimer = New Timer()
|
||||
tmFilterTimer.Interval = 1000
|
||||
tmFilterTimer.Enabled = False
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub frmGameManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
@@ -1693,7 +1846,7 @@ Public Class frmGameManager
|
||||
|
||||
LoadBackupData()
|
||||
|
||||
'Event will take care of initial load
|
||||
'Event will take care of initial load (on Windows)
|
||||
If PendingRestores Then
|
||||
optPendingRestores.Checked = True
|
||||
Else
|
||||
@@ -1705,8 +1858,11 @@ Public Class frmGameManager
|
||||
AssignDirtyHandlers(grpStats.Controls)
|
||||
AssignDirtyHandlersMisc()
|
||||
|
||||
LoadData(False)
|
||||
ModeChange()
|
||||
'Mono doesn't fire events in the same way as .NET, so we'll to do this to get an initial load on Linux and prevent multiple loads in Windows.
|
||||
If mgrCommon.IsUnix Then
|
||||
LoadData(False)
|
||||
ModeChange()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub lstGames_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstGames.SelectedIndexChanged
|
||||
@@ -1825,6 +1981,10 @@ Public Class frmGameManager
|
||||
UpdateBuilderButtonLabel(txtExclude.Text, frmGameManager_ExcludeShortcut, btnExclude, (sExclude <> txtExclude.Text))
|
||||
End Sub
|
||||
|
||||
Private Sub btnImportBackup_Click(sender As Object, e As EventArgs) Handles btnImportBackup.Click
|
||||
TriggerSelectedImportBackup()
|
||||
End Sub
|
||||
|
||||
Private Sub chkFolderSave_CheckedChanged(sender As Object, e As EventArgs) Handles chkFolderSave.CheckedChanged
|
||||
FolderSaveModeChange()
|
||||
End Sub
|
||||
@@ -1847,8 +2007,23 @@ Public Class frmGameManager
|
||||
cmsImport.Show(btnImport, New Drawing.Point(btnImport.Size.Width - Math.Floor(btnImport.Size.Width * 0.1), btnImport.Size.Height - Math.Floor(btnImport.Size.Height * 0.5)), ToolStripDropDownDirection.AboveRight)
|
||||
End Sub
|
||||
|
||||
Private Sub cmsOfficial_Click(sender As Object, e As EventArgs) Handles cmsOfficial.Click
|
||||
ImportOfficialGameList()
|
||||
Private Sub cmsOfficialWindows_Click(sender As Object, e As EventArgs) Handles cmsOfficialWindows.Click, cmsOfficial.Click
|
||||
Dim bWinConfigsinLinux As Boolean = False
|
||||
'Show one time warning about Windows configs in Linux
|
||||
If mgrCommon.IsUnix Then
|
||||
If Not (oSettings.SuppressMessages And mgrSettings.eSuppressMessages.WinConfigsInLinux) = mgrSettings.eSuppressMessages.WinConfigsInLinux Then
|
||||
mgrCommon.ShowMessage(frmGameManager_WarningWinConfigsInLinux, MsgBoxStyle.Information)
|
||||
oSettings.SuppressMessages = oSettings.SetMessageField(oSettings.SuppressMessages, mgrSettings.eSuppressMessages.WinConfigsInLinux)
|
||||
oSettings.SaveSettings()
|
||||
End If
|
||||
bWinConfigsinLinux = True
|
||||
End If
|
||||
|
||||
ImportOfficialGameList(App_URLImport, bWinConfigsinLinux)
|
||||
End Sub
|
||||
|
||||
Private Sub cmsOfficialLinux_Click(sender As Object, e As EventArgs) Handles cmsOfficialLinux.Click
|
||||
ImportOfficialGameList(App_URLImportLinux, False)
|
||||
End Sub
|
||||
|
||||
Private Sub cmsFile_Click(sender As Object, e As EventArgs) Handles cmsFile.Click
|
||||
@@ -1878,6 +2053,7 @@ Public Class frmGameManager
|
||||
End Sub
|
||||
|
||||
Private Sub txtSavePath_TextChanged(sender As Object, e As EventArgs) Handles txtSavePath.TextChanged
|
||||
ttFullPath.RemoveAll()
|
||||
VerifyCleanFolder()
|
||||
End Sub
|
||||
|
||||
@@ -1890,11 +2066,15 @@ Public Class frmGameManager
|
||||
End Sub
|
||||
|
||||
Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
|
||||
'Load Last Played Game
|
||||
If Not LastPlayedGame Is Nothing Then
|
||||
lstGames.SelectedItem = New KeyValuePair(Of String, String)(LastPlayedGame.ID, LastPlayedGame.Name)
|
||||
End If
|
||||
|
||||
txtQuickFilter.Focus()
|
||||
End Sub
|
||||
|
||||
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
|
||||
MonitorOnlyModeChange()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
Generated
+28
-14
@@ -37,15 +37,16 @@ Partial Class frmIncludeExclude
|
||||
Me.cmsAdd = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.btnRemove = New System.Windows.Forms.Button()
|
||||
Me.btnAdd = New System.Windows.Forms.Button()
|
||||
Me.grpFileOptions = New System.Windows.Forms.GroupBox()
|
||||
Me.grpOptions = New System.Windows.Forms.GroupBox()
|
||||
Me.optFileTypes = New System.Windows.Forms.RadioButton()
|
||||
Me.optIndividualFiles = New System.Windows.Forms.RadioButton()
|
||||
Me.lblItems = New System.Windows.Forms.Label()
|
||||
Me.btnRawEdit = New System.Windows.Forms.Button()
|
||||
Me.lblSaveFolder = New System.Windows.Forms.Label()
|
||||
Me.ttWarning = New System.Windows.Forms.ToolTip(Me.components)
|
||||
Me.chkRecurseSubFolders = New System.Windows.Forms.CheckBox()
|
||||
Me.cmsItems.SuspendLayout()
|
||||
Me.grpFileOptions.SuspendLayout()
|
||||
Me.grpOptions.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'treFiles
|
||||
@@ -157,16 +158,17 @@ Partial Class frmIncludeExclude
|
||||
Me.btnAdd.Text = ">"
|
||||
Me.btnAdd.UseVisualStyleBackColor = True
|
||||
'
|
||||
'grpFileOptions
|
||||
'grpOptions
|
||||
'
|
||||
Me.grpFileOptions.Controls.Add(Me.optFileTypes)
|
||||
Me.grpFileOptions.Controls.Add(Me.optIndividualFiles)
|
||||
Me.grpFileOptions.Location = New System.Drawing.Point(12, 403)
|
||||
Me.grpFileOptions.Name = "grpFileOptions"
|
||||
Me.grpFileOptions.Size = New System.Drawing.Size(194, 46)
|
||||
Me.grpFileOptions.TabIndex = 2
|
||||
Me.grpFileOptions.TabStop = False
|
||||
Me.grpFileOptions.Text = "File Options"
|
||||
Me.grpOptions.Controls.Add(Me.chkRecurseSubFolders)
|
||||
Me.grpOptions.Controls.Add(Me.optFileTypes)
|
||||
Me.grpOptions.Controls.Add(Me.optIndividualFiles)
|
||||
Me.grpOptions.Location = New System.Drawing.Point(12, 403)
|
||||
Me.grpOptions.Name = "grpOptions"
|
||||
Me.grpOptions.Size = New System.Drawing.Size(317, 46)
|
||||
Me.grpOptions.TabIndex = 2
|
||||
Me.grpOptions.TabStop = False
|
||||
Me.grpOptions.Text = "Options"
|
||||
'
|
||||
'optFileTypes
|
||||
'
|
||||
@@ -222,6 +224,16 @@ Partial Class frmIncludeExclude
|
||||
Me.ttWarning.ReshowDelay = 50
|
||||
Me.ttWarning.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Warning
|
||||
'
|
||||
'chkRecurseSubFolders
|
||||
'
|
||||
Me.chkRecurseSubFolders.AutoSize = True
|
||||
Me.chkRecurseSubFolders.Location = New System.Drawing.Point(185, 20)
|
||||
Me.chkRecurseSubFolders.Name = "chkRecurseSubFolders"
|
||||
Me.chkRecurseSubFolders.Size = New System.Drawing.Size(120, 17)
|
||||
Me.chkRecurseSubFolders.TabIndex = 2
|
||||
Me.chkRecurseSubFolders.Text = "Recurse sub-folders"
|
||||
Me.chkRecurseSubFolders.UseVisualStyleBackColor = True
|
||||
'
|
||||
'frmIncludeExclude
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -230,7 +242,7 @@ Partial Class frmIncludeExclude
|
||||
Me.Controls.Add(Me.lblSaveFolder)
|
||||
Me.Controls.Add(Me.btnRawEdit)
|
||||
Me.Controls.Add(Me.lblItems)
|
||||
Me.Controls.Add(Me.grpFileOptions)
|
||||
Me.Controls.Add(Me.grpOptions)
|
||||
Me.Controls.Add(Me.btnRemove)
|
||||
Me.Controls.Add(Me.btnAdd)
|
||||
Me.Controls.Add(Me.lstBuilder)
|
||||
@@ -247,7 +259,8 @@ Partial Class frmIncludeExclude
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "Include / Exclude Builder"
|
||||
Me.cmsItems.ResumeLayout(False)
|
||||
Me.grpFileOptions.ResumeLayout(False)
|
||||
Me.grpOptions.ResumeLayout(False)
|
||||
Me.grpOptions.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
Me.PerformLayout()
|
||||
|
||||
@@ -261,7 +274,7 @@ Partial Class frmIncludeExclude
|
||||
Friend WithEvents lstBuilder As System.Windows.Forms.ListView
|
||||
Friend WithEvents btnRemove As System.Windows.Forms.Button
|
||||
Friend WithEvents btnAdd As System.Windows.Forms.Button
|
||||
Friend WithEvents grpFileOptions As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents grpOptions As System.Windows.Forms.GroupBox
|
||||
Friend WithEvents optFileTypes As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents optIndividualFiles As System.Windows.Forms.RadioButton
|
||||
Friend WithEvents lblItems As System.Windows.Forms.Label
|
||||
@@ -272,4 +285,5 @@ Partial Class frmIncludeExclude
|
||||
Friend WithEvents btnRawEdit As Button
|
||||
Friend WithEvents lblSaveFolder As Label
|
||||
Friend WithEvents ttWarning As ToolTip
|
||||
Friend WithEvents chkRecurseSubFolders As CheckBox
|
||||
End Class
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6
|
||||
CQAAAk1TRnQBSQFMAgEBAwEAAbgBAAG4AQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CQAAAk1TRnQBSQFMAgEBAwEAAcABAAHAAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
||||
@@ -6,6 +6,7 @@ Public Class frmIncludeExclude
|
||||
Dim sFormName As String = String.Empty
|
||||
Dim sRootFolder As String = String.Empty
|
||||
Dim sBuilderString As String
|
||||
Dim bRecurseSubFolders As Boolean
|
||||
|
||||
Public Property BuilderString As String
|
||||
Get
|
||||
@@ -34,6 +35,15 @@ Public Class frmIncludeExclude
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Public Property RecurseSubFolders As Boolean
|
||||
Get
|
||||
Return bRecurseSubFolders
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
bRecurseSubFolders = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub BuildBranch(ByVal sDirectory As String, ByVal oNode As TreeNode)
|
||||
Dim sFolders As String()
|
||||
Dim sFiles As String()
|
||||
@@ -239,9 +249,10 @@ Public Class frmIncludeExclude
|
||||
lblSaveFolder.Text = frmIncludeExclude_lblSaveFolder
|
||||
btnRawEdit.Text = frmIncludeExclude_btnRawEdit
|
||||
lblItems.Text = mgrCommon.FormatString(frmIncludeExclude_lblItems, FormName)
|
||||
grpFileOptions.Text = mgrCommon.FormatString(frmIncludeExclude_grpFileOptions, FormName)
|
||||
grpOptions.Text = mgrCommon.FormatString(frmIncludeExclude_grpOptions, FormName)
|
||||
optFileTypes.Text = frmIncludeExclude_optFileTypes
|
||||
optIndividualFiles.Text = frmIncludeExclude_optIndividualFiles
|
||||
chkRecurseSubFolders.Text = frmIncludeExclude_chkRecurseSubFolders
|
||||
btnRemove.Text = frmIncludeExclude_btnRemove
|
||||
btnAdd.Text = frmIncludeExclude_btnAdd
|
||||
btnBrowse.Text = frmIncludeExclude_btnBrowse
|
||||
@@ -254,6 +265,7 @@ Public Class frmIncludeExclude
|
||||
'Set Defaults
|
||||
txtRootFolder.Text = RootFolder
|
||||
optFileTypes.Checked = True
|
||||
chkRecurseSubFolders.Checked = bRecurseSubFolders
|
||||
If BuilderString <> String.Empty Then ParseBuilderString(BuilderString)
|
||||
If txtRootFolder.Text <> String.Empty Then BuildTrunk()
|
||||
End Sub
|
||||
@@ -285,6 +297,7 @@ Public Class frmIncludeExclude
|
||||
|
||||
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
|
||||
BuilderString = CreateNewBuilderString()
|
||||
RecurseSubFolders = chkRecurseSubFolders.Checked
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
|
||||
+49
-18
@@ -45,6 +45,7 @@ Public Class frmMain
|
||||
|
||||
'Developer Debug Flags
|
||||
Private bProcessDebugMode As Boolean = False
|
||||
Private bMemoryDebugMode As Boolean = False
|
||||
|
||||
WithEvents oFileWatcher As New FileSystemWatcher
|
||||
|
||||
@@ -228,7 +229,7 @@ Public Class frmMain
|
||||
If oGame.AbsolutePath = False Then
|
||||
If oGame.ProcessPath = String.Empty Then
|
||||
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
|
||||
oGame.ProcessPath = mgrPath.ProcessPathSearch(oGame.Name, oGame.TrueProcess, mgrCommon.FormatString(frmMain_ErrorRelativePath, oGame.Name), bNoAuto)
|
||||
oGame.ProcessPath = mgrPath.ProcessPathSearch(oGame.Name, oGame.ProcessName, mgrCommon.FormatString(frmMain_ErrorRelativePath, oGame.Name), bNoAuto)
|
||||
End If
|
||||
|
||||
If oGame.ProcessPath <> String.Empty Then
|
||||
@@ -258,6 +259,12 @@ Public Class frmMain
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub RunImportBackup(ByVal oImportBackupList As Hashtable)
|
||||
PauseScan()
|
||||
oBackup.ImportBackupFiles(oImportBackupList)
|
||||
ResumeScan()
|
||||
End Sub
|
||||
|
||||
Private Function DoMultiGameCheck() As Boolean
|
||||
Dim oResult As DialogResult
|
||||
|
||||
@@ -266,14 +273,9 @@ Public Class frmMain
|
||||
frm.Process = oProcess
|
||||
oResult = frm.ShowDialog()
|
||||
If oResult = DialogResult.OK Then
|
||||
Dim sProcessPath As String
|
||||
'Reload settings
|
||||
LoadGameSettings()
|
||||
'Retain the process path from old object
|
||||
sProcessPath = oProcess.GameInfo.ProcessPath
|
||||
oProcess.GameInfo = frm.Game
|
||||
'Set the process path into the new object
|
||||
oProcess.GameInfo.ProcessPath = sProcessPath
|
||||
'A game was set, return and continue
|
||||
Return True
|
||||
Else
|
||||
@@ -841,6 +843,11 @@ Public Class frmMain
|
||||
Case "process"
|
||||
bProcessDebugMode = bDebugEnable
|
||||
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
|
||||
Case "memory"
|
||||
bMemoryDebugMode = bDebugEnable
|
||||
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
|
||||
Case Else
|
||||
mgrCommon.ShowMessage(frmMain_ErrorInvalidMode, New String() {sCommand(1), sCommand(0)}, MsgBoxStyle.Exclamation)
|
||||
End Select
|
||||
|
||||
Case Else
|
||||
@@ -881,6 +888,7 @@ Public Class frmMain
|
||||
PauseScan()
|
||||
frm.Settings = oSettings
|
||||
frm.PendingRestores = bPendingRestores
|
||||
frm.LastPlayedGame = oProcess.GameInfo
|
||||
frm.ShowDialog()
|
||||
LoadGameSettings()
|
||||
ResumeScan()
|
||||
@@ -894,6 +902,11 @@ Public Class frmMain
|
||||
If frm.TriggerRestore Then
|
||||
RunRestore(frm.RestoreList)
|
||||
End If
|
||||
|
||||
'Handle import backup trigger
|
||||
If frm.TriggerImportBackup Then
|
||||
RunImportBackup(frm.ImportBackupList)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub OpenSettings()
|
||||
@@ -940,7 +953,7 @@ Public Class frmMain
|
||||
Dim frm As New frmVariableManager
|
||||
PauseScan()
|
||||
frm.ShowDialog()
|
||||
mgrPath.CustomVariablesReload()
|
||||
mgrPath.LoadCustomVariables()
|
||||
mgrMonitorList.SyncMonitorLists(oSettings)
|
||||
ResumeScan()
|
||||
End Sub
|
||||
@@ -1689,15 +1702,6 @@ Public Class frmMain
|
||||
|
||||
End Function
|
||||
|
||||
Private Sub CheckForSavedDuplicate()
|
||||
For Each o As clsGame In oProcess.DuplicateList
|
||||
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower Then
|
||||
oProcess.GameInfo = o
|
||||
oProcess.Duplicate = False
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Function CheckForSavedPath() As Boolean
|
||||
If oProcess.GameInfo.ProcessPath <> String.Empty Then
|
||||
Return True
|
||||
@@ -1894,11 +1898,12 @@ Public Class frmMain
|
||||
|
||||
Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick
|
||||
Dim bNeedsPath As Boolean = False
|
||||
Dim bWineProcess As Boolean = False
|
||||
Dim bContinue As Boolean = True
|
||||
Dim iErrorCode As Integer = 0
|
||||
Dim sErrorMessage As String = String.Empty
|
||||
|
||||
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then
|
||||
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, bWineProcess, iErrorCode, bProcessDebugMode) Then
|
||||
PauseScan(True)
|
||||
|
||||
If bNeedsPath Then
|
||||
@@ -1928,8 +1933,30 @@ Public Class frmMain
|
||||
End If
|
||||
End If
|
||||
|
||||
If bWineProcess Then
|
||||
'Attempt a path conversion if the game configuration is using an absolute windows path that we can convert
|
||||
If mgrVariables.CheckForReservedVariables(oProcess.GameInfo.TruePath) Then
|
||||
Dim sWinePrefix As String = mgrPath.GetWinePrefix(oProcess.FoundProcess)
|
||||
Dim sWineSavePath As String
|
||||
If Not sWinePrefix = String.Empty Then
|
||||
UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, New String() {oProcess.GameInfo.Name, sWinePrefix}), False)
|
||||
sWineSavePath = mgrPath.GetWineSavePath(sWinePrefix, oProcess.GameInfo.TruePath)
|
||||
If Not sWineSavePath = oProcess.GameInfo.TruePath Then
|
||||
oProcess.GameInfo.TruePath = sWineSavePath
|
||||
oProcess.GameInfo.AbsolutePath = True
|
||||
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oProcess.GameInfo.Name, sWineSavePath}), False)
|
||||
Else
|
||||
bContinue = False
|
||||
End If
|
||||
Else
|
||||
bContinue = False
|
||||
End If
|
||||
End If
|
||||
'This does required mods to include/exclude data and relative paths (if required)
|
||||
mgrPath.ModWinePathData(oProcess.GameInfo)
|
||||
End If
|
||||
|
||||
If bContinue = True Then
|
||||
CheckForSavedDuplicate()
|
||||
If oProcess.Duplicate Then
|
||||
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips)
|
||||
UpdateStatus(frmMain_MultipleGamesDetected)
|
||||
@@ -1950,6 +1977,10 @@ Public Class frmMain
|
||||
StopScan()
|
||||
End If
|
||||
End If
|
||||
|
||||
If bMemoryDebugMode Then
|
||||
UpdateLog(mgrCommon.FormatString(frmMain_DebugMemoryAllocation, Math.Round(GC.GetTotalMemory(False) / 1000000, 2)), False, ToolTipIcon.Info, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub bwMonitor_DoWork(sender As System.Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwMonitor.DoWork
|
||||
|
||||
@@ -56,7 +56,7 @@ Public Class frmProcessManager
|
||||
End If
|
||||
|
||||
sNewPath = mgrCommon.OpenFileBrowser("PM_Process", frmProcessManager_ChooseProcess, "exe",
|
||||
frmProcessManager_Executable, sDefaultFolder, False, True)
|
||||
frmProcessManager_Executable, sDefaultFolder, True)
|
||||
|
||||
If sNewPath <> String.Empty Then
|
||||
txtPath.Text = sNewPath
|
||||
|
||||
Generated
+17
-4
@@ -64,6 +64,7 @@ Partial Class frmSettings
|
||||
Me.grpLogOptions = New System.Windows.Forms.GroupBox()
|
||||
Me.chkDisableSyncMessages = New System.Windows.Forms.CheckBox()
|
||||
Me.grpGameData = New System.Windows.Forms.GroupBox()
|
||||
Me.chkShowResolvedPaths = New System.Windows.Forms.CheckBox()
|
||||
Me.chkSessionTracking = New System.Windows.Forms.CheckBox()
|
||||
Me.lstSettings = New System.Windows.Forms.ListBox()
|
||||
Me.btnResetMessages = New System.Windows.Forms.Button()
|
||||
@@ -102,7 +103,7 @@ Partial Class frmSettings
|
||||
'
|
||||
'btnOptionalFields
|
||||
'
|
||||
Me.btnOptionalFields.Location = New System.Drawing.Point(6, 65)
|
||||
Me.btnOptionalFields.Location = New System.Drawing.Point(6, 88)
|
||||
Me.btnOptionalFields.Name = "btnOptionalFields"
|
||||
Me.btnOptionalFields.Size = New System.Drawing.Size(216, 23)
|
||||
Me.btnOptionalFields.TabIndex = 3
|
||||
@@ -443,7 +444,7 @@ Partial Class frmSettings
|
||||
Me.grpGameMonitoringOptions.Controls.Add(Me.lblMinutes)
|
||||
Me.grpGameMonitoringOptions.Controls.Add(Me.chkShowDetectionTips)
|
||||
Me.grpGameMonitoringOptions.Controls.Add(Me.nudSuppressBackupThreshold)
|
||||
Me.grpGameMonitoringOptions.Location = New System.Drawing.Point(6, 115)
|
||||
Me.grpGameMonitoringOptions.Location = New System.Drawing.Point(6, 141)
|
||||
Me.grpGameMonitoringOptions.Name = "grpGameMonitoringOptions"
|
||||
Me.grpGameMonitoringOptions.Size = New System.Drawing.Size(354, 65)
|
||||
Me.grpGameMonitoringOptions.TabIndex = 1
|
||||
@@ -481,7 +482,7 @@ Partial Class frmSettings
|
||||
'
|
||||
Me.grpLogOptions.Controls.Add(Me.chkDisableSyncMessages)
|
||||
Me.grpLogOptions.Controls.Add(Me.chkAutoSaveLog)
|
||||
Me.grpLogOptions.Location = New System.Drawing.Point(6, 186)
|
||||
Me.grpLogOptions.Location = New System.Drawing.Point(6, 212)
|
||||
Me.grpLogOptions.Name = "grpLogOptions"
|
||||
Me.grpLogOptions.Size = New System.Drawing.Size(354, 65)
|
||||
Me.grpLogOptions.TabIndex = 2
|
||||
@@ -500,16 +501,27 @@ Partial Class frmSettings
|
||||
'
|
||||
'grpGameData
|
||||
'
|
||||
Me.grpGameData.Controls.Add(Me.chkShowResolvedPaths)
|
||||
Me.grpGameData.Controls.Add(Me.chkSessionTracking)
|
||||
Me.grpGameData.Controls.Add(Me.chkTimeTracking)
|
||||
Me.grpGameData.Controls.Add(Me.btnOptionalFields)
|
||||
Me.grpGameData.Location = New System.Drawing.Point(6, 12)
|
||||
Me.grpGameData.Name = "grpGameData"
|
||||
Me.grpGameData.Size = New System.Drawing.Size(354, 97)
|
||||
Me.grpGameData.Size = New System.Drawing.Size(354, 123)
|
||||
Me.grpGameData.TabIndex = 0
|
||||
Me.grpGameData.TabStop = False
|
||||
Me.grpGameData.Text = "Game Data Options"
|
||||
'
|
||||
'chkShowResolvedPaths
|
||||
'
|
||||
Me.chkShowResolvedPaths.AutoSize = True
|
||||
Me.chkShowResolvedPaths.Location = New System.Drawing.Point(6, 65)
|
||||
Me.chkShowResolvedPaths.Name = "chkShowResolvedPaths"
|
||||
Me.chkShowResolvedPaths.Size = New System.Drawing.Size(238, 17)
|
||||
Me.chkShowResolvedPaths.TabIndex = 2
|
||||
Me.chkShowResolvedPaths.Text = "Show resolved save paths in Game Manager"
|
||||
Me.chkShowResolvedPaths.UseVisualStyleBackColor = True
|
||||
'
|
||||
'chkSessionTracking
|
||||
'
|
||||
Me.chkSessionTracking.AutoSize = True
|
||||
@@ -698,4 +710,5 @@ Partial Class frmSettings
|
||||
Friend WithEvents chkStartToTray As CheckBox
|
||||
Friend WithEvents chkMonitorOnStartup As CheckBox
|
||||
Friend WithEvents grpGameMonitoringOptions As GroupBox
|
||||
Friend WithEvents chkShowResolvedPaths As CheckBox
|
||||
End Class
|
||||
|
||||
@@ -60,6 +60,7 @@ Public Class frmSettings
|
||||
oSettings.AutoMark = chkAutoMark.Checked
|
||||
oSettings.TimeTracking = chkTimeTracking.Checked
|
||||
oSettings.SessionTracking = chkSessionTracking.Checked
|
||||
oSettings.ShowResolvedPaths = chkShowResolvedPaths.Checked
|
||||
oSettings.SuppressBackup = chkSuppressBackup.Checked
|
||||
oSettings.SuppressBackupThreshold = nudSuppressBackupThreshold.Value
|
||||
oSettings.CompressionLevel = cboCompression.SelectedValue
|
||||
@@ -189,6 +190,7 @@ Public Class frmSettings
|
||||
txtBackupFolder.Text = oSettings.BackupFolder
|
||||
chkTimeTracking.Checked = oSettings.TimeTracking
|
||||
chkSessionTracking.Checked = oSettings.SessionTracking
|
||||
chkShowResolvedPaths.Checked = oSettings.ShowResolvedPaths
|
||||
chkSuppressBackup.Checked = oSettings.SuppressBackup
|
||||
nudSuppressBackupThreshold.Value = oSettings.SuppressBackupThreshold
|
||||
nudSuppressBackupThreshold.Enabled = chkSuppressBackup.Checked
|
||||
@@ -322,6 +324,7 @@ Public Class frmSettings
|
||||
grpLogOptions.Text = frmSettings_grpLogOptions
|
||||
chkDisableSyncMessages.Text = frmSettings_chkDisableSyncMessages
|
||||
grpGameMonitoringOptions.Text = frmSettings_grpGameMonitoringOptions
|
||||
chkShowResolvedPaths.Text = frmSettings_chkShowResolvedPaths
|
||||
|
||||
'Unix Handler
|
||||
If mgrCommon.IsUnix Then
|
||||
|
||||
@@ -289,6 +289,12 @@ Public Class frmVariableManager
|
||||
Return False
|
||||
End If
|
||||
|
||||
If mgrVariables.GetReservedVariables.Contains(txtName.Text.ToUpper) Then
|
||||
mgrCommon.ShowMessage(frmVariableManager_ErrorVariableReserved, txtName.Text, MsgBoxStyle.Exclamation)
|
||||
txtName.Focus()
|
||||
Return False
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
|
||||
+106
-18
@@ -42,7 +42,7 @@ Public Class mgrBackup
|
||||
'Create manifest item
|
||||
oItem.MonitorID = oGameInfo.ID
|
||||
'Keep the path relative to the manifest location
|
||||
oItem.FileName = sBackupFile.Replace(Path.GetDirectoryName(mgrPath.RemoteDatabaseLocation) & Path.DirectorySeparatorChar, "")
|
||||
oItem.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
|
||||
oItem.DateUpdated = dTimeStamp
|
||||
oItem.UpdatedBy = My.Computer.Name
|
||||
oItem.CheckSum = sCheckSum
|
||||
@@ -66,7 +66,7 @@ Public Class mgrBackup
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Sub BuildFileList(ByVal sBackupPath As String, ByVal sList As String, ByVal sPath As String)
|
||||
Private Sub BuildFileList(ByVal sList As String, ByVal sPath As String)
|
||||
Dim oStream As StreamWriter
|
||||
|
||||
Try
|
||||
@@ -75,7 +75,7 @@ Public Class mgrBackup
|
||||
Using oStream
|
||||
If sList <> String.Empty Then
|
||||
For Each sTypeItem As String In sList.Split(":")
|
||||
oStream.WriteLine("""" & sBackupPath & Path.DirectorySeparatorChar & sTypeItem & """")
|
||||
oStream.WriteLine("""" & sTypeItem & """")
|
||||
Next
|
||||
End If
|
||||
oStream.Flush()
|
||||
@@ -118,7 +118,8 @@ Public Class mgrBackup
|
||||
Dim sSavePath As String
|
||||
Dim sOverwriteMessage As String
|
||||
Dim lAvailableSpace As Long
|
||||
Dim lFolderSize As Long
|
||||
Dim lFolderSize As Long = 0
|
||||
Dim sDeepFolder As String
|
||||
|
||||
If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & ".7z"
|
||||
@@ -128,7 +129,18 @@ Public Class mgrBackup
|
||||
|
||||
'Calculate space
|
||||
lAvailableSpace = mgrCommon.GetAvailableDiskSpace(oSettings.BackupFolder)
|
||||
lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray)
|
||||
'If any includes are using a deep path and we aren't using recursion, we need to go directly to folders to do file size calculations or they will be missed.
|
||||
If Not oGame.RecurseSubFolders Then
|
||||
For Each s As String In oGame.IncludeArray
|
||||
If s.Contains(Path.DirectorySeparatorChar) Then
|
||||
sDeepFolder = Path.GetDirectoryName(sSavePath & Path.DirectorySeparatorChar & s)
|
||||
If Directory.Exists(sDeepFolder) Then
|
||||
lFolderSize += mgrCommon.GetFolderSize(sDeepFolder, oGame.IncludeArray, oGame.ExcludeArray, oGame.RecurseSubFolders)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
lFolderSize += mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray, oGame.RecurseSubFolders)
|
||||
|
||||
'Show Available Space
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrCommon_AvailableDiskSpace, mgrCommon.FormatDiskSpace(lAvailableSpace)), False, ToolTipIcon.Info, True)
|
||||
@@ -196,6 +208,83 @@ Public Class mgrBackup
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Function BuildFileTimeStamp(ByVal dDate As Date) As String
|
||||
Return " " & dDate.Month & "-" & dDate.Day & "-" & dDate.Year & "-" & dDate.Hour & "-" & dDate.Minute & "-" & dDate.Second
|
||||
End Function
|
||||
|
||||
Private Function HandleSubFolder(ByVal oGame As clsGame, ByVal sPath As String) As Boolean
|
||||
Try
|
||||
If Not Directory.Exists(sPath) Then
|
||||
Directory.CreateDirectory(sPath)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Sub ImportBackupFiles(ByVal hshImportList As Hashtable)
|
||||
Dim oGame As clsGame
|
||||
Dim bOverwriteCurrent As Boolean = False
|
||||
Dim bContinue As Boolean = True
|
||||
Dim sFileToImport As String
|
||||
Dim sBackupFile As String
|
||||
Dim oBackup As clsBackup
|
||||
|
||||
For Each de As DictionaryEntry In hshImportList
|
||||
sFileToImport = CStr(de.Key)
|
||||
oGame = DirectCast(de.Value, clsGame)
|
||||
|
||||
'Enter overwite mode if we are importing a single backup and "Save Multiple Backups" is not enabled.
|
||||
If hshImportList.Count = 1 And Not oGame.AppendTimeStamp Then bOverwriteCurrent = True
|
||||
|
||||
If File.Exists(sFileToImport) Then
|
||||
sBackupFile = oSettings.BackupFolder
|
||||
|
||||
If oSettings.CreateSubFolder Then
|
||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
||||
bContinue = HandleSubFolder(oGame, sBackupFile)
|
||||
End If
|
||||
|
||||
If bContinue Then
|
||||
oBackup = New clsBackup
|
||||
oBackup.MonitorID = oGame.ID
|
||||
oBackup.DateUpdated = File.GetLastWriteTime(sFileToImport)
|
||||
oBackup.UpdatedBy = mgrBackup_ImportedFile
|
||||
If bOverwriteCurrent Then
|
||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & ".7z"
|
||||
Else
|
||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & BuildFileTimeStamp(oBackup.DateUpdated) & ".7z"
|
||||
End If
|
||||
|
||||
oBackup.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
|
||||
|
||||
If bOverwriteCurrent Then
|
||||
If mgrCommon.CopyFile(sFileToImport, sBackupFile, True) Then
|
||||
oBackup.CheckSum = mgrHash.Generate_SHA256_Hash(sBackupFile)
|
||||
If Not mgrManifest.DoUpdateLatestManifest(oBackup, mgrSQLite.Database.Remote) Then
|
||||
mgrManifest.DoManifestAdd(oBackup, mgrSQLite.Database.Remote)
|
||||
End If
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ImportSuccess, New String() {sFileToImport, oGame.Name}), False, ToolTipIcon.Info, True)
|
||||
Else
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorImportBackupCopy, sFileToImport), False, ToolTipIcon.Error, True)
|
||||
End If
|
||||
Else
|
||||
If mgrCommon.CopyFile(sFileToImport, sBackupFile, False) Then
|
||||
oBackup.CheckSum = mgrHash.Generate_SHA256_Hash(sBackupFile)
|
||||
mgrManifest.DoManifestAdd(oBackup, mgrSQLite.Database.Remote)
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ImportSuccess, New String() {sFileToImport, oGame.Name}), False, ToolTipIcon.Info, True)
|
||||
Else
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorImportBackupCopy, sFileToImport), False, ToolTipIcon.Error, True)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
|
||||
Dim oGame As clsGame
|
||||
Dim bDoBackup As Boolean
|
||||
@@ -206,6 +295,7 @@ Public Class mgrBackup
|
||||
Dim dTimeStamp As DateTime
|
||||
Dim sTimeStamp As String
|
||||
Dim sHash As String
|
||||
Dim sArguments As String
|
||||
|
||||
For Each oGame In oBackupList
|
||||
'Init
|
||||
@@ -213,7 +303,7 @@ Public Class mgrBackup
|
||||
sBackupFile = oSettings.BackupFolder
|
||||
sSavePath = String.Empty
|
||||
dTimeStamp = Date.Now
|
||||
sTimeStamp = " " & dTimeStamp.Month & "-" & dTimeStamp.Day & "-" & dTimeStamp.Year & "-" & dTimeStamp.Hour & "-" & dTimeStamp.Minute & "-" & dTimeStamp.Second
|
||||
sTimeStamp = BuildFileTimeStamp(dTimeStamp)
|
||||
sHash = String.Empty
|
||||
bDoBackup = True
|
||||
bBackupCompleted = False
|
||||
@@ -222,14 +312,7 @@ Public Class mgrBackup
|
||||
|
||||
If oSettings.CreateSubFolder Then
|
||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
|
||||
Try
|
||||
If Not Directory.Exists(sBackupFile) Then
|
||||
Directory.CreateDirectory(sBackupFile)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
|
||||
bDoBackup = False
|
||||
End Try
|
||||
bDoBackup = HandleSubFolder(oGame, sBackupFile)
|
||||
End If
|
||||
|
||||
If oGame.AppendTimeStamp Then
|
||||
@@ -244,12 +327,16 @@ Public Class mgrBackup
|
||||
sSavePath = VerifySavePath(oGame)
|
||||
|
||||
If oGame.FolderSave = True Then
|
||||
BuildFileList(sSavePath, "*", mgrPath.IncludeFileLocation)
|
||||
BuildFileList("*", mgrPath.IncludeFileLocation)
|
||||
Else
|
||||
BuildFileList(sSavePath, oGame.FileType, mgrPath.IncludeFileLocation)
|
||||
BuildFileList(oGame.FileType, mgrPath.IncludeFileLocation)
|
||||
End If
|
||||
|
||||
BuildFileList(sSavePath, oGame.ExcludeList, mgrPath.ExcludeFileLocation)
|
||||
BuildFileList(oGame.ExcludeList, mgrPath.ExcludeFileLocation)
|
||||
|
||||
sArguments = "a" & oSettings.Prepared7zArguments & "-t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """"
|
||||
|
||||
If oGame.RecurseSubFolders Then sArguments &= " -r"
|
||||
|
||||
Try
|
||||
If Directory.Exists(sSavePath) Then
|
||||
@@ -260,8 +347,9 @@ Public Class mgrBackup
|
||||
File.Delete(sBackupFile)
|
||||
End If
|
||||
|
||||
prs7z.StartInfo.Arguments = "a" & oSettings.Prepared7zArguments & "-t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r"
|
||||
prs7z.StartInfo.Arguments = sArguments
|
||||
prs7z.StartInfo.FileName = oSettings.Utility7zLocation
|
||||
prs7z.StartInfo.WorkingDirectory = sSavePath
|
||||
prs7z.StartInfo.UseShellExecute = False
|
||||
prs7z.StartInfo.RedirectStandardOutput = True
|
||||
prs7z.StartInfo.CreateNoWindow = True
|
||||
|
||||
+81
-25
@@ -144,9 +144,9 @@ Public Class mgrCommon
|
||||
Return String.Empty
|
||||
End Function
|
||||
|
||||
Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||
ByVal bMulti As Boolean, Optional ByVal bSavedPath As Boolean = True) As String
|
||||
Dim fbBrowser As New OpenFileDialog
|
||||
Private Shared Function BuildFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||
ByVal bMulti As Boolean, ByRef fbBrowser As OpenFileDialog, Optional ByVal bSavedPath As Boolean = True) As Boolean
|
||||
|
||||
Dim oSavedPath As New clsSavedPath
|
||||
|
||||
fbBrowser.Title = sTitle
|
||||
@@ -171,21 +171,40 @@ Public Class mgrCommon
|
||||
mgrSavedPath.AddUpdatePath(oSavedPath)
|
||||
End If
|
||||
|
||||
If bMulti Then
|
||||
Dim sFileNames As String = String.Empty
|
||||
For Each sFileName As String In fbBrowser.FileNames
|
||||
sFileNames &= sFileName & "|"
|
||||
Next
|
||||
sFileNames = sFileNames.TrimEnd("|")
|
||||
Return sFileNames
|
||||
Else
|
||||
Return fbBrowser.FileName
|
||||
End If
|
||||
Return True
|
||||
End If
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||
Optional ByVal bSavedPath As Boolean = True) As String
|
||||
Dim fbBrowser As New OpenFileDialog
|
||||
Dim bResult As Boolean
|
||||
|
||||
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, False, fbBrowser, bSavedPath)
|
||||
|
||||
If bResult Then
|
||||
Return fbBrowser.FileName
|
||||
End If
|
||||
|
||||
Return String.Empty
|
||||
End Function
|
||||
|
||||
Public Shared Function OpenMultiFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
|
||||
Optional ByVal bSavedPath As Boolean = True) As String()
|
||||
Dim fbBrowser As New OpenFileDialog
|
||||
Dim bResult As Boolean
|
||||
|
||||
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, True, fbBrowser, bSavedPath)
|
||||
|
||||
If bResult Then
|
||||
Return fbBrowser.FileNames
|
||||
End If
|
||||
|
||||
Return New String() {}
|
||||
End Function
|
||||
|
||||
Public Shared Function OpenFolderBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean,
|
||||
Optional ByVal bSavedPath As Boolean = True) As String
|
||||
Dim fbBrowser As New FolderBrowserDialog
|
||||
@@ -225,7 +244,7 @@ Public Class mgrCommon
|
||||
If oGame.ProcessName.ToLower.Contains(s) Then bFound = True
|
||||
Next
|
||||
|
||||
If bFound Or oGame.Duplicate = True Then
|
||||
If bFound Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
@@ -274,8 +293,9 @@ Public Class mgrCommon
|
||||
|
||||
Public Shared Function WildcardToRegex(ByVal sPattern As String) As String
|
||||
Dim sRegEx As String
|
||||
sRegEx = sPattern.Replace("*", ".*")
|
||||
sRegEx = sRegEx.Replace("?", ".")
|
||||
sPattern = Regex.Escape(sPattern)
|
||||
sRegEx = sPattern.Replace("\*", ".*")
|
||||
sRegEx = sRegEx.Replace("\?", ".")
|
||||
Return sRegEx
|
||||
End Function
|
||||
|
||||
@@ -299,7 +319,7 @@ Public Class mgrCommon
|
||||
End Function
|
||||
|
||||
'Calculate the current size of a folder
|
||||
Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String()) As Long
|
||||
Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String(), Optional ByVal b7zStyleRecurse As Boolean = True) As Long
|
||||
Dim oFolder As DirectoryInfo
|
||||
Dim bInclude As Boolean
|
||||
Dim bExclude As Boolean
|
||||
@@ -312,14 +332,15 @@ Public Class mgrCommon
|
||||
|
||||
'Files
|
||||
For Each fi As FileInfo In oFolder.EnumerateFiles()
|
||||
|
||||
If sInclude.Length > 0 Then
|
||||
bInclude = CompareValueToArrayRegEx(fi.Name, sInclude) Or CompareValueToArrayRegEx(fi.DirectoryName, sInclude)
|
||||
bInclude = CompareValueToArrayRegEx(fi.FullName, sInclude)
|
||||
Else
|
||||
bInclude = True
|
||||
End If
|
||||
|
||||
If sExclude.Length > 0 Then
|
||||
bExclude = CompareValueToArrayRegEx(fi.Name, sExclude) Or CompareValueToArrayRegEx(fi.DirectoryName, sExclude)
|
||||
bExclude = CompareValueToArrayRegEx(fi.FullName, sExclude)
|
||||
Else
|
||||
bExclude = False
|
||||
End If
|
||||
@@ -332,16 +353,36 @@ Public Class mgrCommon
|
||||
'Sub Folders
|
||||
For Each di As DirectoryInfo In oFolder.EnumerateDirectories()
|
||||
If Not ((di.Attributes And FileAttributes.ReparsePoint) = FileAttributes.ReparsePoint) Then
|
||||
If sExclude.Length > 0 Then
|
||||
bExclude = CompareValueToArrayRegEx(di.Name, sExclude)
|
||||
If b7zStyleRecurse Then
|
||||
If sExclude.Length > 0 Then
|
||||
bExclude = CompareValueToArrayRegEx(di.FullName, sExclude)
|
||||
Else
|
||||
bExclude = False
|
||||
End If
|
||||
|
||||
If Not bExclude Then
|
||||
lSize += GetFolderSize(di.FullName, sInclude, sExclude)
|
||||
End If
|
||||
Else
|
||||
bExclude = False
|
||||
End If
|
||||
If Not bExclude Then
|
||||
lSize += GetFolderSize(di.FullName, sInclude, sExclude)
|
||||
If sInclude.Length > 0 Then
|
||||
bInclude = CompareValueToArrayRegEx(di.FullName, sInclude)
|
||||
Else
|
||||
bInclude = True
|
||||
End If
|
||||
|
||||
If sExclude.Length > 0 Then
|
||||
bExclude = CompareValueToArrayRegEx(di.FullName, sExclude)
|
||||
Else
|
||||
bExclude = False
|
||||
End If
|
||||
|
||||
If bInclude And Not bExclude Then
|
||||
lSize += GetFolderSize(di.FullName, sInclude, sExclude)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
Catch
|
||||
'Do Nothing
|
||||
End Try
|
||||
@@ -415,6 +456,21 @@ Public Class mgrCommon
|
||||
End If
|
||||
End Function
|
||||
|
||||
'Copy a file
|
||||
Public Shared Function CopyFile(ByVal sSourcePath As String, ByVal sDestinationPath As String, ByVal bOverWrite As Boolean) As Boolean
|
||||
Try
|
||||
If File.Exists(sSourcePath) Then
|
||||
File.Copy(sSourcePath, sDestinationPath, bOverWrite)
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Catch
|
||||
Return False
|
||||
End Try
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
'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
|
||||
|
||||
@@ -36,6 +36,12 @@ Public Class mgrMonitorList
|
||||
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
|
||||
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
|
||||
oGame.IsRegEx = CBool(dr("IsRegEx"))
|
||||
oGame.RecurseSubFolders = CBool(dr("RecurseSubFolders"))
|
||||
|
||||
'Compile RegEx
|
||||
If oGame.IsRegEx Then
|
||||
oGame.CompiledRegEx = New Regex(oGame.ProcessName, RegexOptions.Compiled)
|
||||
End If
|
||||
|
||||
Return oGame
|
||||
End Function
|
||||
@@ -45,7 +51,7 @@ Public Class mgrMonitorList
|
||||
|
||||
hshParams.Add("ID", oGame.ID)
|
||||
hshParams.Add("Name", oGame.Name)
|
||||
hshParams.Add("Process", oGame.TrueProcess)
|
||||
hshParams.Add("Process", oGame.ProcessName)
|
||||
hshParams.Add("Path", oGame.TruePath)
|
||||
hshParams.Add("AbsolutePath", oGame.AbsolutePath)
|
||||
hshParams.Add("FolderSave", oGame.FolderSave)
|
||||
@@ -64,6 +70,7 @@ Public Class mgrMonitorList
|
||||
hshParams.Add("Parameter", oGame.Parameter)
|
||||
hshParams.Add("Comments", oGame.Comments)
|
||||
hshParams.Add("IsRegEx", oGame.IsRegEx)
|
||||
hshParams.Add("RecurseSubFolders", oGame.RecurseSubFolders)
|
||||
|
||||
Return hshParams
|
||||
End Function
|
||||
@@ -75,10 +82,8 @@ Public Class mgrMonitorList
|
||||
Dim hshList As New Hashtable
|
||||
Dim hshDupeList As New Hashtable
|
||||
Dim oGame As clsGame
|
||||
Dim oCompareGame As clsGame
|
||||
Dim bIsDupe As Boolean
|
||||
|
||||
sSQL = "Select * FROM monitorlist ORDER BY Name Asc"
|
||||
sSQL = "SELECT * FROM monitorlist ORDER BY Name ASC"
|
||||
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
|
||||
|
||||
For Each dr As DataRow In oData.Tables(0).Rows
|
||||
@@ -87,39 +92,7 @@ Public Class mgrMonitorList
|
||||
Case eListTypes.FullList
|
||||
hshList.Add(oGame.ID, oGame)
|
||||
Case eListTypes.ScanList
|
||||
For Each de As DictionaryEntry In hshList
|
||||
bIsDupe = False
|
||||
oCompareGame = DirectCast(de.Value, clsGame)
|
||||
|
||||
If oCompareGame.IsRegEx Then
|
||||
If oGame.IsRegEx Then
|
||||
If oCompareGame.ProcessName = oGame.ProcessName Then
|
||||
bIsDupe = True
|
||||
End If
|
||||
Else
|
||||
If Regex.IsMatch(oGame.ProcessName, oCompareGame.ProcessName) Then
|
||||
bIsDupe = True
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If oGame.IsRegEx Then
|
||||
If Regex.IsMatch(oCompareGame.ProcessName, oGame.ProcessName) Then
|
||||
bIsDupe = True
|
||||
End If
|
||||
Else
|
||||
If oGame.ProcessName = oCompareGame.ProcessName Then
|
||||
bIsDupe = True
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
If bIsDupe Then
|
||||
DirectCast(hshList.Item(oCompareGame.ProcessName), clsGame).Duplicate = True
|
||||
oGame.ProcessName = oGame.CompoundKey
|
||||
oGame.Duplicate = True
|
||||
End If
|
||||
Next
|
||||
If oGame.Enabled Then hshList.Add(oGame.ProcessName, oGame)
|
||||
If oGame.Enabled Then hshList.Add(oGame.ID, oGame)
|
||||
End Select
|
||||
Next
|
||||
|
||||
@@ -133,7 +106,7 @@ Public Class mgrMonitorList
|
||||
|
||||
sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, "
|
||||
sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder, "
|
||||
sSQL &= "@Parameter, @Comments, @IsRegEx)"
|
||||
sSQL &= "@Parameter, @Comments, @IsRegEx, @RecurseSubFolders)"
|
||||
|
||||
'Parameters
|
||||
hshParams = SetCoreParameters(oGame)
|
||||
@@ -150,7 +123,7 @@ Public Class mgrMonitorList
|
||||
sSQL = "UPDATE monitorlist SET MonitorID=@ID, Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, "
|
||||
sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, "
|
||||
sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, "
|
||||
sSQL &= "CleanFolder=@CleanFolder, Parameter=@Parameter, Comments=@Comments, IsRegEx=@IsRegEx WHERE MonitorID=@QueryID;"
|
||||
sSQL &= "CleanFolder=@CleanFolder, Parameter=@Parameter, Comments=@Comments, IsRegEx=@IsRegEx, RecurseSubFolders=@RecurseSubFolders WHERE MonitorID=@QueryID;"
|
||||
sSQL &= "UPDATE gametags SET MonitorID=@ID WHERE MonitorID=@QueryID;"
|
||||
|
||||
If iSelectDB = mgrSQLite.Database.Local Then
|
||||
@@ -401,11 +374,11 @@ Public Class mgrMonitorList
|
||||
sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)"
|
||||
End If
|
||||
|
||||
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx) "
|
||||
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx, RecurseSubFolders) "
|
||||
sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
|
||||
sSQL &= "@TimeStamp, @ExcludeList, " & sGamePath & ", "
|
||||
sSQL &= sIcon & ", @Hours, " & sVersion & ", "
|
||||
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter, @Comments, @IsRegEx);"
|
||||
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter, @Comments, @IsRegEx, @RecurseSubFolders);"
|
||||
|
||||
For Each oGame As clsGame In hshGames.Values
|
||||
hshParams = New Hashtable
|
||||
@@ -413,7 +386,7 @@ Public Class mgrMonitorList
|
||||
'Core Parameters
|
||||
hshParams.Add("ID", oGame.ID)
|
||||
hshParams.Add("Name", oGame.Name)
|
||||
hshParams.Add("Process", oGame.TrueProcess)
|
||||
hshParams.Add("Process", oGame.ProcessName)
|
||||
hshParams.Add("Path", oGame.TruePath)
|
||||
hshParams.Add("AbsolutePath", oGame.AbsolutePath)
|
||||
hshParams.Add("FolderSave", oGame.FolderSave)
|
||||
@@ -427,6 +400,7 @@ Public Class mgrMonitorList
|
||||
hshParams.Add("Parameter", oGame.Parameter)
|
||||
hshParams.Add("Comments", oGame.Comments)
|
||||
hshParams.Add("IsRegEx", oGame.IsRegEx)
|
||||
hshParams.Add("RecurseSubFolders", oGame.RecurseSubFolders)
|
||||
|
||||
'Optional Parameters
|
||||
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
|
||||
@@ -582,7 +556,7 @@ Public Class mgrMonitorList
|
||||
ByRef hshParams As Hashtable) As String
|
||||
Dim sSQL As String = String.Empty
|
||||
Dim iCounter As Integer = 0
|
||||
Dim sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx FROM monitorlist"
|
||||
Dim sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx, RecurseSubFolders FROM monitorlist"
|
||||
Dim sSort As String = " ORDER BY " & sSortField
|
||||
|
||||
If bSortAsc Then
|
||||
@@ -779,6 +753,7 @@ Public Class mgrMonitorList
|
||||
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
|
||||
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
|
||||
oGame.IsRegEx = CBool(dr("IsRegEx"))
|
||||
oGame.RecurseSubFolders = CBool(dr("RecurseSubFolders"))
|
||||
oGame.Tags = mgrGameTags.GetTagsByGameForExport(oGame.ID)
|
||||
oList.Add(oGame)
|
||||
Next
|
||||
@@ -822,13 +797,13 @@ Public Class mgrMonitorList
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Public Shared Function DoImport(ByVal sPath As String, ByVal bOfficial As Boolean, ByRef oSettings As mgrSettings, Optional ByVal bStartUpWizard As Boolean = False) As Boolean
|
||||
Public Shared Function DoImport(ByVal sPath As String, ByVal bOfficial As Boolean, ByRef oSettings As mgrSettings, Optional ByVal bStartUpWizard As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False) As Boolean
|
||||
If mgrCommon.IsAddress(sPath) Then
|
||||
If mgrCommon.CheckAddress(sPath) Then
|
||||
If bOfficial And Not bStartUpWizard And Not ((oSettings.SuppressMessages And mgrSettings.eSuppressMessages.GameIDSync) = mgrSettings.eSuppressMessages.GameIDSync) Then
|
||||
SyncGameIDs(sPath, oSettings, True)
|
||||
End If
|
||||
ImportMonitorList(sPath, True)
|
||||
ImportMonitorList(sPath, True, bWinConfigsInLinux)
|
||||
Return True
|
||||
Else
|
||||
mgrCommon.ShowMessage(mgrMonitorList_WebNoReponse, sPath, MsgBoxStyle.Exclamation)
|
||||
@@ -836,7 +811,7 @@ Public Class mgrMonitorList
|
||||
End If
|
||||
Else
|
||||
If File.Exists(sPath) Then
|
||||
ImportMonitorList(sPath)
|
||||
ImportMonitorList(sPath,, bWinConfigsInLinux)
|
||||
Return True
|
||||
Else
|
||||
mgrCommon.ShowMessage(mgrMonitorList_FileNotFound, sPath, MsgBoxStyle.Exclamation)
|
||||
@@ -846,7 +821,7 @@ Public Class mgrMonitorList
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Private Shared Sub ImportMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False)
|
||||
Private Shared Sub ImportMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False)
|
||||
Dim hshCompareFrom As New Hashtable
|
||||
Dim hshCompareTo As Hashtable
|
||||
Dim hshSyncItems As Hashtable
|
||||
@@ -860,7 +835,7 @@ Public Class mgrMonitorList
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
If oExportInfo.AppVer < 110 Then
|
||||
If oExportInfo.AppVer < 115 Then
|
||||
If mgrCommon.ShowMessage(mgrMonitorList_ImportVersionWarning, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -893,6 +868,7 @@ Public Class mgrMonitorList
|
||||
Dim frm As New frmAdvancedImport
|
||||
frm.ImportInfo = oExportInfo
|
||||
frm.ImportData = hshSyncItems
|
||||
frm.ModWinConfigsForLinux = bWinConfigsInLinux
|
||||
If frm.ShowDialog() = DialogResult.OK Then
|
||||
Cursor.Current = Cursors.WaitCursor
|
||||
|
||||
|
||||
+229
-52
@@ -15,7 +15,8 @@ Public Class mgrPath
|
||||
Private Shared oReleaseType As ProcessorArchitecture = AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture
|
||||
|
||||
Shared Sub New()
|
||||
hshCustomVariables = mgrVariables.ReadVariables
|
||||
SetEnv()
|
||||
LoadCustomVariables()
|
||||
End Sub
|
||||
|
||||
Shared ReadOnly Property ReleaseType As Integer
|
||||
@@ -202,6 +203,114 @@ Public Class mgrPath
|
||||
Return sResult
|
||||
End Function
|
||||
|
||||
Public Shared Sub ModWinePathData(ByRef oGame As clsGame)
|
||||
If Not oGame.AbsolutePath Then oGame.Path = oGame.Path.Replace("\", Path.DirectorySeparatorChar)
|
||||
oGame.FileType = oGame.FileType.Replace("\", Path.DirectorySeparatorChar)
|
||||
oGame.ExcludeList = oGame.ExcludeList.Replace("\", Path.DirectorySeparatorChar)
|
||||
End Sub
|
||||
|
||||
Private Shared Function BuildWinePath(ByVal sPath As String, ByVal sWinePrefix As String) As String
|
||||
Dim sRealPath As String
|
||||
Dim cDriveLetter As Char
|
||||
Dim sWineDrive As String
|
||||
|
||||
Try
|
||||
'Grab Path
|
||||
sRealPath = sPath.Split("=")(1)
|
||||
|
||||
'Remove Quotes
|
||||
sRealPath = sRealPath.TrimStart("""")
|
||||
sRealPath = sRealPath.TrimEnd("""")
|
||||
|
||||
'Flip Seperators
|
||||
sRealPath = sRealPath.Replace("\\", Path.DirectorySeparatorChar)
|
||||
|
||||
'Change Wine Drive
|
||||
cDriveLetter = sRealPath.Chars(sRealPath.IndexOf(":") - 1)
|
||||
sWineDrive = "drive_" & cDriveLetter
|
||||
sRealPath = sRealPath.Replace(cDriveLetter & ":", sWineDrive.ToLower)
|
||||
|
||||
Return sWinePrefix & Path.DirectorySeparatorChar & sRealPath
|
||||
Catch ex As Exception
|
||||
mgrCommon.ShowMessage(mgrPath_ErrorBuildingWinePath, ex.Message, MsgBoxStyle.Exclamation)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetWineSavePath(ByVal sPrefix As String, ByVal sPath As String) As String
|
||||
Dim sRegistry As String
|
||||
Dim sWinePath As String
|
||||
Dim sReplace As String
|
||||
Dim oParse As Regex
|
||||
Dim oMatch As Match
|
||||
|
||||
Try
|
||||
If sPath.Contains("%APPDATA%") Then
|
||||
sReplace = "%APPDATA%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
|
||||
oParse = New Regex("""AppData""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%LOCALAPPDATA%Low") Then
|
||||
sReplace = "%LOCALAPPDATA%Low"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
|
||||
oParse = New Regex("""{A520A1A4-1780-4FF6-BD18-167343C5AF16}""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%LOCALAPPDATA%") Then
|
||||
sReplace = "%LOCALAPPDATA%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
|
||||
oParse = New Regex("""Local AppData""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%USERDOCUMENTS%") Then
|
||||
sReplace = "%USERDOCUMENTS%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
|
||||
oParse = New Regex("""Personal""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%COMMONDOCUMENTS%") Then
|
||||
sReplace = "%COMMONDOCUMENTS%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "system.reg")
|
||||
oParse = New Regex("""Common Documents""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%PROGRAMDATA%") Then
|
||||
sReplace = "%PROGRAMDATA%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "system.reg")
|
||||
oParse = New Regex("""Common AppData""="".+?(?=\n)")
|
||||
ElseIf sPath.Contains("%USERPROFILE%") Then
|
||||
sReplace = "%USERPROFILE%"
|
||||
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
|
||||
oParse = New Regex("""Desktop""="".+?(?=\\\\Desktop)")
|
||||
Else
|
||||
Return sPath
|
||||
End If
|
||||
|
||||
If oParse.IsMatch(sRegistry) Then
|
||||
oMatch = oParse.Match(sRegistry)
|
||||
sWinePath = BuildWinePath(oMatch.Value, sPrefix)
|
||||
sPath = sPath.Replace("\", Path.DirectorySeparatorChar)
|
||||
Return sPath.Replace(sReplace, sWinePath)
|
||||
End If
|
||||
|
||||
Return sPath
|
||||
Catch ex As Exception
|
||||
mgrCommon.ShowMessage(mgrPath_ErrorConvertWineSavePath, ex.Message, MsgBoxStyle.Exclamation)
|
||||
Return sPath
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function GetWinePrefix(ByVal prs As Process) As String
|
||||
Dim sEnv As String
|
||||
Dim oParse As New Regex("WINEPREFIX=.+?(?=\x00)")
|
||||
Dim oMatch As Match
|
||||
|
||||
Try
|
||||
sEnv = File.ReadAllText("/proc/" & prs.Id.ToString() & "/environ")
|
||||
If oParse.IsMatch(sEnv) Then
|
||||
oMatch = oParse.Match(sEnv)
|
||||
Return oMatch.Value.Trim("/").Split("=")(1)
|
||||
Else
|
||||
'When WINEPREFIX is not part of the command, we will assume the default prefix.
|
||||
Return Environment.GetFolderPath(Environment.SpecialFolder.Personal) & "/.wine"
|
||||
End If
|
||||
Catch ex As Exception
|
||||
mgrCommon.ShowMessage(mgrPath_ErrorWinePrefix, ex.Message, MsgBoxStyle.Exclamation)
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Public Shared Function CheckSpecialPaths() As Boolean
|
||||
Dim hshEnvs As New Hashtable
|
||||
Dim bNoError As Boolean = True
|
||||
@@ -209,6 +318,8 @@ Public Class mgrPath
|
||||
hshEnvs.Add("Documents", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
|
||||
hshEnvs.Add("AppDataRoaming", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData))
|
||||
hshEnvs.Add("AppDataLocal", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
|
||||
hshEnvs.Add("ProgramData", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData))
|
||||
|
||||
If Not mgrCommon.IsUnix Then
|
||||
hshEnvs.Add("UserData", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile))
|
||||
hshEnvs.Add("PublicDocuments", Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments))
|
||||
@@ -224,14 +335,22 @@ Public Class mgrPath
|
||||
Return bNoError
|
||||
End Function
|
||||
|
||||
Public Shared Function ReplaceSpecialPaths(sValue As String) As String
|
||||
Dim sMyDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
Dim sPublicDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
|
||||
Dim sAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
||||
Dim sAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
||||
Dim sCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
|
||||
Dim oCustomVariable As clsPathVariable
|
||||
Private Shared Sub SetEnv()
|
||||
If Not mgrCommon.IsUnix Then
|
||||
Environment.SetEnvironmentVariable("USERDOCUMENTS", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
|
||||
Environment.SetEnvironmentVariable("COMMONDOCUMENTS", Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments))
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Function ReplaceSpecialPaths(ByVal sValue As String) As String
|
||||
Dim sXdgData As String = "${XDG_DATA_HOME:-~/.local/share}"
|
||||
Dim sEnvAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
||||
Dim sXdgConfig As String = "${XDG_CONFIG_HOME:-~/.config}"
|
||||
Dim sEnvAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
||||
Dim sHomeDir As String = "${HOME}"
|
||||
Dim sEnvCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
|
||||
Dim oCustomVariable As clsPathVariable
|
||||
|
||||
For Each oCustomVariable In hshCustomVariables.Values
|
||||
If sValue.Contains(oCustomVariable.FormattedName) Then
|
||||
@@ -239,68 +358,98 @@ Public Class mgrPath
|
||||
End If
|
||||
Next
|
||||
|
||||
If sValue.Contains("*appdatalocal*") Then
|
||||
Return sValue.Replace("*appdatalocal*", sAppDataLocal)
|
||||
End If
|
||||
|
||||
If sValue.Contains("*appdataroaming*") Then
|
||||
Return sValue.Replace("*appdataroaming*", sAppDataRoaming)
|
||||
End If
|
||||
|
||||
'This needs to be tested last for Unix compatability
|
||||
If sValue.Contains("*mydocs*") Then
|
||||
Return sValue.Replace("*mydocs*", sMyDocs)
|
||||
End If
|
||||
|
||||
'Don't use these in Unix
|
||||
If Not mgrCommon.IsUnix Then
|
||||
If sValue.Contains("*publicdocs*") Then
|
||||
Return sValue.Replace("*publicdocs*", sPublicDocs)
|
||||
If mgrCommon.IsUnix Then
|
||||
'$VAR_iable
|
||||
Dim oParse As New Regex("\$([a-zA-Z0-9_]+)")
|
||||
'${VAR_iable} but not advanced syntax like ${VAR:-iable}
|
||||
Dim oParseBracketed As New Regex("\$\{([a-zA-Z0-9_]+?)\}")
|
||||
'~ not inside ${...}
|
||||
Dim oParseTilde As New Regex("~(?![^\$\{]*\})")
|
||||
If sEnvCurrentUser = String.Empty Then
|
||||
'Fall back
|
||||
sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
|
||||
End If
|
||||
If sEnvCurrentUser = String.Empty Then
|
||||
'Fall back
|
||||
sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
End If
|
||||
|
||||
If sValue.Contains("*currentuser*") Then
|
||||
Return sValue.Replace("*currentuser*", sCurrentUser)
|
||||
End If
|
||||
'$HOME to ${HOME}
|
||||
sValue = oParse.Replace(sValue, "${$1}")
|
||||
'Special notations for home directory
|
||||
sValue = oParseTilde.Replace(sValue, "${HOME}")
|
||||
'XDG Base Directory Specification has default values
|
||||
sValue = sValue.Replace("${XDG_DATA_HOME}", sXdgData)
|
||||
sValue = sValue.Replace("${XDG_CONFIG_HOME}", sXdgConfig)
|
||||
|
||||
'Replace with paths
|
||||
sValue = sValue.Replace(sXdgData, sEnvAppDataLocal)
|
||||
sValue = sValue.Replace(sXdgConfig, sEnvAppDataRoaming)
|
||||
sValue = sValue.Replace(sHomeDir, sEnvCurrentUser)
|
||||
|
||||
'Escape real Windows variables
|
||||
sValue = sValue.Replace("%", "\%")
|
||||
'Transform Linux variables to Windows variables
|
||||
sValue = oParseBracketed.Replace(sValue, "%$1%")
|
||||
End If
|
||||
|
||||
'On Linux real Linux environmental variables are used
|
||||
sValue = Environment.ExpandEnvironmentVariables(sValue)
|
||||
|
||||
If mgrCommon.IsUnix Then
|
||||
'Transform missing variables back
|
||||
Dim oParse As New Regex("%([a-zA-Z0-9_]+?)%")
|
||||
sValue = oParse.Replace(sValue, "${$1}")
|
||||
'Unscape real Windows variables
|
||||
sValue = sValue.Replace("\%", "%")
|
||||
End If
|
||||
|
||||
Return sValue
|
||||
End Function
|
||||
|
||||
Public Shared Function ReverseSpecialPaths(sValue As String) As String
|
||||
Dim sMyDocs As String = "*mydocs*"
|
||||
Dim sMyDocs As String = "%USERDOCUMENTS%"
|
||||
Dim sEnvMyDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
Dim sPublicDocs As String = "*publicdocs*"
|
||||
Dim sPublicDocs As String = "%COMMONDOCUMENTS%"
|
||||
Dim sEnvPublicDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
|
||||
Dim sAppDataLocal As String = "*appdatalocal*"
|
||||
Dim sAppDataLocal As String = "%LOCALAPPDATA%"
|
||||
Dim sXdgData As String = "${XDG_DATA_HOME:-~/.local/share}"
|
||||
Dim sEnvAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
|
||||
Dim sAppDataRoaming As String = "*appdataroaming*"
|
||||
Dim sAppDataRoaming As String = "%APPDATA%"
|
||||
Dim sXdgConfig As String = "${XDG_CONFIG_HOME:-~/.config}"
|
||||
Dim sEnvAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
|
||||
Dim sCurrentUser As String = "*currentuser*"
|
||||
Dim sCurrentUser As String = "%USERPROFILE%"
|
||||
Dim sHomeDir As String = "~"
|
||||
Dim sEnvCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
|
||||
Dim sProgramData As String = "%PROGRAMDATA%"
|
||||
Dim sEnvProgramData As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
|
||||
Dim oCustomVariable As clsPathVariable
|
||||
|
||||
|
||||
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(sEnvAppDataRoaming) Then
|
||||
Return sValue.Replace(sEnvAppDataRoaming, sAppDataRoaming)
|
||||
End If
|
||||
|
||||
If sValue.Contains(sEnvAppDataLocal) Then
|
||||
Return sValue.Replace(sEnvAppDataLocal, sAppDataLocal)
|
||||
End If
|
||||
|
||||
'This needs to be tested last for Unix compatability
|
||||
If sValue.Contains(sEnvMyDocs) Then
|
||||
Return sValue.Replace(sEnvMyDocs, sMyDocs)
|
||||
End If
|
||||
|
||||
'Don't use these in Unix
|
||||
If Not mgrCommon.IsUnix Then
|
||||
If sValue.Contains(sEnvAppDataRoaming) Then
|
||||
Return sValue.Replace(sEnvAppDataRoaming, sAppDataRoaming)
|
||||
End If
|
||||
|
||||
If sValue.Contains(sEnvAppDataLocal) Then
|
||||
Return sValue.Replace(sEnvAppDataLocal, sAppDataLocal)
|
||||
End If
|
||||
|
||||
If sValue.Contains(sEnvProgramData) Then
|
||||
Return sValue.Replace(sEnvProgramData, sProgramData)
|
||||
End If
|
||||
|
||||
'This needs to be tested last for Unix compatability
|
||||
If sValue.Contains(sEnvMyDocs) Then
|
||||
Return sValue.Replace(sEnvMyDocs, sMyDocs)
|
||||
End If
|
||||
|
||||
'Mono doesn't set a path for these folders
|
||||
If sValue.Contains(sEnvPublicDocs) Then
|
||||
Return sValue.Replace(sEnvPublicDocs, sPublicDocs)
|
||||
End If
|
||||
@@ -308,6 +457,28 @@ Public Class mgrPath
|
||||
If sValue.Contains(sEnvCurrentUser) Then
|
||||
Return sValue.Replace(sEnvCurrentUser, sCurrentUser)
|
||||
End If
|
||||
Else
|
||||
'Use different paths on Linux
|
||||
If sValue.Contains(sEnvAppDataRoaming) Then
|
||||
Return sValue.Replace(sEnvAppDataRoaming, sXdgConfig)
|
||||
End If
|
||||
|
||||
If sValue.Contains(sEnvAppDataLocal) Then
|
||||
Return sValue.Replace(sEnvAppDataLocal, sXdgData)
|
||||
End If
|
||||
|
||||
'Must be last
|
||||
If sValue.Contains(sEnvCurrentUser) Then
|
||||
If sEnvCurrentUser = String.Empty Then
|
||||
'Fall back
|
||||
sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
|
||||
End If
|
||||
If sEnvCurrentUser = String.Empty Then
|
||||
'Fall back
|
||||
sEnvCurrentUser = sMyDocs
|
||||
End If
|
||||
Return sValue.Replace(sEnvCurrentUser, sHomeDir)
|
||||
End If
|
||||
End If
|
||||
|
||||
Return sValue
|
||||
@@ -345,8 +516,10 @@ Public Class mgrPath
|
||||
|
||||
Public Shared Function VerifyCustomVariables(ByVal hshScanlist As Hashtable, ByRef sGames As String) As Boolean
|
||||
Dim hshCustomVariables As Hashtable = mgrVariables.ReadVariables
|
||||
'Reserved variables will be resolved on Windows, but not on a Linux. Therefore we an ignore list here, otherwise GBM will bitch about them when using Windows configurations for Wine.
|
||||
Dim oReservedVariables As List(Of String) = mgrVariables.GetReservedVariables
|
||||
Dim sVariableCheck As String
|
||||
Dim sPattern As String = "\*(.*)\*"
|
||||
Dim sPattern As String = "\%(.*)\%"
|
||||
Dim oGame As clsGame
|
||||
Dim oMatch As Match
|
||||
Dim bClean As Boolean = True
|
||||
@@ -354,8 +527,8 @@ Public Class mgrPath
|
||||
For Each oGame In hshScanlist.Values
|
||||
oMatch = Regex.Match(oGame.Path, sPattern)
|
||||
If oMatch.Success Then
|
||||
sVariableCheck = oMatch.Value.Replace("*", String.Empty)
|
||||
If Not hshCustomVariables.ContainsKey(sVariableCheck) Then
|
||||
sVariableCheck = oMatch.Value.Replace("%", String.Empty)
|
||||
If Not hshCustomVariables.ContainsKey(sVariableCheck) And Not oReservedVariables.Contains(sVariableCheck) Then
|
||||
sGames &= vbCrLf & oGame.Name & " (" & sVariableCheck & ")"
|
||||
bClean = False
|
||||
End If
|
||||
@@ -365,8 +538,12 @@ Public Class mgrPath
|
||||
Return bClean
|
||||
End Function
|
||||
|
||||
Public Shared Sub CustomVariablesReload()
|
||||
Public Shared Sub LoadCustomVariables()
|
||||
hshCustomVariables = mgrVariables.ReadVariables
|
||||
|
||||
For Each oVariable As clsPathVariable In hshCustomVariables.Values
|
||||
Environment.SetEnvironmentVariable(oVariable.Name, oVariable.Path)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Function SetManualGamePath() As String
|
||||
|
||||
+134
-112
@@ -1,17 +1,16 @@
|
||||
Imports System.IO
|
||||
Imports System.Management
|
||||
Imports System.Text.RegularExpressions
|
||||
|
||||
Public Class mgrProcessDetection
|
||||
|
||||
Private prsFoundProcess As Process
|
||||
Private sProcessPath As String
|
||||
Private dStartTime As DateTime = Now, dEndTime As DateTime = Now
|
||||
Private lTimeSpent As Long = 0
|
||||
Private oGame As clsGame
|
||||
Private oDuplicateGames As New ArrayList
|
||||
Private bDuplicates As Boolean
|
||||
Private bVerified As Boolean = False
|
||||
Private sFullCommand As String = String.Empty
|
||||
|
||||
Property FoundProcess As Process
|
||||
Get
|
||||
@@ -22,6 +21,15 @@ Public Class mgrProcessDetection
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property ProcessPath As String
|
||||
Get
|
||||
Return sProcessPath
|
||||
End Get
|
||||
Set(value As String)
|
||||
sProcessPath = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property StartTime As DateTime
|
||||
Get
|
||||
Return dStartTime
|
||||
@@ -73,85 +81,32 @@ Public Class mgrProcessDetection
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property FullCommand As String
|
||||
Get
|
||||
Return sFullCommand
|
||||
End Get
|
||||
Set(value As String)
|
||||
sFullCommand = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Function HandleDuplicates(hshScanList As Hashtable) As Boolean
|
||||
Dim sProcess As String
|
||||
Dim sParameter As String = String.Empty
|
||||
Dim bParameter As Boolean = False
|
||||
Dim oInitialDupes As New ArrayList
|
||||
|
||||
bDuplicates = True
|
||||
oDuplicateGames.Clear()
|
||||
|
||||
|
||||
For Each o As clsGame In hshScanList.Values
|
||||
sProcess = o.ProcessName.Split(":")(0)
|
||||
If o.Duplicate = True And (sProcess = oGame.TrueProcess Or Regex.IsMatch(sProcess, oGame.TrueProcess)) Then
|
||||
oInitialDupes.Add(o.ShallowCopy)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each o As clsGame In oInitialDupes
|
||||
If (o.Parameter <> String.Empty And FullCommand.Contains(o.Parameter)) Then
|
||||
sParameter = o.Parameter
|
||||
bParameter = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
|
||||
If bParameter Then
|
||||
For Each o As clsGame In oInitialDupes
|
||||
If (o.Parameter = sParameter) Then
|
||||
oDuplicateGames.Add(o.ShallowCopy)
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
For Each o As clsGame In oInitialDupes
|
||||
If (o.Parameter = String.Empty) Then
|
||||
oDuplicateGames.Add(o.ShallowCopy)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
If oDuplicateGames.Count = 1 Then
|
||||
oGame = DirectCast(oDuplicateGames(0), clsGame).ShallowCopy
|
||||
Return True
|
||||
End If
|
||||
|
||||
Return False
|
||||
End Function
|
||||
|
||||
'This function will only work correctly on Windows
|
||||
Private Sub GetWindowsCommand(ByVal prs As Process)
|
||||
FullCommand = String.Empty
|
||||
Private Function GetWindowsCommand(ByVal prs As Process) As String
|
||||
Dim sFullCommand As String = String.Empty
|
||||
Try
|
||||
Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + prs.Id.ToString)
|
||||
For Each o As ManagementObject In searcher.Get()
|
||||
FullCommand &= o("CommandLine") & " "
|
||||
sFullCommand &= o("CommandLine") & " "
|
||||
Next
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
Catch
|
||||
'Do Nothing
|
||||
End Try
|
||||
End Sub
|
||||
Return sFullCommand
|
||||
End Function
|
||||
|
||||
'This function will only work correctly on Unix
|
||||
Private Sub GetUnixCommand(ByVal prs As Process)
|
||||
FullCommand = String.Empty
|
||||
Private Function GetUnixCommand(ByVal prs As Process) As String
|
||||
Dim sFullCommand As String = String.Empty
|
||||
Try
|
||||
FullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ")
|
||||
Catch ex As Exception
|
||||
sFullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ")
|
||||
Catch
|
||||
'Do Nothing
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Return sFullCommand
|
||||
End Function
|
||||
|
||||
'This function will only work correctly on Unix
|
||||
Private Function GetUnixProcessArguments(ByVal prs As Process) As String()
|
||||
@@ -187,7 +142,7 @@ Public Class mgrProcessDetection
|
||||
Private Function IsMatch(ByRef oGame As clsGame, ByRef sProcessCheck As String) As Boolean
|
||||
If oGame.IsRegEx Then
|
||||
Try
|
||||
If Regex.IsMatch(sProcessCheck, oGame.ProcessName) Then
|
||||
If oGame.CompiledRegEx.IsMatch(sProcessCheck) Then
|
||||
Return True
|
||||
End If
|
||||
Catch
|
||||
@@ -202,16 +157,104 @@ Public Class mgrProcessDetection
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef iErrorCode As Integer, ByVal bDebugMode As Boolean) As Boolean
|
||||
Private Function GetProcessPath(ByVal bWineProcess As Boolean) As String
|
||||
Try
|
||||
If Not bWineProcess Then
|
||||
Return Path.GetDirectoryName(FoundProcess.MainModule.FileName)
|
||||
Else
|
||||
Return GetUnixSymLinkDirectory(FoundProcess)
|
||||
End If
|
||||
Catch
|
||||
Return String.Empty
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub FilterDetected(ByVal oDetectedGames As ArrayList, ByVal bWineProcess As Boolean)
|
||||
Dim bMatch As Boolean = False
|
||||
Dim sFullCommand As String
|
||||
Dim oNotDetectedWithParameters As New ArrayList
|
||||
Dim oDetectedWithParameters As New ArrayList
|
||||
Dim oNotDetectedWithProcessPath As New ArrayList
|
||||
Dim oDetectedWithProcessPath As New ArrayList
|
||||
|
||||
'Get parameters of the found process
|
||||
If mgrCommon.IsUnix Then
|
||||
sFullCommand = GetUnixCommand(FoundProcess)
|
||||
Else
|
||||
sFullCommand = GetWindowsCommand(FoundProcess)
|
||||
End If
|
||||
|
||||
'Get Process Path
|
||||
ProcessPath = GetProcessPath(bWineProcess)
|
||||
|
||||
'Look for any games using parameters and any matches
|
||||
For Each oDetectedGame As clsGame In oDetectedGames
|
||||
If oDetectedGame.Parameter <> String.Empty Then
|
||||
If sFullCommand.Contains(oDetectedGame.Parameter) Then
|
||||
oDetectedWithParameters.Add(oDetectedGame)
|
||||
Else
|
||||
oNotDetectedWithParameters.Add(oDetectedGame)
|
||||
End If
|
||||
|
||||
End If
|
||||
Next
|
||||
|
||||
'If we detected at least one parameter match, replace full detected list with the detected with parameter list
|
||||
If oDetectedWithParameters.Count > 0 Then
|
||||
oDetectedGames = oDetectedWithParameters
|
||||
Else
|
||||
'If there is no parameter match, remove any games using parameters from the detected list
|
||||
For Each oGameNotDetected As clsGame In oNotDetectedWithParameters
|
||||
oDetectedGames.Remove(oGameNotDetected)
|
||||
Next
|
||||
End If
|
||||
|
||||
'If there's only one match after parameter detection, set it as current game and we're done.
|
||||
If oDetectedGames.Count = 1 Then
|
||||
GameInfo = oDetectedGames(0)
|
||||
Duplicate = False
|
||||
Else
|
||||
'Check if we have any exact matches based on process path
|
||||
For Each oDetectedGame As clsGame In oDetectedGames
|
||||
If oDetectedGame.ProcessPath <> String.Empty Then
|
||||
If oDetectedGame.ProcessPath = ProcessPath Then
|
||||
oDetectedWithProcessPath.Add(oDetectedGame)
|
||||
Else
|
||||
oNotDetectedWithProcessPath.Add(oDetectedGame)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
'If there's only one match after process detection, set it as current game and we're done
|
||||
If oDetectedWithProcessPath.Count = 1 Then
|
||||
GameInfo = oDetectedWithProcessPath(0)
|
||||
Duplicate = False
|
||||
Else
|
||||
'Remove any games with a process path that does not match the current process
|
||||
For Each oGameNotDetected As clsGame In oNotDetectedWithProcessPath
|
||||
oDetectedGames.Remove(oGameNotDetected)
|
||||
Next
|
||||
|
||||
'If only a single game remains, set it as current game and we're done
|
||||
If oDetectedGames.Count = 1 Then
|
||||
GameInfo = oDetectedGames(0)
|
||||
Duplicate = False
|
||||
Else
|
||||
'We've done all we can, the user must selected which game they were playing when the process ends
|
||||
Duplicate = True
|
||||
oDuplicateGames = oDetectedGames
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef bWineProcess 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
|
||||
Dim bPass As Boolean
|
||||
Dim oDetectedGames As New ArrayList
|
||||
|
||||
For Each prsCurrent As Process In prsList
|
||||
bPass = False
|
||||
|
||||
'This needs to be wrapped due to issues with Mono.
|
||||
Try
|
||||
sProcessCheck = prsCurrent.ProcessName
|
||||
@@ -219,57 +262,41 @@ Public Class mgrProcessDetection
|
||||
'Unix Handler
|
||||
'We need some special handling for Wine processes
|
||||
If mgrCommon.IsUnix And (sProcessCheck.ToLower = "wine-preloader" Or sProcessCheck.ToLower = "wine64-preloader") Then
|
||||
Dim sArgs As String() = GetUnixProcessArguments(prsCurrent)
|
||||
Dim sParameter As String
|
||||
Dim sWinePath As String()
|
||||
'We can't use Path.GetFileName here, Wine uses the Windows seperator in arguments and Mono expects a different one in Unix.
|
||||
sWinePath = GetUnixProcessArguments(prsCurrent)(0).Split("\")
|
||||
sProcessCheck = sWinePath(sWinePath.Length - 1).Replace(".exe", "")
|
||||
'The wine-preloader parameters can refer to a path on the host system, windows based path within in the prefix, or mixed notation.
|
||||
sParameter = sArgs(0).Replace("\", Path.DirectorySeparatorChar)
|
||||
sWinePath = sParameter.Split(Path.DirectorySeparatorChar)
|
||||
sProcessCheck = Path.GetFileNameWithoutExtension(sWinePath(sWinePath.Length - 1))
|
||||
bWineProcess = True
|
||||
Else
|
||||
bWineProcess = False
|
||||
End If
|
||||
|
||||
If bDebugMode And mgrCommon.IsUnix Then
|
||||
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetUnixProcessArguments(prsCurrent)(0) & vbCrLf
|
||||
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetUnixCommand(prsCurrent) & vbCrLf
|
||||
ElseIf bDebugMode Then
|
||||
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & vbCrLf
|
||||
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetWindowsCommand(prsCurrent) & vbCrLf
|
||||
End If
|
||||
Catch ex As Exception
|
||||
'Do Nothing
|
||||
End Try
|
||||
|
||||
'Detection Pass 1
|
||||
For Each oCurrentGame As clsGame In hshScanList.Values
|
||||
If IsMatch(oCurrentGame, sProcessCheck) Then
|
||||
prsFoundProcess = prsCurrent
|
||||
oGame = oCurrentGame.ShallowCopy
|
||||
bPass = True
|
||||
|
||||
If mgrCommon.IsUnix Then
|
||||
GetUnixCommand(prsCurrent)
|
||||
Else
|
||||
GetWindowsCommand(prsCurrent)
|
||||
End If
|
||||
|
||||
If oGame.Duplicate = True Then
|
||||
If HandleDuplicates(hshScanList) Then
|
||||
bDuplicates = False
|
||||
oDuplicateGames.Clear()
|
||||
End If
|
||||
Else
|
||||
bDuplicates = False
|
||||
oDuplicateGames.Clear()
|
||||
End If
|
||||
|
||||
If Duplicate And DuplicateList.Count = 0 Then bPass = False
|
||||
|
||||
If oGame.Parameter <> String.Empty And Not Duplicate And Not FullCommand.Contains(oGame.Parameter) Then bPass = False
|
||||
oDetectedGames.Add(oGame.ShallowCopy)
|
||||
End If
|
||||
Next
|
||||
|
||||
'Detection Pass 2
|
||||
If bPass Then
|
||||
'Determine the process path if we need it
|
||||
If Not oGame.AbsolutePath Or oGame.Duplicate Then
|
||||
If oDetectedGames.Count > 0 Then
|
||||
FilterDetected(oDetectedGames, bWineProcess)
|
||||
End If
|
||||
|
||||
If oDetectedGames.Count > 0 Then
|
||||
If Not oGame.AbsolutePath And Not oGame.MonitorOnly Then
|
||||
Try
|
||||
If Not bWineProcess Then
|
||||
oGame.ProcessPath = Path.GetDirectoryName(prsCurrent.MainModule.FileName)
|
||||
@@ -277,9 +304,6 @@ Public Class mgrProcessDetection
|
||||
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.
|
||||
'The process is 64-bit and the process folder is required, shouldn't happen often.
|
||||
If exWin32.NativeErrorCode = 5 Then
|
||||
bNeedsPath = True
|
||||
iErrorCode = 5
|
||||
@@ -288,13 +312,11 @@ Public Class mgrProcessDetection
|
||||
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.
|
||||
bPass = False
|
||||
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.
|
||||
bPass = False
|
||||
Return False
|
||||
End Try
|
||||
End If
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ Public Class mgrRestore
|
||||
If oGame.ProcessPath <> String.Empty Then
|
||||
oRestoreInfo.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oRestoreInfo.RestorePath
|
||||
Else
|
||||
sProcess = oGame.TrueProcess
|
||||
sProcess = oGame.ProcessName
|
||||
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
|
||||
sRestorePath = mgrPath.ProcessPathSearch(oRestoreInfo.Name, sProcess, mgrCommon.FormatString(mgrRestore_RelativeNeedPath, oRestoreInfo.Name), bNoAuto)
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ Public Class mgrSQLite
|
||||
"BackupFolder TEXT NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " &
|
||||
"SuppressBackup BOOLEAN NOT NULL, SuppressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " &
|
||||
"Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL, SessionTracking BOOLEAN NOT NULL, " &
|
||||
"SuppressMessages INTEGER NOT NULL, BackupOnLaunch BOOLEAN NOT NULL, UseGameID BOOLEAN NOT NULL, DisableSyncMessages BOOLEAN NOT NULL);"
|
||||
"SuppressMessages INTEGER NOT NULL, BackupOnLaunch BOOLEAN NOT NULL, UseGameID BOOLEAN NOT NULL, DisableSyncMessages BOOLEAN NOT NULL, ShowResolvedPaths BOOLEAN NOT NULL);"
|
||||
|
||||
'Add Tables (SavedPath)
|
||||
sSql &= "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
|
||||
@@ -84,7 +84,7 @@ Public Class mgrSQLite
|
||||
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
|
||||
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
|
||||
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL, RecurseSubFolders NOT NULL);"
|
||||
|
||||
'Add Tables (Tags)
|
||||
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
|
||||
@@ -130,7 +130,7 @@ Public Class mgrSQLite
|
||||
sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
|
||||
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
|
||||
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL, RecurseSubFolders NOT NULL);"
|
||||
|
||||
'Add Tables (Remote Manifest)
|
||||
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
|
||||
@@ -848,6 +848,74 @@ Public Class mgrSQLite
|
||||
CompactDatabase()
|
||||
End If
|
||||
End If
|
||||
|
||||
'1.15 Upgrade
|
||||
If GetDatabaseVersion() < 115 Then
|
||||
If eDatabase = Database.Local Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v110")
|
||||
|
||||
'Add new setting
|
||||
sSQL = "ALTER TABLE settings ADD COLUMN ShowResolvedPaths BOOLEAN NOT NULL DEFAULT 1;"
|
||||
|
||||
sSQL &= "PRAGMA user_version=115"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
If eDatabase = Database.Remote Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v110")
|
||||
|
||||
'Convert core path variables to new standard
|
||||
If Not mgrCommon.IsUnix Then
|
||||
sSQL = "UPDATE monitorlist SET Path = Replace(Path,'*appdatalocal*','%LOCALAPPDATA%');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*appdataroaming*','%APPDATA%');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*mydocs*','%USERDOCUMENTS%');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*currentuser*','%USERPROFILE%');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*publicdocs*','%COMMONDOCUMENTS%');"
|
||||
Else
|
||||
sSQL = "UPDATE monitorlist SET Path = Replace(Path,'*appdatalocal*','${XDG_DATA_HOME:-~/.local/share}');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*appdataroaming*','${XDG_CONFIG_HOME:-~/.config}');"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*mydocs*','~');"
|
||||
End If
|
||||
|
||||
'Convert custom variables to new standard
|
||||
Dim hshVariables As Hashtable = mgrVariables.ReadVariables()
|
||||
Dim sOldVariable As String
|
||||
For Each oVariable As clsPathVariable In hshVariables.Values
|
||||
sOldVariable = "*" & oVariable.Name & "*"
|
||||
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'" & sOldVariable & "','" & oVariable.FormattedName & "');"
|
||||
Next
|
||||
|
||||
sSQL &= "PRAGMA user_version=115"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
End If
|
||||
|
||||
'1.16 Upgrade
|
||||
If GetDatabaseVersion() < 116 Then
|
||||
If eDatabase = Database.Local Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v115")
|
||||
|
||||
'Add new field(s)
|
||||
sSQL = "ALTER TABLE monitorlist ADD COLUMN RecurseSubFolders BOOLEAN NOT NULL DEFAULT 1;"
|
||||
sSQL &= "PRAGMA user_version=116"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
If eDatabase = Database.Remote Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v115")
|
||||
|
||||
'Add new field(s)
|
||||
sSQL = "ALTER TABLE monitorlist ADD COLUMN RecurseSubFolders BOOLEAN NOT NULL DEFAULT 1;"
|
||||
sSQL &= "PRAGMA user_version=116"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Public Function GetDBSize() As Long
|
||||
|
||||
@@ -25,10 +25,13 @@ Public Class mgrSettings
|
||||
Private bBackupOnLaunch As Boolean = True
|
||||
Private bUseGameID As Boolean = False
|
||||
Private bDisableSyncMessages As Boolean = True
|
||||
Private bShowResolvedPaths As Boolean = True
|
||||
|
||||
<Flags()> Public Enum eSuppressMessages
|
||||
None = 0
|
||||
GameIDSync = 1
|
||||
BackupImport = 2
|
||||
WinConfigsInLinux = 4
|
||||
End Enum
|
||||
|
||||
Property StartWithWindows As Boolean
|
||||
@@ -175,6 +178,15 @@ Public Class mgrSettings
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property ShowResolvedPaths As Boolean
|
||||
Get
|
||||
Return bShowResolvedPaths
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
bShowResolvedPaths = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
ReadOnly Property Prepared7zArguments As String
|
||||
Get
|
||||
'Prepare custom 7z arguments
|
||||
@@ -309,7 +321,7 @@ Public Class mgrSettings
|
||||
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @StartWithWindows, "
|
||||
sSQL &= "@TimeTracking, @SuppressBackup, @SuppressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, "
|
||||
sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking, @SuppressMessages, @BackupOnLaunch, @UseGameID, "
|
||||
sSQL &= "@DisableSyncMessages)"
|
||||
sSQL &= "@DisableSyncMessages, @ShowResolvedPaths)"
|
||||
|
||||
hshParams.Add("MonitorOnStartup", MonitorOnStartup)
|
||||
hshParams.Add("StartToTray", StartToTray)
|
||||
@@ -335,6 +347,7 @@ Public Class mgrSettings
|
||||
hshParams.Add("BackupOnLaunch", BackupOnLaunch)
|
||||
hshParams.Add("UseGameID", UseGameID)
|
||||
hshParams.Add("DisableSyncMessages", DisableSyncMessages)
|
||||
hshParams.Add("ShowResolvedPaths", ShowResolvedPaths)
|
||||
|
||||
oDatabase.RunParamQuery(sSQL, hshParams)
|
||||
End Sub
|
||||
@@ -374,6 +387,7 @@ Public Class mgrSettings
|
||||
BackupOnLaunch = CBool(dr("BackupOnLaunch"))
|
||||
UseGameID = CBool(dr("UseGameID"))
|
||||
DisableSyncMessages = CBool(dr("DisableSyncMessages"))
|
||||
ShowResolvedPaths = CBool(dr("ShowResolvedPaths"))
|
||||
Next
|
||||
|
||||
oDatabase.Disconnect()
|
||||
|
||||
@@ -154,4 +154,30 @@
|
||||
|
||||
Return hshList
|
||||
End Function
|
||||
|
||||
Public Shared Function GetReservedVariables() As List(Of String)
|
||||
Dim oList As New List(Of String)
|
||||
|
||||
oList.Add("APPDATA")
|
||||
oList.Add("LOCALAPPDATA")
|
||||
oList.Add("USERDOCUMENTS")
|
||||
oList.Add("COMMONDOCUMENTS")
|
||||
oList.Add("USERPROFILE")
|
||||
oList.Add("PROGRAMDATA")
|
||||
|
||||
Return oList
|
||||
End Function
|
||||
|
||||
Public Shared Function CheckForReservedVariables(ByVal sPath As String) As Boolean
|
||||
Dim s As String
|
||||
|
||||
For Each s In GetReservedVariables()
|
||||
s = "%" & s & "%"
|
||||
If sPath.Contains(s) Then
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
|
||||
Return False
|
||||
End Function
|
||||
End Class
|
||||
|
||||
@@ -41,6 +41,7 @@ Public Class mgrXML
|
||||
oGame.Parameter = g.Parameter
|
||||
oGame.Comments = g.Comments
|
||||
oGame.IsRegEx = g.IsRegEx
|
||||
oGame.RecurseSubFolders = g.RecurseSubFolders
|
||||
For Each t As Tag In g.Tags
|
||||
oGame.ImportTags.Add(t)
|
||||
Next
|
||||
|
||||
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
|
||||
' by using the '*' as shown below:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.1.4.*")>
|
||||
<Assembly: AssemblyFileVersion("1.1.4.0")>
|
||||
<Assembly: AssemblyVersion("1.1.6.*")>
|
||||
<Assembly: AssemblyFileVersion("1.1.6.0")>
|
||||
|
||||
<Assembly: NeutralResourcesLanguageAttribute("en")>
|
||||
Generated
+260
-8
@@ -1203,6 +1203,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Recurse Sub-Folders.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmFilter_FieldRecurseSubFolders() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmFilter_FieldRecurseSubFolders", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Save Multiple Backups.
|
||||
'''</summary>
|
||||
@@ -1410,6 +1419,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to 7-Zip.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_7zBackup() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_7zBackup", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] ([PARAM]).
|
||||
'''</summary>
|
||||
@@ -1465,7 +1483,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to &Cancel.
|
||||
''' Looks up a localized string similar to Ca&ncel.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_btnCancel() As String
|
||||
Get
|
||||
@@ -1555,7 +1573,16 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to In&clude Items....
|
||||
''' Looks up a localized string similar to Import B&ackup Files.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_btnImportBackup() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_btnImportBackup", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Incl&ude Items....
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_btnInclude() As String
|
||||
Get
|
||||
@@ -1599,6 +1626,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Pro&cesses....
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_btnProcesses() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_btnProcesses", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to &Restore.
|
||||
'''</summary>
|
||||
@@ -1627,7 +1663,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Tags....
|
||||
''' Looks up a localized string similar to &Tags....
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_btnTags() As String
|
||||
Get
|
||||
@@ -1689,6 +1725,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Choose compatible backup file(s).
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_Choose7zImport() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_Choose7zImport", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Choose a custom icon for the game.
|
||||
'''</summary>
|
||||
@@ -1779,6 +1824,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to &Linux....
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_cmsOfficialLinux() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_cmsOfficialLinux", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to &Windows....
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_cmsOfficialWindows() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_cmsOfficialWindows", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to run a backup for [PARAM]? This will close the form..
|
||||
'''</summary>
|
||||
@@ -1824,6 +1887,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to import the selected file(s) for [PARAM]. This will close the form..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_ConfirmBackupImport() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_ConfirmBackupImport", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Importing this backup file will overwrite the current backup file for [PARAM].[BR][BR]Do you want to continue? This will close the form..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_ConfirmBackupImportOverwriteSingle() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_ConfirmBackupImportOverwriteSingle", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to delete [PARAM]? This cannot be undone.[BR][BR]This will not delete any backup files that already exist for this game..
|
||||
'''</summary>
|
||||
@@ -2013,6 +2094,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to The backup folder contains one or more backup files that cannot be renamed to [PARAM] because a file using that name already exists.[BR][BR]Do you want to continue and remove the existing files?.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_ErrorRenameFilesExist() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_ErrorRenameFilesExist", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to The backup folder [PARAM] cannot be renamed to [PARAM] because a folder with that name already exists.[BR][BR]Do you want to continue and remove the existing folder?.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_ErrorRenameFolderExists() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_ErrorRenameFolderExists", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to You must enter a valid game name..
|
||||
'''</summary>
|
||||
@@ -2140,7 +2239,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to In&clude.
|
||||
''' Looks up a localized string similar to Incl&ude.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_IncludeShortcut() As String
|
||||
Get
|
||||
@@ -2382,6 +2481,33 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to This feature is intended to import 7-Zip backup archives compatible with the selected game configuration.[BR][BR]GBM does NOT verify these files, you should only use files created by GBM or compatible archives created using the same settings as the current game configuration.[BR][BR]This message will only be shown once..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_WarningImportBackup() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_WarningImportBackup", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to The "Save multiple backups" option must be enabled on this configuration to import multiple backup files..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_WarningImportBackupSaveMulti() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_WarningImportBackupSaveMulti", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions the first time the game is detected.[BR][BR]This message will only be shown once..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_WarningWinConfigsInLinux() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_WarningWinConfigsInLinux", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to XML.
|
||||
'''</summary>
|
||||
@@ -2598,6 +2724,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Recurse sub-folders.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmIncludeExclude_chkRecurseSubFolders() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmIncludeExclude_chkRecurseSubFolders", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Add Custom Item.
|
||||
'''</summary>
|
||||
@@ -2655,9 +2790,9 @@ Namespace My.Resources
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] Options.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmIncludeExclude_grpFileOptions() As String
|
||||
Friend ReadOnly Property frmIncludeExclude_grpOptions() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmIncludeExclude_grpFileOptions", resourceCulture)
|
||||
Return ResourceManager.GetString("frmIncludeExclude_grpOptions", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
@@ -2904,6 +3039,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Memory Allocation: [PARAM] MB.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmMain_DebugMemoryAllocation() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmMain_DebugMemoryAllocation", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Game Backup Monitor Log.
|
||||
'''</summary>
|
||||
@@ -3102,6 +3246,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Invalid mode([PARAM]) for command [PARAM]..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmMain_ErrorInvalidMode() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmMain_ErrorInvalidMode", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to The command [PARAM] requires more parameters..
|
||||
'''</summary>
|
||||
@@ -3858,6 +4011,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] Wine Prefix: [PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmMain_WinePrefix() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmMain_WinePrefix", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] Converted Save Path: [PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmMain_WineSavePath() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmMain_WineSavePath", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to +.
|
||||
'''</summary>
|
||||
@@ -4524,6 +4695,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Show resolved save paths in Game Manager.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_chkShowResolvedPaths() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_chkShowResolvedPaths", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Start to system tray.
|
||||
'''</summary>
|
||||
@@ -5343,6 +5523,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to [PARAM] is a reserved variable, you must enter a different name..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmVariableManager_ErrorVariableReserved() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmVariableManager_ErrorVariableReserved", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Custom Variable Manager.
|
||||
'''</summary>
|
||||
@@ -5682,6 +5871,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Failed to import [PARAM], the file could not be copied..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrBackup_ErrorImportBackupCopy() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrBackup_ErrorImportBackupCopy", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Backup aborted by user due to manifest conflict..
|
||||
'''</summary>
|
||||
@@ -5728,7 +5926,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Backup aborted. A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM].
|
||||
''' Looks up a localized string similar to A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrBackup_ErrorSubFolderCreate() As String
|
||||
Get
|
||||
@@ -5745,6 +5943,24 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Imported Backup.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrBackup_ImportedFile() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrBackup_ImportedFile", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Imported backup file [PARAM] for [PARAM]..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrBackup_ImportSuccess() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrBackup_ImportSuccess", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Available Disk Space: [PARAM].
|
||||
'''</summary>
|
||||
@@ -5962,7 +6178,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to This export file was created with a version of GBM prior to 1.1.0 and does not contain unique game identifiers.[BR][BR]Do you still want to import configurations from this file? (Not Recommended).
|
||||
''' Looks up a localized string similar to This export file was created with a version of GBM prior to 1.1.5 and may contain incompatible configuration data.[BR][BR]Do you still want to import configurations from this file? (Not Recommended).
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrMonitorList_ImportVersionWarning() As String
|
||||
Get
|
||||
@@ -6069,6 +6285,42 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An error occured when building a Wine path.[BR][BR][PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrPath_ErrorBuildingWinePath() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrPath_ErrorBuildingWinePath", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An error occured when converting to a Wine save path.[BR][BR][PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrPath_ErrorConvertWineSavePath() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrPath_ErrorConvertWineSavePath", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An error occured while building a list of environment variables.[BR][BR][PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrPath_ErrorUnixEnv() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrPath_ErrorUnixEnv", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An error occured when determining a Wine prefix.[BR][BR][PARAM].
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrPath_ErrorWinePrefix() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("mgrPath_ErrorWinePrefix", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to An error occured while determining a required system path. [BR][BR]The environment value for [PARAM] is empty.[BR][BR]The application will now exit..
|
||||
'''</summary>
|
||||
|
||||
@@ -431,7 +431,7 @@
|
||||
<value>&Backup</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnCancel" xml:space="preserve">
|
||||
<value>&Cancel</value>
|
||||
<value>Ca&ncel</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnClose" xml:space="preserve">
|
||||
<value>C&lose</value>
|
||||
@@ -455,7 +455,7 @@
|
||||
<value>&Import</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnInclude" xml:space="preserve">
|
||||
<value>In&clude Items...</value>
|
||||
<value>Incl&ude Items...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnMarkAsRestored" xml:space="preserve">
|
||||
<value>&Mark as Restored</value>
|
||||
@@ -479,7 +479,7 @@
|
||||
<value>...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnTags" xml:space="preserve">
|
||||
<value>Tags...</value>
|
||||
<value>&Tags...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_chkEnabled" xml:space="preserve">
|
||||
<value>Monitor this game</value>
|
||||
@@ -590,7 +590,7 @@
|
||||
<value>Include</value>
|
||||
</data>
|
||||
<data name="frmGameManager_IncludeShortcut" xml:space="preserve">
|
||||
<value>In&clude</value>
|
||||
<value>Incl&ude</value>
|
||||
</data>
|
||||
<data name="frmGameManager_Items" xml:space="preserve">
|
||||
<value>Items...</value>
|
||||
@@ -967,7 +967,7 @@
|
||||
<data name="frmIncludeExclude_FormName" xml:space="preserve">
|
||||
<value>[PARAM] Builder</value>
|
||||
</data>
|
||||
<data name="frmIncludeExclude_grpFileOptions" xml:space="preserve">
|
||||
<data name="frmIncludeExclude_grpOptions" xml:space="preserve">
|
||||
<value>[PARAM] Options</value>
|
||||
</data>
|
||||
<data name="frmIncludeExclude_lblItems" xml:space="preserve">
|
||||
@@ -1307,7 +1307,7 @@
|
||||
<value>[PARAM] backup aborted by user due to overwrite.</value>
|
||||
</data>
|
||||
<data name="mgrBackup_ErrorSubFolderCreate" xml:space="preserve">
|
||||
<value>Backup aborted. A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value>
|
||||
<value>A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="mgrBackup_GenerateHash" xml:space="preserve">
|
||||
<value>Generating SHA-256 hash for [PARAM] backup file.</value>
|
||||
@@ -2027,7 +2027,7 @@
|
||||
<value>This file cannot be used to sync game indentifiers. It was created with an older version of GBM.</value>
|
||||
</data>
|
||||
<data name="mgrMonitorList_ImportVersionWarning" xml:space="preserve">
|
||||
<value>This export file was created with a version of GBM prior to 1.1.0 and does not contain unique game identifiers.[BR][BR]Do you still want to import configurations from this file? (Not Recommended)</value>
|
||||
<value>This export file was created with a version of GBM prior to 1.1.5 and may contain incompatible configuration data.[BR][BR]Do you still want to import configurations from this file? (Not Recommended)</value>
|
||||
</data>
|
||||
<data name="mgrMonitorList_ConfirmFileGameIDSync" xml:space="preserve">
|
||||
<value>Do you want to sync your game identifiers with this export file?[BR][BR]You should only do this if you're managing your own game configurations. If you use GBM on multiple PCs, please see "Tools" section of the online manual before using this feature.</value>
|
||||
@@ -2197,4 +2197,88 @@
|
||||
<data name="frmMain_ErrorGameIcon" xml:space="preserve">
|
||||
<value>An error occured while extracting the executable icon.</value>
|
||||
</data>
|
||||
<data name="frmGameManager_ErrorRenameFilesExist" xml:space="preserve">
|
||||
<value>The backup folder contains one or more backup files that cannot be renamed to [PARAM] because a file using that name already exists.[BR][BR]Do you want to continue and remove the existing files?</value>
|
||||
</data>
|
||||
<data name="frmGameManager_ErrorRenameFolderExists" xml:space="preserve">
|
||||
<value>The backup folder [PARAM] cannot be renamed to [PARAM] because a folder with that name already exists.[BR][BR]Do you want to continue and remove the existing folder?</value>
|
||||
</data>
|
||||
<data name="frmMain_WinePrefix" xml:space="preserve">
|
||||
<value>[PARAM] Wine Prefix: [PARAM]</value>
|
||||
</data>
|
||||
<data name="frmMain_WineSavePath" xml:space="preserve">
|
||||
<value>[PARAM] Converted Save Path: [PARAM]</value>
|
||||
</data>
|
||||
<data name="mgrPath_ErrorBuildingWinePath" xml:space="preserve">
|
||||
<value>An error occured when building a Wine path.[BR][BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="mgrPath_ErrorConvertWineSavePath" xml:space="preserve">
|
||||
<value>An error occured when converting to a Wine save path.[BR][BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="mgrPath_ErrorWinePrefix" xml:space="preserve">
|
||||
<value>An error occured when determining a Wine prefix.[BR][BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="mgrPath_ErrorUnixEnv" xml:space="preserve">
|
||||
<value>An error occured while building a list of environment variables.[BR][BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="frmSettings_chkShowResolvedPaths" xml:space="preserve">
|
||||
<value>Show resolved save paths in Game Manager</value>
|
||||
</data>
|
||||
<data name="frmGameManager_7zBackup" xml:space="preserve">
|
||||
<value>7-Zip</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnImportBackup" xml:space="preserve">
|
||||
<value>Import B&ackup Files</value>
|
||||
</data>
|
||||
<data name="frmGameManager_Choose7zImport" xml:space="preserve">
|
||||
<value>Choose compatible backup file(s)</value>
|
||||
</data>
|
||||
<data name="frmGameManager_ConfirmBackupImport" xml:space="preserve">
|
||||
<value>Are you sure you want to import the selected file(s) for [PARAM]. This will close the form.</value>
|
||||
</data>
|
||||
<data name="mgrBackup_ErrorImportBackupCopy" xml:space="preserve">
|
||||
<value>Failed to import [PARAM], the file could not be copied.</value>
|
||||
</data>
|
||||
<data name="mgrBackup_ImportedFile" xml:space="preserve">
|
||||
<value>Imported Backup</value>
|
||||
</data>
|
||||
<data name="mgrBackup_ImportSuccess" xml:space="preserve">
|
||||
<value>Imported backup file [PARAM] for [PARAM].</value>
|
||||
</data>
|
||||
<data name="frmGameManager_btnProcesses" xml:space="preserve">
|
||||
<value>Pro&cesses...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_WarningImportBackup" xml:space="preserve">
|
||||
<value>This feature is intended to import 7-Zip backup archives compatible with the selected game configuration.[BR][BR]GBM does NOT verify these files, you should only use files created by GBM or compatible archives created using the same settings as the current game configuration.[BR][BR]This message will only be shown once.</value>
|
||||
</data>
|
||||
<data name="frmVariableManager_ErrorVariableReserved" xml:space="preserve">
|
||||
<value>[PARAM] is a reserved variable, you must enter a different name.</value>
|
||||
</data>
|
||||
<data name="frmGameManager_WarningImportBackupSaveMulti" xml:space="preserve">
|
||||
<value>The "Save multiple backups" option must be enabled on this configuration to import multiple backup files.</value>
|
||||
</data>
|
||||
<data name="frmGameManager_cmsOfficialLinux" xml:space="preserve">
|
||||
<value>&Linux...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_cmsOfficialWindows" xml:space="preserve">
|
||||
<value>&Windows...</value>
|
||||
</data>
|
||||
<data name="frmGameManager_WarningWinConfigsInLinux" xml:space="preserve">
|
||||
<value>Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions the first time the game is detected.[BR][BR]This message will only be shown once.</value>
|
||||
</data>
|
||||
<data name="frmGameManager_ConfirmBackupImportOverwriteSingle" xml:space="preserve">
|
||||
<value>Importing this backup file will overwrite the current backup file for [PARAM].[BR][BR]Do you want to continue? This will close the form.</value>
|
||||
</data>
|
||||
<data name="frmFilter_FieldRecurseSubFolders" xml:space="preserve">
|
||||
<value>Recurse Sub-Folders</value>
|
||||
</data>
|
||||
<data name="frmIncludeExclude_chkRecurseSubFolders" xml:space="preserve">
|
||||
<value>Recurse sub-folders</value>
|
||||
</data>
|
||||
<data name="frmMain_DebugMemoryAllocation" xml:space="preserve">
|
||||
<value>Memory Allocation: [PARAM] MB</value>
|
||||
</data>
|
||||
<data name="frmMain_ErrorInvalidMode" xml:space="preserve">
|
||||
<value>Invalid mode([PARAM]) for command [PARAM].</value>
|
||||
</data>
|
||||
</root>
|
||||
+18
-14
@@ -1,25 +1,29 @@
|
||||
Game Backup Monitor v1.1.4 Readme
|
||||
Game Backup Monitor v1.1.6 Readme
|
||||
http://mikemaximus.github.io/gbm-web/
|
||||
gamebackupmonitor@gmail.com
|
||||
|
||||
August 25th, 2018
|
||||
November 17, 2018
|
||||
|
||||
New in 1.1.4
|
||||
New in 1.1.6
|
||||
|
||||
All Platforms:
|
||||
|
||||
- Changed method of handling required OS environment paths and added a new path check on startup.
|
||||
- Incorrect conflict warnings will no longer be shown in some situations when running a backup configuration with "Save Multiple Backups" enabled.
|
||||
- Fixed the precision of "Total Hours" on the Session Viewer, it now always rounds to 2 decimal places.
|
||||
|
||||
Windows:
|
||||
|
||||
- GBM will no longer keep an open file handle on detected processes and custom icons.
|
||||
|
||||
- Added support for games that save to the Windows %PROGRAMDATA% location.
|
||||
- The Game Manager now automatically selects the last detected game when opened.
|
||||
- Backup files can no longer be imported into a "Monitor Only" configuration.
|
||||
- Optimized the memory and cpu usage of Regular Expressions when monitoring for games.
|
||||
- Added a "Recurse sub-folders" option
|
||||
- This option is set per game configuration, it is available on Include/Exclude window of the Game Manager and Add Game Wizard.
|
||||
- It is enabled by default on all current and new configurations.
|
||||
- Disabling this option prevents 7-Zip and GBM from scanning every sub-folder and file of a save path. This useful when backing up specific files inside an extremely large folder.
|
||||
- Fixed a possible issue with backups when the configuration uses folder path includes.
|
||||
|
||||
Linux:
|
||||
|
||||
- Sorting by "Hours" in the Session Viewer will no longer crash GBM on certain systems.
|
||||
- GBM no longer attempts to get icons from a Linux binary.
|
||||
- Removed compression from GBM icon to prevent issues with recent versions of imagemagick.
|
||||
- Fixed a memory leak issue with Mono and Regular Expressions.
|
||||
- Fixed some issues when detecting the prefix of Wine/Proton games.
|
||||
- The default prefix (~/.wine) will be assumed when a detected game does not have the WINEPREFIX variable set.
|
||||
- A prefix can now be fully detected when it contains spaces.
|
||||
- Windows configurations that use a relative save path are now properly converted when detected in Wine/Proton.
|
||||
|
||||
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html
|
||||
Reference in New Issue
Block a user