From d0c2c242c2604b5fde7b5a4ce3df1edda39ae112 Mon Sep 17 00:00:00 2001 From: Logue Date: Sat, 9 Oct 2021 09:47:38 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=83=AA?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=81=8B=E3=82=89=E3=82=A2=E3=83=B3=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=92=E5=AE=9F=E8=A3=85=20=E5=87=A6?= =?UTF-8?q?=E7=90=86=E4=B8=AD=E3=81=AF=E3=83=97=E3=83=AD=E3=82=B0=E3=83=AC?= =?UTF-8?q?=E3=82=B9=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=8C=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20?= =?UTF-8?q?=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NgsPacker (Package).wapproj | 42 +++++---- NgsPacker (Package)/Package.appxmanifest | 15 ++- NgsPacker.sln | 94 +++++++++---------- NgsPacker/App.xaml.cs | 2 - NgsPacker/Interfaces/IZamboniService.cs | 5 +- NgsPacker/Models/AppAssemblyModel.cs | 1 + NgsPacker/Models/IceEntryModel.cs | 7 ++ NgsPacker/NgsPacker.csproj | 1 - NgsPacker/Properties/Resources.Designer.cs | 27 ++++++ NgsPacker/Properties/Resources.ja.resx | 9 ++ NgsPacker/Properties/Resources.resx | 9 ++ NgsPacker/Services/ZamboniService.cs | 64 +++++++++---- NgsPacker/ViewModels/PackPageViewModel.cs | 17 +--- NgsPacker/ViewModels/ShellWindowViewModel.cs | 3 +- NgsPacker/ViewModels/UnpackPageViewModel.cs | 67 +++++++++---- NgsPacker/Views/AboutPage.xaml | 2 +- NgsPacker/Views/ProgressDialog.xaml | 22 +++++ NgsPacker/Views/ProgressDialog.xaml.cs | 22 +++++ NgsPacker/Views/ShellWindow.xaml | 2 +- NgsPacker/Views/UnpackPage.xaml | 4 +- 20 files changed, 285 insertions(+), 130 deletions(-) create mode 100644 NgsPacker/Views/ProgressDialog.xaml create mode 100644 NgsPacker/Views/ProgressDialog.xaml.cs diff --git a/NgsPacker (Package)/NgsPacker (Package).wapproj b/NgsPacker (Package)/NgsPacker (Package).wapproj index 0c16709..0fa0d97 100644 --- a/NgsPacker (Package)/NgsPacker (Package).wapproj +++ b/NgsPacker (Package)/NgsPacker (Package).wapproj @@ -45,54 +45,62 @@ AnyCPU - - bin\AnyCPU\Debug\ - Always - $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ - 65fae3e8-f0eb-4f60-a6d2-d2f2dbbbdab5 + 9b4f198f-785a-4203-ac41-ce8aa6c28217 10.0.20348.0 10.0.19041.0 ja-JP - True + false + $(NoWarn);NU1702 ..\NgsPacker\NgsPacker.csproj False - True + False True - x86|x64 + x64 0 - 8616CBCE40C15B2316729D3165331EE73E26CB5D - SHA256 - + + en + Always + + + en Always + en Always - + + en + Always + + + en Always + en Always + en Always - + + en Always - + + en Always - Always - - + en Always diff --git a/NgsPacker (Package)/Package.appxmanifest b/NgsPacker (Package)/Package.appxmanifest index 4b19dfc..628f71e 100644 --- a/NgsPacker (Package)/Package.appxmanifest +++ b/NgsPacker (Package)/Package.appxmanifest @@ -7,13 +7,13 @@ IgnorableNamespaces="uap rescap"> + Name="afcfe12b-ae80-4b8e-84c2-e6fd58edfaf6" + Publisher="CN=logue" + Version="1.2.0.0" /> NgsPacker (Package) - Logue + logue Images\StoreLogo.png @@ -21,6 +21,11 @@ + + + + + - + diff --git a/NgsPacker.sln b/NgsPacker.sln index 486030f..6f85f80 100644 --- a/NgsPacker.sln +++ b/NgsPacker.sln @@ -18,10 +18,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ZamboniLib", "ZamboniLib\ZamboniLib\ZamboniLib.csproj", "{38B71E78-7E24-4D28-92CD-2F12204D2B33}" EndProject -Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "NgsPacker (Package)", "NgsPacker (Package)\NgsPacker (Package).wapproj", "{65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ooz", "ZamboniLib\ooz-sys\ooz.vcxproj", "{B6748219-A0E7-46BB-AE38-5343961CB36A}" EndProject +Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "NgsPacker (Package)", "NgsPacker (Package)\NgsPacker (Package).wapproj", "{9B4F198F-785A-4203-AC41-CE8AA6C28217}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -101,51 +101,6 @@ Global {38B71E78-7E24-4D28-92CD-2F12204D2B33}.Release|x64.Build.0 = Release|Any CPU {38B71E78-7E24-4D28-92CD-2F12204D2B33}.Release|x86.ActiveCfg = Release|Any CPU {38B71E78-7E24-4D28-92CD-2F12204D2B33}.Release|x86.Build.0 = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|ARM.ActiveCfg = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|ARM.Build.0 = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|ARM.Deploy.0 = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|arm64.ActiveCfg = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|arm64.Build.0 = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|arm64.Deploy.0 = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x64.ActiveCfg = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x64.Build.0 = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x64.Deploy.0 = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x86.ActiveCfg = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x86.Build.0 = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Debug|x86.Deploy.0 = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|Any CPU.ActiveCfg = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|Any CPU.Build.0 = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|Any CPU.Deploy.0 = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|ARM.ActiveCfg = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|ARM.Build.0 = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|ARM.Deploy.0 = Debug|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|arm64.ActiveCfg = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|arm64.Build.0 = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|arm64.Deploy.0 = Debug|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x64.ActiveCfg = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x64.Build.0 = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x64.Deploy.0 = Debug|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x86.ActiveCfg = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x86.Build.0 = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Experimental|x86.Deploy.0 = Debug|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|Any CPU.Build.0 = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|Any CPU.Deploy.0 = Release|Any CPU - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|ARM.ActiveCfg = Release|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|ARM.Build.0 = Release|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|ARM.Deploy.0 = Release|ARM - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|arm64.ActiveCfg = Release|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|arm64.Build.0 = Release|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|arm64.Deploy.0 = Release|ARM64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x64.ActiveCfg = Release|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x64.Build.0 = Release|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x64.Deploy.0 = Release|x64 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x86.ActiveCfg = Release|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x86.Build.0 = Release|x86 - {65FAE3E8-F0EB-4F60-A6D2-D2F2DBBBDAB5}.Release|x86.Deploy.0 = Release|x86 {B6748219-A0E7-46BB-AE38-5343961CB36A}.Debug|Any CPU.ActiveCfg = Debug|Win32 {B6748219-A0E7-46BB-AE38-5343961CB36A}.Debug|ARM.ActiveCfg = Debug|Win32 {B6748219-A0E7-46BB-AE38-5343961CB36A}.Debug|arm64.ActiveCfg = Debug|Win32 @@ -170,6 +125,51 @@ Global {B6748219-A0E7-46BB-AE38-5343961CB36A}.Release|x64.Build.0 = Release|x64 {B6748219-A0E7-46BB-AE38-5343961CB36A}.Release|x86.ActiveCfg = Release|Win32 {B6748219-A0E7-46BB-AE38-5343961CB36A}.Release|x86.Build.0 = Release|Win32 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|ARM.ActiveCfg = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|ARM.Build.0 = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|ARM.Deploy.0 = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|arm64.ActiveCfg = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|arm64.Build.0 = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|arm64.Deploy.0 = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x64.ActiveCfg = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x64.Build.0 = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x64.Deploy.0 = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x86.ActiveCfg = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x86.Build.0 = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Debug|x86.Deploy.0 = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|Any CPU.ActiveCfg = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|Any CPU.Build.0 = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|Any CPU.Deploy.0 = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|ARM.ActiveCfg = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|ARM.Build.0 = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|ARM.Deploy.0 = Debug|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|arm64.ActiveCfg = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|arm64.Build.0 = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|arm64.Deploy.0 = Debug|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x64.ActiveCfg = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x64.Build.0 = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x64.Deploy.0 = Debug|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x86.ActiveCfg = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x86.Build.0 = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Experimental|x86.Deploy.0 = Debug|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|Any CPU.Build.0 = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|Any CPU.Deploy.0 = Release|Any CPU + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|ARM.ActiveCfg = Release|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|ARM.Build.0 = Release|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|ARM.Deploy.0 = Release|ARM + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|arm64.ActiveCfg = Release|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|arm64.Build.0 = Release|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|arm64.Deploy.0 = Release|ARM64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x64.ActiveCfg = Release|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x64.Build.0 = Release|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x64.Deploy.0 = Release|x64 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x86.ActiveCfg = Release|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x86.Build.0 = Release|x86 + {9B4F198F-785A-4203-AC41-CE8AA6C28217}.Release|x86.Deploy.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/NgsPacker/App.xaml.cs b/NgsPacker/App.xaml.cs index 79a138f..59f9588 100644 --- a/NgsPacker/App.xaml.cs +++ b/NgsPacker/App.xaml.cs @@ -119,8 +119,6 @@ protected override void RegisterTypes(IContainerRegistry containerRegistry) /// protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { - // 進捗ダイアログモジュール - _ = moduleCatalog.AddModule(); } } } diff --git a/NgsPacker/Interfaces/IZamboniService.cs b/NgsPacker/Interfaces/IZamboniService.cs index 7efcacb..5c7b1e9 100644 --- a/NgsPacker/Interfaces/IZamboniService.cs +++ b/NgsPacker/Interfaces/IZamboniService.cs @@ -27,10 +27,9 @@ public interface IZamboniService /// 指定されたファイルをアンパックする /// /// 入力ファイルのパス - /// 出力先のパス + /// サブディレクトリを作成する /// グループ1と2で分ける - /// 解凍したファイルのバイナリ - public Task Unpack(string inputPath, string outputPath = null, bool sepalate = false); + public void Unpack(string inputPath, string outputPath = null, bool subdir = true, bool sepalate = false); /// /// ファイル一覧を取得 diff --git a/NgsPacker/Models/AppAssemblyModel.cs b/NgsPacker/Models/AppAssemblyModel.cs index c2613c9..9b69baf 100644 --- a/NgsPacker/Models/AppAssemblyModel.cs +++ b/NgsPacker/Models/AppAssemblyModel.cs @@ -4,6 +4,7 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. // // ----------------------------------------------------------------------- + using System.Reflection; namespace NgsPacker.Models diff --git a/NgsPacker/Models/IceEntryModel.cs b/NgsPacker/Models/IceEntryModel.cs index da0895f..cad54bd 100644 --- a/NgsPacker/Models/IceEntryModel.cs +++ b/NgsPacker/Models/IceEntryModel.cs @@ -1,3 +1,10 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) 2021 Masashi Yoshikawa All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. +// +// ----------------------------------------------------------------------- + namespace NgsPacker.Models { /// diff --git a/NgsPacker/NgsPacker.csproj b/NgsPacker/NgsPacker.csproj index bfd2d5a..256d0da 100644 --- a/NgsPacker/NgsPacker.csproj +++ b/NgsPacker/NgsPacker.csproj @@ -40,7 +40,6 @@ - diff --git a/NgsPacker/Properties/Resources.Designer.cs b/NgsPacker/Properties/Resources.Designer.cs index 7353fcf..1e596d4 100644 --- a/NgsPacker/Properties/Resources.Designer.cs +++ b/NgsPacker/Properties/Resources.Designer.cs @@ -242,6 +242,15 @@ public static string PackText { } } + /// + /// Please wait for a while ... に類似しているローカライズされた文字列を検索します。 + /// + public static string ProgressDialogText { + get { + return ResourceManager.GetString("ProgressDialogText", resourceCulture); + } + } + /// /// Path of pso2_bin Path: に類似しているローカライズされた文字列を検索します。 /// @@ -342,6 +351,15 @@ public static string ToggleThemeText { } } + /// + /// Select the list file that contains the list of files you want to unpack. に類似しているローカライズされた文字列を検索します。 + /// + public static string UnpackByFileListDialogText { + get { + return ResourceManager.GetString("UnpackByFileListDialogText", resourceCulture); + } + } + /// /// Batch unpacks only the files contained in the line-delimited file list. に類似しているローカライズされた文字列を検索します。 /// @@ -369,6 +387,15 @@ public static string UnpackDialogText { } } + /// + /// Select the PSO2 data file directory (win32 or win32_reboot). に類似しているローカライズされた文字列を検索します。 + /// + public static string UnpackDirectoryDialogText { + get { + return ResourceManager.GetString("UnpackDirectoryDialogText", resourceCulture); + } + } + /// /// To unzip the PSO2 data file, click the "Unpack" button, select the data file, and select the output destination directory in the next dialog. に類似しているローカライズされた文字列を検索します。 /// diff --git a/NgsPacker/Properties/Resources.ja.resx b/NgsPacker/Properties/Resources.ja.resx index 88fbbe4..b25ff7c 100644 --- a/NgsPacker/Properties/Resources.ja.resx +++ b/NgsPacker/Properties/Resources.ja.resx @@ -237,4 +237,13 @@ 保存 + + アンパックしたいファイルの一覧の入ったリストファイルを選択してください。 + + + PSO2のデータファイルのディレクトリ(win32かwin32_reboot)を選択してください。 + + + しばらくお待ち下さい… + \ No newline at end of file diff --git a/NgsPacker/Properties/Resources.resx b/NgsPacker/Properties/Resources.resx index c40d99a..688915b 100644 --- a/NgsPacker/Properties/Resources.resx +++ b/NgsPacker/Properties/Resources.resx @@ -241,4 +241,13 @@ Please select the correct directory. Save + + Select the list file that contains the list of files you want to unpack. + + + Select the PSO2 data file directory (win32 or win32_reboot). + + + Please wait for a while ... + \ No newline at end of file diff --git a/NgsPacker/Services/ZamboniService.cs b/NgsPacker/Services/ZamboniService.cs index ee1ab14..7e9ca58 100644 --- a/NgsPacker/Services/ZamboniService.cs +++ b/NgsPacker/Services/ZamboniService.cs @@ -37,6 +37,8 @@ public class ZamboniService : IZamboniService /// private readonly ILocalizerService LocalizerService; + private readonly Views.ProgressDialog progressDialog; + /// /// イベントアグリエイター /// @@ -53,6 +55,9 @@ public ZamboniService(ILocalizerService localizerService, IEventAggregator event LocalizerService = localizerService; EventAggregator = eventAggregator; + + + progressDialog = new Views.ProgressDialog(); } /// @@ -70,6 +75,7 @@ public async Task Pack(string inputPath, bool recursive = true, bool com { throw new DirectoryNotFoundException("ZamboniService: Input directory is not found."); } + _ = progressDialog.ShowAsync(); // ファイル一覧を取得 string[] files = recursive ? Directory.EnumerateFiles(inputPath, "*.*", SearchOption.AllDirectories).ToArray() : Directory.GetFiles(inputPath); @@ -91,7 +97,7 @@ public async Task Pack(string inputPath, bool recursive = true, bool com // int index = files.IndexOf(currentFile); // ファイルをバイト配列として読み込む - List file = new(File.ReadAllBytes(currentFile)); + List file = new(await File.ReadAllBytesAsync(currentFile)); // ヘッダを書き込む file.InsertRange(0, new IceFileHeader(currentFile, (uint)file.Count).GetBytes()); @@ -128,6 +134,8 @@ public async Task Pack(string inputPath, bool recursive = true, bool com throw new ZamboniException("An error occurred while generating the Ice file.", ex); } + progressDialog.Hide(); + return ret; } @@ -135,18 +143,21 @@ public async Task Pack(string inputPath, bool recursive = true, bool com /// 指定されたファイルをアンパックする /// /// 入力ファイルのパス + /// サブディレクトリを作成する /// グループ1と2で分ける - public Task Unpack(string inputPath, string outputPath = null, bool sepalate = false) + public async void Unpack(string inputPath, string outputPath = null, bool subdir = true, bool sepalate = false) { + _ = progressDialog.ShowAsync(); if (string.IsNullOrEmpty(outputPath)) { - outputPath = Directory.GetCurrentDirectory(); + outputPath = Environment.GetFolderPath(Environment.SpecialFolder.Personal); } + // Iceファイルを読み込む IceFile iceFile = LoadIceFile(inputPath); // 出力先のディレクトリ(ファイル名_ext) ※repack_ice.exeと同じ仕様 - string destinaton = outputPath + Path.DirectorySeparatorChar + Path.GetFileName(inputPath) + "_ext" + Path.DirectorySeparatorChar; + string destinaton = outputPath + (subdir ? Path.DirectorySeparatorChar + Path.GetFileName(inputPath) + "_ext" : "") + Path.DirectorySeparatorChar; // グループ1 List groupOneFiles = IceToFilelist(iceFile.groupOneFiles, true); @@ -162,39 +173,51 @@ public Task Unpack(string inputPath, string outputPath = null, bool sepalate = f throw new ZamboniException($"Neither group1 nor group2 was dumped from {Path.GetFileName(inputPath)}."); } - // 出力先のディレクトリ作成 - if (!Directory.Exists(destinaton)) - { - _ = Directory.CreateDirectory(destinaton); - } - if (sepalate) + if (subdir) { - if (!Directory.Exists(destinaton + Path.DirectorySeparatorChar + "group1")) + // 出力先のディレクトリ作成 + if (!Directory.Exists(destinaton)) { - _ = Directory.CreateDirectory(destinaton + Path.DirectorySeparatorChar + "group1"); + _ = Directory.CreateDirectory(destinaton); } - if (!Directory.Exists(destinaton + Path.DirectorySeparatorChar + "group2")) + if (sepalate) { - _ = Directory.CreateDirectory(destinaton + Path.DirectorySeparatorChar + "group2"); + if (!Directory.Exists(destinaton + Path.DirectorySeparatorChar + "group1")) + { + _ = Directory.CreateDirectory(destinaton + Path.DirectorySeparatorChar + "group1"); + } + if (!Directory.Exists(destinaton + Path.DirectorySeparatorChar + "group2")) + { + _ = Directory.CreateDirectory(destinaton + Path.DirectorySeparatorChar + "group2"); + } } } foreach (IceEntryModel model in groupOneFiles) { - Debug.WriteLine(model.FileName); int index = groupOneFiles.IndexOf(model); // ファイル名(ひどい可読性だ) string fileName = destinaton + (sepalate ? (model.Group == IceGroupEnum.GROUP1 ? "group1" : "group2") + Path.DirectorySeparatorChar : "") + model.FileName; + try + { + await File.WriteAllBytesAsync(fileName, model.Content); + } + catch (Exception ex) + { + Debug.WriteLine(ex.ToString()); + } + + /* using BinaryWriter writer = new(new FileStream(fileName, FileMode.Create)); - Task.Yield(); - writer.Write(model.Content); + await writer.WriteAsync(model.Content); writer.Close(); + */ } - return Task.CompletedTask; + progressDialog.Hide(); } /// @@ -204,6 +227,7 @@ public Task Unpack(string inputPath, string outputPath = null, bool sepalate = f /// CSV配列 public async Task> Filelist(string inputPath) { + _ = progressDialog.ShowAsync(); List ret = new(); List entries = new(Directory.EnumerateFiles(inputPath, "*.*", SearchOption.AllDirectories)); Debug.WriteLine("Entries: ", entries.Count); @@ -212,7 +236,8 @@ public async Task> Filelist(string inputPath) ret.Add("filename,version,group,content"); foreach (string path in entries) { - int index = entries.IndexOf(path); + Debug.WriteLine(path); + // int index = entries.IndexOf(path); if (path.Contains(".")) { @@ -275,6 +300,7 @@ public async Task> Filelist(string inputPath) } } } + progressDialog.Hide(); return ret; } diff --git a/NgsPacker/ViewModels/PackPageViewModel.cs b/NgsPacker/ViewModels/PackPageViewModel.cs index 9dafa36..a0a8fe3 100644 --- a/NgsPacker/ViewModels/PackPageViewModel.cs +++ b/NgsPacker/ViewModels/PackPageViewModel.cs @@ -13,7 +13,6 @@ using SourceChord.FluentWPF; using System; using System.IO; -using System.Threading.Tasks; using System.Windows.Forms; namespace NgsPacker.ViewModels @@ -59,11 +58,7 @@ public class PackPageViewModel : BindableBase public static string WhiteList { get => Properties.Settings.Default.WhiteList; - set - { - Properties.Settings.Default.WhiteList = value; - Properties.Settings.Default.Save(); - } + set => Properties.Settings.Default.WhiteList = value; } /// @@ -117,14 +112,10 @@ private async void ExecutePackCommand() return; } - _ = await Task.Run(async () => - { - // Iceで圧縮(結構重い) - byte[] iceStream = await ZamboniService.Pack(picker.ResultPath, IsCompress, IsCrypt); - await File.WriteAllBytesAsync(saveFileDialog.FileName, iceStream); - return Task.CompletedTask; - }); + // Iceで圧縮(結構重い) + byte[] iceStream = await ZamboniService.Pack(picker.ResultPath, IsCompress, IsCrypt); + await File.WriteAllBytesAsync(saveFileDialog.FileName, iceStream); // 完了通知 if (Properties.Settings.Default.NotifyComplete) diff --git a/NgsPacker/ViewModels/ShellWindowViewModel.cs b/NgsPacker/ViewModels/ShellWindowViewModel.cs index c0180a7..c4276f8 100644 --- a/NgsPacker/ViewModels/ShellWindowViewModel.cs +++ b/NgsPacker/ViewModels/ShellWindowViewModel.cs @@ -74,7 +74,8 @@ public ShellWindowViewModel(IRegionManager regionManager, ILocalizerService loca if (!File.Exists(Properties.Settings.Default.Pso2BinPath + Path.DirectorySeparatorChar + "pso2.exe")) { - _ = AcrylicMessageBox.Show(System.Windows.Application.Current.MainWindow, + // pso.exe存在確認チェック + _ = AcrylicMessageBox.Show(Application.Current.MainWindow, LocalizerService.GetLocalizedString("Pso2ExeNotFoundErrorText"), LocalizerService.GetLocalizedString("ErrorTitleText")); // 設定ページに遷移 RegionManager.RequestNavigate("ContentRegion", Pages["SettingsItem"]); diff --git a/NgsPacker/ViewModels/UnpackPageViewModel.cs b/NgsPacker/ViewModels/UnpackPageViewModel.cs index 114e74e..ba1a3ce 100644 --- a/NgsPacker/ViewModels/UnpackPageViewModel.cs +++ b/NgsPacker/ViewModels/UnpackPageViewModel.cs @@ -14,7 +14,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.Threading.Tasks; using System.Windows.Forms; namespace NgsPacker.ViewModels @@ -65,7 +64,6 @@ public UnpackPageViewModel(ILocalizerService localizerService, IZamboniService z ExportFilelistCommand = new DelegateCommand(ExecuteExportFilelistCommand); UnpackByFilelistCommand = new DelegateCommand(ExecuteUnpackByFilelistCommand); - // サービスのインジェクション LocalizerService = localizerService; ZamboniService = zamboniService; @@ -74,7 +72,7 @@ public UnpackPageViewModel(ILocalizerService localizerService, IZamboniService z /// /// アンパック処理 /// - private async void ExecuteUnpackCommand() + private void ExecuteUnpackCommand() { // ファイルを開くダイアログ using OpenFileDialog openFileDialog = new() @@ -102,12 +100,8 @@ private async void ExecuteUnpackCommand() return; } - _ = await Task.Run(async () => - { - await ZamboniService.Unpack(openFileDialog.FileName, picker.ResultPath, IsSepareteByGroup); - return Task.CompletedTask; - }); - + // アンパック + ZamboniService.Unpack(openFileDialog.FileName, picker.ResultPath, true, IsSepareteByGroup); // 完了通知 if (Properties.Settings.Default.NotifyComplete) @@ -132,6 +126,7 @@ private async void ExecuteExportFilelistCommand() { // フォルダ選択ダイアログ FolderPicker picker = new(); + picker.InputPath = Properties.Settings.Default.Pso2BinPath; // 出力先ファイルダイアログを表示 if (picker.ShowDialog() != true) @@ -155,12 +150,9 @@ private async void ExecuteExportFilelistCommand() return; } - _ = await Task.Run(async () => - { - List list = new(await ZamboniService.Filelist(picker.ResultPath)); - await File.WriteAllTextAsync(saveFileDialog.FileName, string.Join("\r\n", list)); - return Task.CompletedTask; - }); + // 出力処理 + List list = new(await ZamboniService.Filelist(picker.ResultPath)); + await File.WriteAllTextAsync(saveFileDialog.FileName, string.Join("\r\n", list)); // 完了通知 if (Properties.Settings.Default.NotifyComplete) @@ -181,12 +173,13 @@ private async void ExecuteExportFilelistCommand() /// /// ファイルリストからアンパックする /// - private void ExecuteUnpackByFilelistCommand() + private async void ExecuteUnpackByFilelistCommand() { // ファイルを開くダイアログ using OpenFileDialog openFileDialog = new() { - Title = LocalizerService.GetLocalizedString("UnpackByFileListText"), + Title = LocalizerService.GetLocalizedString("UnpackByFileListDialogText"), + InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal), }; // ダイアログを表示 @@ -199,12 +192,52 @@ private void ExecuteUnpackByFilelistCommand() // フォルダ選択ダイアログ FolderPicker picker = new(); + picker.Title = LocalizerService.GetLocalizedString("UnpackDirectoryDialogText"); + picker.InputPath = Properties.Settings.Default.Pso2BinPath; // 出力先ファイルダイアログを表示 if (picker.ShowDialog() != true) { return; } + + // ファイル一覧を読み込む + List fileList = new(await File.ReadAllLinesAsync(openFileDialog.FileName)); + + // 出力先ディレクトリ + string outputPath = Path.GetDirectoryName(openFileDialog.FileName) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(openFileDialog.FileName); + + if (!Directory.Exists(outputPath)) + { + Directory.CreateDirectory(outputPath); + } + + foreach (string file in fileList) + { + string path = picker.ResultPath + Path.DirectorySeparatorChar + file; + if (!File.Exists(path)) + { + // ファイルが存在しないときスキップ + continue; + } + // アンパック + ZamboniService.Unpack(path, outputPath, false); + } + + // 完了通知 + if (Properties.Settings.Default.NotifyComplete) + { + // トースト通知 + new ToastContentBuilder() + .AddText(LocalizerService.GetLocalizedString("UnpackByFileListText")) + .AddText(LocalizerService.GetLocalizedString("CompleteText")) + .Show(); + } + else + { + _ = AcrylicMessageBox.Show(System.Windows.Application.Current.MainWindow, + LocalizerService.GetLocalizedString("UnpackByFileListText"), LocalizerService.GetLocalizedString("CompleteText")); + } } } } diff --git a/NgsPacker/Views/AboutPage.xaml b/NgsPacker/Views/AboutPage.xaml index 7fa97bb..fb17687 100644 --- a/NgsPacker/Views/AboutPage.xaml +++ b/NgsPacker/Views/AboutPage.xaml @@ -47,7 +47,7 @@