From 1f271dd9a8166066c00fce2be41efdb04b5e589a Mon Sep 17 00:00:00 2001 From: SvenGDK Date: Sun, 18 Aug 2024 20:03:12 +0200 Subject: [PATCH] Add Windows build Imported from PS Multi Tools v14.4 --- .gitignore | 6 + Windows/PS Classics fPKG Builder.sln | 25 + Windows/PS Classics fPKG Builder/App.config | 6 + .../PS Classics fPKG Builder/Application.xaml | 9 + .../Application.xaml.vb | 6 + .../My Project/AssemblyInfo.vb | 59 + .../My Project/MyExtensions/MyWpfExtension.vb | 121 ++ .../My Project/Resources.Designer.vb | 62 + .../My Project/Resources.resx | 117 ++ .../My Project/Settings.Designer.vb | 73 + .../My Project/Settings.settings | 7 + .../PS Classics fPKG Builder.vbproj | 163 +++ Windows/PS Classics fPKG Builder/PS1Game.vb | 35 + Windows/PS Classics fPKG Builder/PS2Game.vb | 61 + .../PSClassicsfPKGBuilder.xaml | 185 +++ .../PSClassicsfPKGBuilder.xaml.vb | 1217 +++++++++++++++++ Windows/PS Classics fPKG Builder/Utils.vb | 17 + .../PS Classics fPKG Builder/packages.config | 7 + Windows/PS Classics fPKG Builder/v14Icon.ico | Bin 0 -> 20257 bytes 19 files changed, 2176 insertions(+) create mode 100644 Windows/PS Classics fPKG Builder.sln create mode 100644 Windows/PS Classics fPKG Builder/App.config create mode 100644 Windows/PS Classics fPKG Builder/Application.xaml create mode 100644 Windows/PS Classics fPKG Builder/Application.xaml.vb create mode 100644 Windows/PS Classics fPKG Builder/My Project/AssemblyInfo.vb create mode 100644 Windows/PS Classics fPKG Builder/My Project/MyExtensions/MyWpfExtension.vb create mode 100644 Windows/PS Classics fPKG Builder/My Project/Resources.Designer.vb create mode 100644 Windows/PS Classics fPKG Builder/My Project/Resources.resx create mode 100644 Windows/PS Classics fPKG Builder/My Project/Settings.Designer.vb create mode 100644 Windows/PS Classics fPKG Builder/My Project/Settings.settings create mode 100644 Windows/PS Classics fPKG Builder/PS Classics fPKG Builder.vbproj create mode 100644 Windows/PS Classics fPKG Builder/PS1Game.vb create mode 100644 Windows/PS Classics fPKG Builder/PS2Game.vb create mode 100644 Windows/PS Classics fPKG Builder/PSClassicsfPKGBuilder.xaml create mode 100644 Windows/PS Classics fPKG Builder/PSClassicsfPKGBuilder.xaml.vb create mode 100644 Windows/PS Classics fPKG Builder/Utils.vb create mode 100644 Windows/PS Classics fPKG Builder/packages.config create mode 100644 Windows/PS Classics fPKG Builder/v14Icon.ico diff --git a/.gitignore b/.gitignore index ac6b652..77208fa 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,9 @@ fastlane/screenshots/**/*.png fastlane/test_output **/.DS_Store +*.suo +*.user +.vs +bin +obj +packages diff --git a/Windows/PS Classics fPKG Builder.sln b/Windows/PS Classics fPKG Builder.sln new file mode 100644 index 0000000..9121555 --- /dev/null +++ b/Windows/PS Classics fPKG Builder.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.10.35122.118 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "PS Classics fPKG Builder", "PS Classics fPKG Builder\PS Classics fPKG Builder.vbproj", "{39038E46-FDF1-4E8E-9524-427F8B5A7BD2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {39038E46-FDF1-4E8E-9524-427F8B5A7BD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39038E46-FDF1-4E8E-9524-427F8B5A7BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39038E46-FDF1-4E8E-9524-427F8B5A7BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39038E46-FDF1-4E8E-9524-427F8B5A7BD2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {09F10D6B-375A-41E1-9C86-04D9BABC2310} + EndGlobalSection +EndGlobal diff --git a/Windows/PS Classics fPKG Builder/App.config b/Windows/PS Classics fPKG Builder/App.config new file mode 100644 index 0000000..aee9adf --- /dev/null +++ b/Windows/PS Classics fPKG Builder/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Windows/PS Classics fPKG Builder/Application.xaml b/Windows/PS Classics fPKG Builder/Application.xaml new file mode 100644 index 0000000..2268017 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/Application.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/Windows/PS Classics fPKG Builder/Application.xaml.vb b/Windows/PS Classics fPKG Builder/Application.xaml.vb new file mode 100644 index 0000000..084cbe9 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/Application.xaml.vb @@ -0,0 +1,6 @@ +Class Application + + ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException + ' can be handled in this file. + +End Class diff --git a/Windows/PS Classics fPKG Builder/My Project/AssemblyInfo.vb b/Windows/PS Classics fPKG Builder/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..003309a --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/AssemblyInfo.vb @@ -0,0 +1,59 @@ +Imports System +Imports System.Globalization +Imports System.Reflection +Imports System.Resources +Imports System.Runtime.InteropServices +Imports System.Windows + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + +'In order to begin building localizable applications, set +'CultureYouAreCodingWith in your .vbproj file +'inside a . For example, if you are using US english +'in your source files, set the to "en-US". Then uncomment the +'NeutralResourceLanguage attribute below. Update the "en-US" in the line +'below to match the UICulture setting in the project file. + +' + + +'The ThemeInfo attribute describes where any theme specific and generic resource dictionaries can be found. +'1st parameter: where theme specific resource dictionaries are located +'(used if a resource is not found in the page, +' or application resource dictionaries) + +'2nd parameter: where the generic resource dictionary is located +'(used if a resource is not found in the page, +'app, and any theme specific resource dictionaries) + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/Windows/PS Classics fPKG Builder/My Project/MyExtensions/MyWpfExtension.vb b/Windows/PS Classics fPKG Builder/My Project/MyExtensions/MyWpfExtension.vb new file mode 100644 index 0000000..22f84b7 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/MyExtensions/MyWpfExtension.vb @@ -0,0 +1,121 @@ +#If _MyType <> "Empty" Then + +Namespace My + ''' + ''' Module used to define the properties that are available in the My Namespace for WPF + ''' + ''' + _ + Module MyWpfExtension + Private s_Computer As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Devices.Computer) + Private s_User As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.ApplicationServices.User) + Private s_Windows As New ThreadSafeObjectProvider(Of MyWindows) + Private s_Log As New ThreadSafeObjectProvider(Of Global.Microsoft.VisualBasic.Logging.Log) + ''' + ''' Returns the application object for the running application + ''' + _ + Friend ReadOnly Property Application() As Application + Get + Return CType(Global.System.Windows.Application.Current, Application) + End Get + End Property + ''' + ''' Returns information about the host computer. + ''' + _ + Friend ReadOnly Property Computer() As Global.Microsoft.VisualBasic.Devices.Computer + Get + Return s_Computer.GetInstance() + End Get + End Property + ''' + ''' Returns information for the current user. If you wish to run the application with the current + ''' Windows user credentials, call My.User.InitializeWithWindowsUser(). + ''' + _ + Friend ReadOnly Property User() As Global.Microsoft.VisualBasic.ApplicationServices.User + Get + Return s_User.GetInstance() + End Get + End Property + ''' + ''' Returns the application log. The listeners can be configured by the application's configuration file. + ''' + _ + Friend ReadOnly Property Log() As Global.Microsoft.VisualBasic.Logging.Log + Get + Return s_Log.GetInstance() + End Get + End Property + + ''' + ''' Returns the collection of Windows defined in the project. + ''' + _ + Friend ReadOnly Property Windows() As MyWindows + _ + Get + Return s_Windows.GetInstance() + End Get + End Property + _ + _ + Friend NotInheritable Class MyWindows + _ + Private Shared Function Create__Instance__(Of T As {New, Global.System.Windows.Window})(ByVal Instance As T) As T + If Instance Is Nothing Then + If s_WindowBeingCreated IsNot Nothing Then + If s_WindowBeingCreated.ContainsKey(GetType(T)) = True Then + Throw New Global.System.InvalidOperationException("The window cannot be accessed via My.Windows from the Window constructor.") + End If + Else + s_WindowBeingCreated = New Global.System.Collections.Hashtable() + End If + s_WindowBeingCreated.Add(GetType(T), Nothing) + Return New T() + s_WindowBeingCreated.Remove(GetType(T)) + Else + Return Instance + End If + End Function + _ + _ + Private Sub Dispose__Instance__(Of T As Global.System.Windows.Window)(ByRef instance As T) + instance = Nothing + End Sub + _ + _ + Public Sub New() + MyBase.New() + End Sub + Private Shared s_WindowBeingCreated As Global.System.Collections.Hashtable + Public Overrides Function Equals(ByVal o As Object) As Boolean + Return MyBase.Equals(o) + End Function + Public Overrides Function GetHashCode() As Integer + Return MyBase.GetHashCode + End Function + _ + _ + Friend Overloads Function [GetType]() As Global.System.Type + Return GetType(MyWindows) + End Function + Public Overrides Function ToString() As String + Return MyBase.ToString + End Function + End Class + End Module +End Namespace +Partial Class Application + Inherits Global.System.Windows.Application + _ + _ + Friend ReadOnly Property Info() As Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo + _ + Get + Return New Global.Microsoft.VisualBasic.ApplicationServices.AssemblyInfo(Global.System.Reflection.Assembly.GetExecutingAssembly()) + End Get + End Property +End Class +#End If \ No newline at end of file diff --git a/Windows/PS Classics fPKG Builder/My Project/Resources.Designer.vb b/Windows/PS Classics fPKG Builder/My Project/Resources.Designer.vb new file mode 100644 index 0000000..e7ecddc --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:$clrversion$ +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("$safeprojectname$.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/Windows/PS Classics fPKG Builder/My Project/Resources.resx b/Windows/PS Classics fPKG Builder/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Windows/PS Classics fPKG Builder/My Project/Settings.Designer.vb b/Windows/PS Classics fPKG Builder/My Project/Settings.Designer.vb new file mode 100644 index 0000000..cb87530 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.PS_Classics_fPKG_Builder.My.MySettings + Get + Return Global.PS_Classics_fPKG_Builder.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/Windows/PS Classics fPKG Builder/My Project/Settings.settings b/Windows/PS Classics fPKG Builder/My Project/Settings.settings new file mode 100644 index 0000000..40ed9fd --- /dev/null +++ b/Windows/PS Classics fPKG Builder/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Windows/PS Classics fPKG Builder/PS Classics fPKG Builder.vbproj b/Windows/PS Classics fPKG Builder/PS Classics fPKG Builder.vbproj new file mode 100644 index 0000000..18a5e3b --- /dev/null +++ b/Windows/PS Classics fPKG Builder/PS Classics fPKG Builder.vbproj @@ -0,0 +1,163 @@ + + + + Debug + AnyCPU + {39038E46-FDF1-4E8E-9524-427F8B5A7BD2} + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{F184B08F-C81C-45F6-A57F-5ABD9991F28F} + WinExe + PS_Classics_fPKG_Builder + PS Classics fPKG Builder + v4.8.1 + Custom + true + true + + + AnyCPU + true + full + true + true + true + bin\Debug\ + PS Classics fPKG Builder.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + false + + + AnyCPU + pdbonly + false + false + true + false + true + bin\Release\ + PS Classics fPKG Builder.xml + 41999,42016,42017,42018,42019,42020,42021,42022,42032,42036,42314 + false + + + On + + + Binary + + + Off + + + On + + + v14Icon.ico + + + + ..\packages\DiscUtils.Core.0.16.13\lib\net45\DiscUtils.Core.dll + + + ..\packages\DiscUtils.Iso9660.0.16.13\lib\net45\DiscUtils.Iso9660.dll + + + ..\packages\DiscUtils.Streams.0.16.13\lib\net45\DiscUtils.Streams.dll + + + ..\packages\DiscUtils.Udf.0.16.13\lib\net45\DiscUtils.Udf.dll + + + ..\..\..\..\Desktop\Classics\PS2\LibOrbisPkg.dll + + + + + + + + + + + 4.0 + + + + + + + + + MSBuild:Compile + Designer + + + + + PSClassicsfPKGBuilder.xaml + + + Application.xaml + Code + + + + MSBuild:Compile + Designer + + + + + + + + + + + + + + + + + + + + + + + + Code + + + Microsoft.VisualBasic.WPF.MyExtension + 1.0.0.0 + + + True + True + Resources.resx + + + True + Settings.settings + True + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + + + SettingsSingleFileGenerator + Settings.Designer.vb + + + + + + + + + + + \ No newline at end of file diff --git a/Windows/PS Classics fPKG Builder/PS1Game.vb b/Windows/PS Classics fPKG Builder/PS1Game.vb new file mode 100644 index 0000000..55b4bb9 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/PS1Game.vb @@ -0,0 +1,35 @@ +Imports System.IO + +Public Class PS1Game + + Public Shared Function GetPS1GameTitleFromDatabaseList(GameID As String) As String + Dim FoundGameTitle As String = "" + + For Each GameTitle As String In File.ReadLines(My.Computer.FileSystem.CurrentDirectory + "\Tools\ps1ids.txt") + If GameTitle.Contains(GameID) Then + FoundGameTitle = GameTitle.Split(";"c)(1) + Exit For + End If + Next + + If String.IsNullOrEmpty(FoundGameTitle) Then + Return "" + Else + Return FoundGameTitle + End If + End Function + + Public Shared Function IsGameProtected(GameID As String) As String + Dim FoundValue As String = "" + + For Each GameIDInFile As String In File.ReadLines(My.Computer.FileSystem.CurrentDirectory + "\Tools\libcrypt.txt") + If GameIDInFile.Contains(GameID) Then + FoundValue = GameIDInFile.Split(" "c)(1) + Exit For + End If + Next + + Return FoundValue + End Function + +End Class diff --git a/Windows/PS Classics fPKG Builder/PS2Game.vb b/Windows/PS Classics fPKG Builder/PS2Game.vb new file mode 100644 index 0000000..669b3c0 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/PS2Game.vb @@ -0,0 +1,61 @@ +Imports System.IO + +Public Class PS2Game + + Public Shared Function GetPS2GameID(GameISO As String) As String + Dim GameID As String = "" + + Using SevenZip As New Process() + SevenZip.StartInfo.FileName = My.Computer.FileSystem.CurrentDirectory + "\Tools\7z.exe" + SevenZip.StartInfo.Arguments = "l -ba """ + GameISO + """" + SevenZip.StartInfo.RedirectStandardOutput = True + SevenZip.StartInfo.UseShellExecute = False + SevenZip.StartInfo.CreateNoWindow = True + SevenZip.Start() + + 'Read the output + Dim OutputReader As StreamReader = SevenZip.StandardOutput + Dim ProcessOutput As String() = OutputReader.ReadToEnd().Split(New String() {vbCrLf}, StringSplitOptions.None) + + If ProcessOutput.Length > 0 Then + For Each Line As String In ProcessOutput + If Line.Contains("SLES_") Or Line.Contains("SLUS_") Or Line.Contains("SCES_") Or Line.Contains("SCUS_") Then + If Line.Contains("Volume:") Then 'ID found in the ISO Header + If Line.Split(New String() {"Volume: "}, StringSplitOptions.RemoveEmptyEntries).Length > 0 Then + GameID = Line.Split(New String() {"Volume: "}, StringSplitOptions.RemoveEmptyEntries)(1) + Exit For + End If + Else 'ID found in the ISO files + If String.Join(" ", Line.Split(New Char() {}, StringSplitOptions.RemoveEmptyEntries)).Split(" "c).Length > 4 Then + GameID = String.Join(" ", Line.Split(New Char() {}, StringSplitOptions.RemoveEmptyEntries)).Split(" "c)(5).Trim() + Exit For + End If + End If + End If + Next + End If + + End Using + + Return GameID + End Function + + Public Shared Function GetPS2GameTitleFromDatabaseList(GameID As String) As String + Dim FoundGameTitle As String = "" + GameID = GameID.Replace("-", "") + + For Each GameTitle As String In File.ReadLines(My.Computer.FileSystem.CurrentDirectory + "\Tools\ps2ids.txt") + If GameTitle.Contains(GameID) Then + FoundGameTitle = GameTitle.Split(";"c)(1) + Exit For + End If + Next + + If String.IsNullOrEmpty(FoundGameTitle) Then + Return "Unknown PS2 game" + Else + Return FoundGameTitle + End If + End Function + +End Class diff --git a/Windows/PS Classics fPKG Builder/PSClassicsfPKGBuilder.xaml b/Windows/PS Classics fPKG Builder/PSClassicsfPKGBuilder.xaml new file mode 100644 index 0000000..b039536 --- /dev/null +++ b/Windows/PS Classics fPKG Builder/PSClassicsfPKGBuilder.xaml @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + +