59 Commits

Author SHA1 Message Date
Bruce
32a48c5e41 Update manager 2026-04-11 23:27:59 +08:00
Bruce
ed0920b21b Fix a bug. 2026-04-11 22:42:04 +08:00
Bruce
5378e3d54b Update locale string. 2026-04-11 22:31:25 +08:00
Bruce
87beb7af51 Update reader 2026-04-11 20:53:10 +08:00
Bruce
4993fd9968 Update changes. 2026-04-11 20:46:51 +08:00
Bruce
1df420c437 Fix the configures of projects. 2026-04-11 20:33:32 +08:00
Bruce
994a53a00b Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-11 20:21:32 +08:00
Bruce
179ae49d20 Update locale strings. 2026-04-11 20:21:27 +08:00
modernw
c0dac1ac7f Merge pull request #2 from bingtangxh/master
Add x86 build configs
2026-04-11 18:04:54 +08:00
modernw
687e18b80c Merge branch 'master' into master 2026-04-11 17:55:00 +08:00
Bruce
598007f177 2026-04-11 16:27:33 +08:00
Bruce
7552ffed35 Fix the obtain of locale resource. (Capability Names) 2026-04-11 16:17:03 +08:00
Bruce
8227689e6a Update configures. 2026-04-11 14:25:37 +08:00
Bruce
d170a9196d Update the build configure. 2026-04-11 13:52:09 +08:00
Bruce
f5edaf2f23 Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-10 23:13:00 +08:00
Bruce
1ef31d54c8 Update version. 2026-04-10 23:12:54 +08:00
冰糖XH
0cabf43e17 Merge branch 'modernw:master' into master 2026-04-10 23:01:59 +08:00
modernw
f98c57ef3a Update .NET Framework version in README 2026-04-10 20:25:07 +08:00
modernw
84f89f3464 Update README with x86 runtime library note
Added note about x86 runtime library installation requirements.
2026-04-10 20:24:35 +08:00
modernw
f36351c009 Update README.md 2026-04-10 18:27:11 +08:00
Bruce
f44589009c Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-10 17:58:37 +08:00
Bruce
868fb8b3e8 Change the version of WinJS 1.0. 2026-04-10 17:58:31 +08:00
modernw
e1d89a022e Update README.md 2026-04-10 15:29:54 +08:00
Bruce
10aa419e98 Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-10 15:28:49 +08:00
Bruce
db20b3bc4e Remove Tools for fork conveniently. 2026-04-10 15:28:46 +08:00
modernw
de33c438b6 Update download link for Runtime Libraries 2026-04-10 15:26:01 +08:00
modernw
1f9635255e Update README.md 2026-04-10 15:22:15 +08:00
modernw
3329058840 Update README.md 2026-04-10 15:18:20 +08:00
Bruce
ee5854c5a1 Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-10 15:17:07 +08:00
Bruce
471ce85cdf Pack as a zip file. 2026-04-10 15:17:02 +08:00
modernw
f28e3fe24c Update README with download links for runtime and dependencies
Added links to download runtime libraries and dependencies for Metro apps.
2026-04-10 15:16:23 +08:00
Bruce
169815e88a Update. 2026-04-10 15:10:39 +08:00
Bruce
2c6391804e Update style. 2026-04-10 14:18:04 +08:00
Bruce
fa65d40f3e Update font use. 2026-04-10 14:13:24 +08:00
Bruce
2fd73eab85 Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-10 14:08:22 +08:00
modernw
9111c019ff Update README.md 2026-04-10 14:00:51 +08:00
Bruce
200262d3ca Fix bugs. 2026-04-10 13:58:15 +08:00
Bruce
0f7c4be17e Revert "update."
This reverts commit c28c09973e.
2026-04-10 12:16:59 +08:00
Bruce
ded9ea9293 try to fix bugs. 2026-04-10 12:16:12 +08:00
冰糖XH
b131251a3b Merge branch 'modernw:master' into master 2026-04-10 10:55:58 +08:00
Bruce
f563f97f12 Try to fix bugs. 2026-04-10 10:50:22 +08:00
Bruce
19757502ae fix bugs. 2026-04-09 22:16:47 +08:00
Bruce
c28c09973e update. 2026-04-09 21:37:00 +08:00
Bruce
8dd01a67e9 Merge branch 'master' of https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git 2026-04-09 21:36:48 +08:00
Bruce
84a28db8cf Update locale resources. 2026-04-09 18:04:40 +08:00
modernw
b315782df6 Add special thanks section to README
Added a section for special thanks and contributor acknowledgment.
2026-04-09 15:39:16 +08:00
Bruce
9ba3b875da Update special thanks. 2026-04-09 14:10:57 +08:00
Bruce
9ae2e886bd Update special thanks. 2026-04-09 14:09:58 +08:00
Bruce
0926da3f27 Update license. 2026-04-09 13:34:09 +08:00
Bruce
4355ce4d13 Update help text. 2026-04-09 12:57:35 +08:00
Bruce
90d16151f4 pkgcli: add the confirm before remove. 2026-04-09 12:30:14 +08:00
Bruce
4bddb96052 Pkgcli: add the confirm before install. 2026-04-09 12:29:46 +08:00
Bruce
368efeb2f0 Update pkgcli. 2026-04-09 12:07:44 +08:00
Bruce
8e8a0453c4 Update PkgCLI. 2026-04-08 23:42:55 +08:00
Bruce
e58b47926c Canceled the settings of console input encoding. 2026-04-08 23:39:09 +08:00
Bruce
6d40668c1a Update version. 2026-04-08 23:35:14 +08:00
Bruce
71c8d76593 Fix bugs.
Update PkgCLI.
2026-04-08 23:32:11 +08:00
冰糖XH
76ce97370f Add x86 build configs; update .sln VS version
Update AppInstallerReset.sln to Visual Studio 17 and normalize project configuration/platform mappings. Add Debug|x86 and Release|x86 PropertyGroup entries to Bridge, DataUtils, Launch, ModernNotice, PriFileFormat, PrivateInit, Update and WAShell .csproj files to produce x86 outputs (bin\x86\...), set PlatformTarget to x86, LangVersion=7.3, and configure debug/optimization/define settings. These changes enable building x86 configurations and align projects with the updated solution environment.
2026-04-07 17:42:41 +08:00
Bruce
c4eaa4ad45 Change the styles of ContentDialog. 2026-04-06 20:43:20 +08:00
55 changed files with 5194 additions and 626 deletions

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
# Visual Studio Version 17
VisualStudioVersion = 17.14.37012.4 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pkgread", "pkgread\pkgread.vcxproj", "{A7753282-AA16-43D9-8ACA-7065239DD702}"
EndProject
@@ -81,273 +81,204 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PkgCLI", "PkgCLI\PkgCLI.csp
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A7753282-AA16-43D9-8ACA-7065239DD702}.Debug|Any CPU.ActiveCfg = Debug|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Debug|ARM.ActiveCfg = Debug|ARM
{A7753282-AA16-43D9-8ACA-7065239DD702}.Debug|ARM.Build.0 = Debug|ARM
{A7753282-AA16-43D9-8ACA-7065239DD702}.Debug|x86.ActiveCfg = Debug|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Debug|x86.Build.0 = Debug|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|Any CPU.ActiveCfg = Release|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|ARM.ActiveCfg = Release|ARM
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|ARM.Build.0 = Release|ARM
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|x86.ActiveCfg = Release|Win32
{A7753282-AA16-43D9-8ACA-7065239DD702}.Release|x86.Build.0 = Release|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Debug|Any CPU.ActiveCfg = Debug|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Debug|ARM.ActiveCfg = Debug|ARM
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Debug|ARM.Build.0 = Debug|ARM
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Debug|x86.ActiveCfg = Debug|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Debug|x86.Build.0 = Debug|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Release|Any CPU.ActiveCfg = Release|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Release|ARM.ActiveCfg = Release|ARM
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Release|ARM.Build.0 = Release|ARM
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Release|x86.ActiveCfg = Release|Win32
{8EAC0230-4990-4E41-8E0F-D641D1561396}.Release|x86.Build.0 = Release|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Debug|Any CPU.ActiveCfg = Debug|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Debug|ARM.ActiveCfg = Debug|ARM
{798ED492-EECE-457D-8FD8-129DA93CE126}.Debug|ARM.Build.0 = Debug|ARM
{798ED492-EECE-457D-8FD8-129DA93CE126}.Debug|x86.ActiveCfg = Debug|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Debug|x86.Build.0 = Debug|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Release|Any CPU.ActiveCfg = Release|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Release|ARM.ActiveCfg = Release|ARM
{798ED492-EECE-457D-8FD8-129DA93CE126}.Release|ARM.Build.0 = Release|ARM
{798ED492-EECE-457D-8FD8-129DA93CE126}.Release|x86.ActiveCfg = Release|Win32
{798ED492-EECE-457D-8FD8-129DA93CE126}.Release|x86.Build.0 = Release|Win32
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|ARM.Build.0 = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|x86.ActiveCfg = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|x86.Build.0 = Debug|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|Any CPU.Build.0 = Release|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|x86.ActiveCfg = Debug|x86
{EF4012D4-EF08-499C-B803-177739350B2D}.Debug|x86.Build.0 = Debug|x86
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|ARM.ActiveCfg = Release|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|ARM.Build.0 = Release|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|x86.ActiveCfg = Release|Any CPU
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|x86.Build.0 = Release|Any CPU
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Debug|Any CPU.ActiveCfg = Debug|Win32
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|x86.ActiveCfg = Release|x86
{EF4012D4-EF08-499C-B803-177739350B2D}.Release|x86.Build.0 = Release|x86
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Debug|ARM.ActiveCfg = Debug|ARM
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Debug|ARM.Build.0 = Debug|ARM
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Debug|x86.ActiveCfg = Debug|Win32
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Debug|x86.Build.0 = Debug|Win32
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Release|Any CPU.ActiveCfg = Release|Win32
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Release|ARM.ActiveCfg = Release|ARM
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Release|ARM.Build.0 = Release|ARM
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Release|x86.ActiveCfg = Release|Win32
{E04CCAB9-35DB-495C-A279-5B483C707CD0}.Release|x86.Build.0 = Release|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Debug|Any CPU.ActiveCfg = Debug|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Debug|ARM.ActiveCfg = Debug|ARM
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Debug|ARM.Build.0 = Debug|ARM
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Debug|x86.ActiveCfg = Debug|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Debug|x86.Build.0 = Debug|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Release|Any CPU.ActiveCfg = Release|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Release|ARM.ActiveCfg = Release|ARM
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Release|ARM.Build.0 = Release|ARM
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Release|x86.ActiveCfg = Release|Win32
{F0C84812-0CDF-4AA0-A0F8-F37AC833F39B}.Release|x86.Build.0 = Release|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Debug|Any CPU.ActiveCfg = Debug|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Debug|ARM.ActiveCfg = Debug|ARM
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Debug|ARM.Build.0 = Debug|ARM
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Debug|x86.ActiveCfg = Debug|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Debug|x86.Build.0 = Debug|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Release|Any CPU.ActiveCfg = Release|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Release|ARM.ActiveCfg = Release|ARM
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Release|ARM.Build.0 = Release|ARM
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Release|x86.ActiveCfg = Release|Win32
{AD25497F-A15F-4DFF-AC7A-B8ABF5F411D6}.Release|x86.Build.0 = Release|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Debug|Any CPU.ActiveCfg = Debug|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Debug|ARM.ActiveCfg = Debug|ARM
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Debug|ARM.Build.0 = Debug|ARM
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Debug|x86.ActiveCfg = Debug|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Debug|x86.Build.0 = Debug|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Release|Any CPU.ActiveCfg = Release|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Release|ARM.ActiveCfg = Release|ARM
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Release|ARM.Build.0 = Release|ARM
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Release|x86.ActiveCfg = Release|Win32
{3AE2A022-ED83-41F1-948A-12A7593CBD00}.Release|x86.Build.0 = Release|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Debug|Any CPU.ActiveCfg = Debug|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Debug|ARM.ActiveCfg = Debug|ARM
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Debug|ARM.Build.0 = Debug|ARM
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Debug|x86.ActiveCfg = Debug|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Debug|x86.Build.0 = Debug|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Release|Any CPU.ActiveCfg = Release|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Release|ARM.ActiveCfg = Release|ARM
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Release|ARM.Build.0 = Release|ARM
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Release|x86.ActiveCfg = Release|Win32
{18E0189B-F3F1-4CB2-A3AF-5606ADD5E279}.Release|x86.Build.0 = Release|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Debug|Any CPU.ActiveCfg = Debug|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Debug|ARM.ActiveCfg = Debug|ARM
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Debug|ARM.Build.0 = Debug|ARM
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Debug|x86.ActiveCfg = Debug|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Debug|x86.Build.0 = Debug|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Release|Any CPU.ActiveCfg = Release|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Release|ARM.ActiveCfg = Release|ARM
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Release|ARM.Build.0 = Release|ARM
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Release|x86.ActiveCfg = Release|Win32
{7A05E943-6E0A-4F57-8BD7-BE90F44DCAD7}.Release|x86.Build.0 = Release|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|Any CPU.ActiveCfg = Debug|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|ARM.ActiveCfg = Debug|ARM
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|ARM.Build.0 = Debug|ARM
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|x86.ActiveCfg = Debug|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Debug|x86.Build.0 = Debug|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Release|Any CPU.ActiveCfg = Release|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Release|ARM.ActiveCfg = Release|ARM
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Release|ARM.Build.0 = Release|ARM
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Release|x86.ActiveCfg = Release|Win32
{33D91B58-1981-4A3C-B4D1-86EE406CDE12}.Release|x86.Build.0 = Release|Win32
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|ARM.ActiveCfg = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|ARM.Build.0 = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|x86.ActiveCfg = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|x86.Build.0 = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|Any CPU.Build.0 = Release|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|x86.ActiveCfg = Debug|x86
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Debug|x86.Build.0 = Debug|x86
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|ARM.ActiveCfg = Release|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|ARM.Build.0 = Release|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|x86.ActiveCfg = Release|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|x86.Build.0 = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|x86.ActiveCfg = Release|x86
{512BF866-1AA0-4169-A7D6-D2776B5D731E}.Release|x86.Build.0 = Release|x86
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|ARM.ActiveCfg = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|ARM.Build.0 = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|x86.ActiveCfg = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|x86.Build.0 = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|Any CPU.Build.0 = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|x86.ActiveCfg = Debug|x86
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Debug|x86.Build.0 = Debug|x86
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|ARM.ActiveCfg = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|ARM.Build.0 = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|x86.ActiveCfg = Release|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|x86.Build.0 = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|x86.ActiveCfg = Release|x86
{8E708D9A-6325-4AA9-B5A5-D1B5ECA8EEF7}.Release|x86.Build.0 = Release|x86
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|ARM.ActiveCfg = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|ARM.Build.0 = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|x86.Build.0 = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|Any CPU.Build.0 = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|x86.ActiveCfg = Debug|x86
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Debug|x86.Build.0 = Debug|x86
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|ARM.ActiveCfg = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|ARM.Build.0 = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|x86.ActiveCfg = Release|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|x86.Build.0 = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|x86.ActiveCfg = Release|x86
{BD681A4F-EB60-4BB8-90B5-65968FC7DA59}.Release|x86.Build.0 = Release|x86
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|ARM.ActiveCfg = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|ARM.Build.0 = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|x86.ActiveCfg = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|x86.Build.0 = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|Any CPU.Build.0 = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|x86.ActiveCfg = Debug|x86
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Debug|x86.Build.0 = Debug|x86
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|ARM.ActiveCfg = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|ARM.Build.0 = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|x86.ActiveCfg = Release|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|x86.Build.0 = Release|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|x86.ActiveCfg = Release|x86
{FFD3FD52-37A8-4F43-883C-DE8D996CB0E0}.Release|x86.Build.0 = Release|x86
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|ARM.ActiveCfg = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|ARM.Build.0 = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|x86.ActiveCfg = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|x86.Build.0 = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|Any CPU.Build.0 = Release|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|x86.ActiveCfg = Debug|x86
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Debug|x86.Build.0 = Debug|x86
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|ARM.ActiveCfg = Release|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|ARM.Build.0 = Release|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|x86.ActiveCfg = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|x86.ActiveCfg = Release|x86
{3C2F5446-33F0-41D5-813A-64A94AA474AF}.Release|x86.Build.0 = Release|x86
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|ARM.Build.0 = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|x86.ActiveCfg = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|x86.Build.0 = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|Any CPU.Build.0 = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|x86.ActiveCfg = Debug|x86
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Debug|x86.Build.0 = Debug|x86
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|ARM.ActiveCfg = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|ARM.Build.0 = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.ActiveCfg = Release|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.ActiveCfg = Release|x86
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.Build.0 = Release|x86
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|ARM.ActiveCfg = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|ARM.Build.0 = Debug|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x86.ActiveCfg = Debug|x86
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x86.Build.0 = Debug|x86
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|Any CPU.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|ARM.ActiveCfg = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|ARM.Build.0 = Release|Any CPU
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x86.ActiveCfg = Release|x86
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x86.Build.0 = Release|x86
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|ARM.ActiveCfg = Debug|ARM
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|ARM.Build.0 = Debug|ARM
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x86.ActiveCfg = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Debug|x86.Build.0 = Debug|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|Any CPU.ActiveCfg = Release|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|ARM.ActiveCfg = Release|ARM
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|ARM.Build.0 = Release|ARM
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x86.ActiveCfg = Release|Win32
{E4CA78A9-9408-4F5F-ADD6-730FD501FF8E}.Release|x86.Build.0 = Release|Win32
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|ARM.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|ARM.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.ActiveCfg = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|Any CPU.Build.0 = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.ActiveCfg = Debug|x86
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Debug|x86.Build.0 = Debug|x86
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|ARM.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|ARM.Build.0 = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.ActiveCfg = Release|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.Build.0 = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.ActiveCfg = Release|x86
{C5587B6E-19C4-4484-AA97-5C20FBB07E43}.Release|x86.Build.0 = Release|x86
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|ARM.ActiveCfg = Debug|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|ARM.Build.0 = Debug|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|x86.ActiveCfg = Debug|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|x86.Build.0 = Debug|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|x86.ActiveCfg = Debug|x86
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Debug|x86.Build.0 = Debug|x86
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|Any CPU.Build.0 = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|ARM.ActiveCfg = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|ARM.Build.0 = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.ActiveCfg = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.Build.0 = Release|Any CPU
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.ActiveCfg = Release|x86
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.Build.0 = Release|x86
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|ARM.ActiveCfg = Debug|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|ARM.Build.0 = Debug|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x86.ActiveCfg = Debug|x86
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x86.Build.0 = Debug|x86
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|Any CPU.Build.0 = Release|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|ARM.ActiveCfg = Release|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|ARM.Build.0 = Release|Any CPU
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x86.ActiveCfg = Release|x86
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x86.Build.0 = Release|x86
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Debug|Any CPU.ActiveCfg = Debug|Win32
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Debug|ARM.ActiveCfg = Debug|ARM
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Debug|ARM.Build.0 = Debug|ARM
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Debug|x86.ActiveCfg = Debug|Win32
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Debug|x86.Build.0 = Debug|Win32
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Release|Any CPU.ActiveCfg = Release|Win32
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Release|ARM.ActiveCfg = Release|ARM
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Release|ARM.Build.0 = Release|ARM
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Release|x86.ActiveCfg = Release|Win32
{B1DF139F-CEF1-404F-8255-31EF4BF0EC4C}.Release|x86.Build.0 = Release|Win32
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|ARM.ActiveCfg = Debug|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|ARM.Build.0 = Debug|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|x86.ActiveCfg = Debug|x86
{8D333AF6-E901-4301-B3EE-923088E81062}.Debug|x86.Build.0 = Debug|x86
{8D333AF6-E901-4301-B3EE-923088E81062}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Release|Any CPU.Build.0 = Release|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Release|ARM.ActiveCfg = Release|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Release|ARM.Build.0 = Release|Any CPU
{8D333AF6-E901-4301-B3EE-923088E81062}.Release|x86.ActiveCfg = Release|x86

View File

@@ -348,8 +348,18 @@ namespace AppxPackage
{
get
{
string value;
if (!TryGetValue (key, out value))
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind)
{
value = string.Empty;
base [key] = value;
@@ -370,8 +380,18 @@ namespace AppxPackage
}
public string At (string key)
{
string value;
if (!TryGetValue (key, out value)) throw new KeyNotFoundException ($"PRBaseApplication.At: key \"{key}\" not found");
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind) throw new KeyNotFoundException ($"MRApplication: cannot find key \"{key}\"");
if (!EnablePri ()) return value;
if (PriFileHelper.IsMsResourcePrefix (value))
{
@@ -383,8 +403,18 @@ namespace AppxPackage
}
public string NewAt (string key, bool toPriString)
{
string value;
if (!TryGetValue (key, out value))
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind)
{
value = string.Empty;
base [key] = value;

View File

@@ -741,8 +741,18 @@ namespace AppxPackage
{
get
{
string value;
if (!TryGetValue (key, out value))
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind)
{
value = string.Empty;
base [key] = value;
@@ -763,8 +773,18 @@ namespace AppxPackage
}
public string At (string key)
{
string value;
if (!TryGetValue (key, out value)) throw new KeyNotFoundException ($"PRBaseApplication.At: key \"{key}\" not found");
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind) throw new KeyNotFoundException ($"MRApplication: cannot find key \"{key}\"");
if (!EnablePri ()) return value;
if (PriFileHelper.IsMsResourcePrefix (value))
{
@@ -776,8 +796,18 @@ namespace AppxPackage
}
public string NewAt (string key, bool toPriString)
{
string value;
if (!TryGetValue (key, out value))
string value = null;
var isfind = false;
foreach (var kv in this)
{
if (kv.Key?.Trim ()?.ToLowerInvariant () == key?.Trim ()?.ToLowerInvariant ())
{
value = kv.Value;
isfind = true;
break;
}
}
if (!isfind)
{
value = string.Empty;
base [key] = value;
@@ -1780,6 +1810,753 @@ namespace AppxPackage
UsePri = parsePri;
}
}
public bool SaveJsonFileCS (string savefilepath)
{
try
{
#region
using (var fs = File.Create (savefilepath))
{
using (var zos = new ZipOutputStream (fs))
{
zos.SetLevel (9);
bool parsePri = UsePri;
bool usePri = EnablePri;
try
{
UsePri = false;
EnablePri = false;
object packageInfo = null;
#region file
var typestr = "unknown";
switch (Type)
{
case PackageType.Appx: typestr = "appx"; break;
case PackageType.Bundle: typestr = "bundle"; break;
default:
case PackageType.Unknown: typestr = "unknown"; break;
}
var rolestr = "unknown";
switch (Role)
{
case PackageRole.Application: rolestr = "application"; break;
case PackageRole.Framework: rolestr = "framework"; break;
case PackageRole.Resource: rolestr = "resource"; break;
default:
case PackageRole.Unknown: rolestr = "unknown"; break;
}
var pkgfile = new {
path = FilePath,
valid = IsValid,
type = typestr,
role = rolestr
};
#endregion
#region id
var id = Identity;
var pkgid = new {
name = id.Name,
publisher = id.Publisher,
version = id.Version.ToString (),
realVersion = id.RealVersion.ToString (),
architecture = id.ProcessArchitecture.Select (e => {
switch (e)
{
case Architecture.ARM: return "arm";
case Architecture.ARM64: return "arm64";
case Architecture.Neutral: return "neutral";
case Architecture.x64: return "x64";
case Architecture.x86: return "x86";
default:
case Architecture.Unknown: return "unknown";
}
}).ToList (),
familyName = id.FamilyName,
fullName = id.FullName,
resourceId = id.ResourceId
};
#endregion
#region prerequistes
var preq = Prerequisites;
var pkgpreq = new {
osMinVersion = preq.OSMinVersion.ToString (),
osMaxVersionTested = preq.OSMaxVersionTested.ToString (),
osMinVersionDescription = preq.OSMinVersionDescription,
osMaxVersionTestedDescription = preq.OSMaxVersionDescription
};
#endregion
#region resources
var res = Resources;
var pkgres = new {
languages = res.Languages,
scales = res.Scales,
dxFeatureLevels = res.DXFeatures.Select (d => {
switch (d)
{
case DXFeatureLevel.Level9: return 9;
case DXFeatureLevel.Level10: return 10;
case DXFeatureLevel.Level11: return 11;
case DXFeatureLevel.Level12: return 12;
default:
case DXFeatureLevel.Unspecified: return -1;
}
}).ToList ()
};
#endregion
#region capabilities
var caps = Capabilities;
var pkgcaps = new {
capabilities = caps.Capabilities,
deviceCapabilities = caps.DeviceCapabilities
};
#endregion
#region dependencies
var deps = Dependencies;
var pkgdeps = Dependencies.Select (d => new {
name = d.Name,
publisher = d.Publisher,
minVersion = d.Version.ToString ()
}).ToList ();
#endregion
using (var priAllRes = new PriAllValuesReader (this))
{
priAllRes.Init ();
#region prop
var prop = Properties;
var dispname = prop.DisplayName;
var dispNameDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (dispname))
dispNameDict = priAllRes.LocaleResourceAllValues (dispname);
dispNameDict ["root"] = dispname;
var desc = prop.Description;
var descDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (desc))
descDict = priAllRes.LocaleResourceAllValues (desc);
descDict ["root"] = desc;
var disppub = prop.Publisher;
var dispPubDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (disppub))
dispPubDict = priAllRes.LocaleResourceAllValues (disppub);
dispPubDict ["root"] = disppub;
var logoList = priAllRes.FileResourceAllValues (prop.Logo, zos)
.Select (kv => {
string contrast = "";
switch (kv.Key.Contrast)
{
case PriResourceKey.PriContrast.None: contrast = ""; break;
case PriResourceKey.PriContrast.Black: contrast = "black"; break;
case PriResourceKey.PriContrast.White: contrast = "white"; break;
case PriResourceKey.PriContrast.High: contrast = "high"; break;
case PriResourceKey.PriContrast.Low: contrast = "low"; break;
}
if (kv.Key.IsTargetSize)
{
return new {
targetSize = kv.Key.Value,
contrast = contrast,
name = kv.Value
};
}
else if (kv.Key.IsScale)
{
return new {
scale = kv.Key.Value,
contrast = contrast,
name = kv.Value
};
}
else if (kv.Key.IsString)
{
return new {
language = kv.Key.Value,
name = kv.Value
};
}
else
{
return (dynamic)null; // 不满足条件时返回 null
}
})
.Where (item => item != null) // 过滤掉 null
.ToList ();
var pkgprop = new {
displayName = dispNameDict,
publisherDisplayName = dispPubDict,
description = descDict,
logo = logoList,
framework = prop.Framework,
resourcePackage = prop.ResourcePackage
};
#endregion
#region apps
var apps = Applications;
var pkgapps = new List<object> ();
foreach (var app in apps)
{
dynamic obj = new ExpandoObject ();
var dict = (IDictionary<string, object>)obj;
foreach (var kv in app)
{
if (Utils.AppFileProperties.Contains (kv.Key, StringComparer.OrdinalIgnoreCase))
{
dict [Utils.PascalToCamel (kv.Key)] = priAllRes.FileResourceAllValues (kv.Value, zos)
.Select (skv => {
string contrast = "";
switch (skv.Key.Contrast)
{
case PriResourceKey.PriContrast.None: contrast = ""; break;
case PriResourceKey.PriContrast.Black: contrast = "black"; break;
case PriResourceKey.PriContrast.White: contrast = "white"; break;
case PriResourceKey.PriContrast.High: contrast = "high"; break;
case PriResourceKey.PriContrast.Low: contrast = "low"; break;
}
if (skv.Key.IsTargetSize)
{
return new {
targetSize = skv.Key.Value,
contrast = contrast,
name = skv.Value
};
}
else if (skv.Key.IsScale)
{
return new {
scale = skv.Key.Value,
contrast = contrast,
name = skv.Value
};
}
else if (skv.Key.IsString)
{
return new {
language = skv.Key.Value,
name = skv.Value
};
}
else
{
return (dynamic)null; // 不满足条件时返回 null
}
}).Where (item => item != null).ToList ();
}
else
{
if (PriFileHelper.IsMsResourcePrefix (kv.Value))
{
var itemDict = new Dictionary<string, string> ();
itemDict = priAllRes.LocaleResourceAllValues (kv.Value);
itemDict ["root"] = kv.Value;
dict [Utils.PascalToCamel (kv.Key)] = itemDict;
}
else
{
dict [Utils.PascalToCamel (kv.Key)] = kv.Value;
}
}
}
pkgapps.Add (obj);
}
#endregion
packageInfo = new {
file = pkgfile,
identity = pkgid,
properties = pkgprop,
resources = pkgres,
prerequisites = pkgpreq,
applications = pkgapps,
capabilities = pkgcaps,
dependencies = pkgdeps
};
}
var jsonstr = Newtonsoft.Json.JsonConvert.SerializeObject (packageInfo, Newtonsoft.Json.Formatting.None);
var ze = new ZipEntry ("info.json");
ze.DateTime = DateTime.Now;
zos.PutNextEntry (ze);
var bytes = Encoding.UTF8.GetBytes (jsonstr);
zos.Write (bytes, 0, bytes.Length);
zos.CloseEntry ();
return true;
}
finally
{
EnablePri = usePri;
UsePri = parsePri;
}
}
}
#endregion
}
catch (Exception ex)
{
throw ex;
return false;
}
}
public bool SaveXmlFileCS (string savefilepath)
{
try
{
#region
using (var fs = File.Create (savefilepath))
{
using (var zos = new ZipOutputStream (fs))
{
zos.SetLevel (9);
bool parsePri = UsePri;
bool usePri = EnablePri;
try
{
UsePri = false;
EnablePri = false;
var xml = new XmlDocument ();
var decl = xml.CreateXmlDeclaration ("1.0", "utf-8", "yes");
xml.AppendChild (decl);
var root = xml.CreateElement ("Package");
xml.AppendChild (root);
#region file
var typestr = "unknown";
switch (Type)
{
case PackageType.Appx: typestr = "appx"; break;
case PackageType.Bundle: typestr = "bundle"; break;
default:
case PackageType.Unknown: typestr = "unknown"; break;
}
var rolestr = "unknown";
switch (Role)
{
case PackageRole.Application: rolestr = "application"; break;
case PackageRole.Framework: rolestr = "framework"; break;
case PackageRole.Resource: rolestr = "resource"; break;
default:
case PackageRole.Unknown: rolestr = "unknown"; break;
}
{
var nodefile = xml.CreateElement ("File");
var nodefilepath = xml.CreateElement ("Path");
nodefilepath.InnerText = FilePath;
var nodefilevalid = xml.CreateElement ("Valid");
nodefilevalid.InnerText = IsValid ? "true" : "false";
var nodefiletype = xml.CreateElement ("Type");
nodefiletype.InnerText = typestr;
var nodefilerole = xml.CreateElement ("Role");
nodefilerole.InnerText = rolestr;
nodefile.AppendChild (nodefilepath);
nodefile.AppendChild (nodefilevalid);
nodefile.AppendChild (nodefiletype);
nodefile.AppendChild (nodefilerole);
root.AppendChild (nodefile);
}
#endregion
#region id
var id = Identity;
{
var nodeid = xml.CreateElement ("Identity");
var nodeidname = xml.CreateElement ("Name");
nodeidname.InnerText = id.Name;
var nodeidpub = xml.CreateElement ("Publisher");
nodeidpub.InnerText = id.Publisher;
var nodeidver = xml.CreateElement ("Version");
nodeidver.InnerText = id.Version.ToString ();
var nodeidrealver = xml.CreateElement ("RealVersion");
nodeidrealver.InnerText = id.RealVersion.ToString ();
var nodeidarchs = xml.CreateElement ("ProcessorArchitectures");
foreach (var a in id.ProcessArchitecture)
{
var astr = "";
switch (a)
{
case Architecture.ARM: astr = "arm"; break;
case Architecture.ARM64: astr = "arm64"; break;
case Architecture.Neutral: astr = "neutral"; break;
case Architecture.x64: astr = "x64"; break;
case Architecture.x86: astr = "x86"; break;
default:
case Architecture.Unknown: astr = "unknown"; break;
}
var nodeidarch = xml.CreateElement ("ProcessorArchitecture");
nodeidarch.SetAttribute ("Value", astr);
nodeidarchs.AppendChild (nodeidarch);
}
var nodeidfamily = xml.CreateElement ("FamilyName");
nodeidfamily.InnerText = id.FamilyName;
var nodeidfull = xml.CreateElement ("FullName");
nodeidfull.InnerText = id.FullName;
var nodeidresid = xml.CreateElement ("ResourceId");
nodeidresid.InnerText = id.ResourceId;
nodeid.AppendChild (nodeidname);
nodeid.AppendChild (nodeidpub);
nodeid.AppendChild (nodeidver);
nodeid.AppendChild (nodeidrealver);
nodeid.AppendChild (nodeidarchs);
nodeid.AppendChild (nodeidfamily);
nodeid.AppendChild (nodeidfamily);
nodeid.AppendChild (nodeidresid);
root.AppendChild (nodeid);
}
#endregion
using (var priAllRes = new PriAllValuesReader (this))
{
priAllRes.Init ();
#region prop
var prop = Properties;
var dispname = prop.DisplayName;
var dispNameDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (dispname))
dispNameDict = priAllRes.LocaleResourceAllValues (dispname);
dispNameDict ["root"] = dispname;
var desc = prop.Description;
var descDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (desc))
descDict = priAllRes.LocaleResourceAllValues (desc);
descDict ["root"] = desc;
var disppub = prop.Publisher;
var dispPubDict = new Dictionary<string, string> ();
if (PriFileHelper.IsMsResourcePrefix (disppub))
dispPubDict = priAllRes.LocaleResourceAllValues (disppub);
dispPubDict ["root"] = disppub;
{
var nodeprop = xml.CreateElement ("Properties");
var nodepropname = xml.CreateElement ("DisplayName");
foreach (var kv in dispNameDict)
{
var nodelocale = xml.CreateElement ("LocaleResource");
nodelocale.SetAttribute ("Lang", kv.Key);
nodelocale.InnerText = kv.Value;
nodepropname.AppendChild (nodelocale);
}
var nodeproppub = xml.CreateElement ("PublisherDisplayName");
foreach (var kv in dispPubDict)
{
var nodelocale = xml.CreateElement ("LocaleResource");
nodelocale.SetAttribute ("Lang", kv.Key);
nodelocale.InnerText = kv.Value;
nodeproppub.AppendChild (nodelocale);
}
var nodepropdesc = xml.CreateElement ("Description");
foreach (var kv in descDict)
{
var nodelocale = xml.CreateElement ("LocaleResource");
nodelocale.SetAttribute ("Lang", kv.Key);
nodelocale.InnerText = kv.Value;
nodepropdesc.AppendChild (nodelocale);
}
var nodeproplogo = xml.CreateElement ("Logo");
foreach (var kv in priAllRes.FileResourceAllValues (prop.Logo, zos))
{
#region logo
var key = kv.Key;
var value = kv.Value;
var nodefile = xml.CreateElement ("File");
var attrName = xml.CreateAttribute ("Name");
attrName.Value = value;
nodefile.Attributes.Append (attrName);
if (key.Contrast != PriResourceKey.PriContrast.None)
{
string contrast = "";
switch (key.Contrast)
{
case PriResourceKey.PriContrast.Black: contrast = "black"; break;
case PriResourceKey.PriContrast.White: contrast = "white"; break;
case PriResourceKey.PriContrast.High: contrast = "high"; break;
case PriResourceKey.PriContrast.Low: contrast = "low"; break;
}
var attrContrast = xml.CreateAttribute ("Contrast");
attrContrast.Value = contrast;
nodefile.Attributes.Append (attrContrast);
}
if (key.IsTargetSize)
{
var attr = xml.CreateAttribute ("TargetSize");
attr.Value = key.Value.ToString ();
nodefile.Attributes.Append (attr);
}
else if (key.IsScale)
{
var attr = xml.CreateAttribute ("Scale");
attr.Value = key.Value.ToString ();
nodefile.Attributes.Append (attr);
}
else if (key.IsString)
{
var attr = xml.CreateAttribute ("Language");
attr.Value = key.Value.ToString ();
nodefile.Attributes.Append (attr);
}
nodeproplogo.AppendChild (nodefile);
#endregion
}
var nodepropfrw = xml.CreateElement ("Framework");
nodepropfrw.InnerText = prop.Framework ? "true" : "false";
var nodepropres = xml.CreateElement ("ResourcePackage");
nodepropres.InnerText = prop.ResourcePackage ? "true" : "false";
nodeprop.AppendChild (nodepropname);
nodeprop.AppendChild (nodeproppub);
nodeprop.AppendChild (nodepropdesc);
nodeprop.AppendChild (nodeproplogo);
nodeprop.AppendChild (nodepropfrw);
nodeprop.AppendChild (nodepropres);
root.AppendChild (nodeprop);
}
#endregion
#region apps
// Applications 节点
XmlElement nodeApplications = xml.CreateElement ("Applications");
foreach (var app in Applications)
{
XmlElement nodeApp = xml.CreateElement ("Application");
// AppUserModelId 作为属性
string aumidObj = app ["AppUserModelId"];
if (aumidObj == null || aumidObj.Trim ().Length == 0) aumidObj = app ["AppUserModelID"];
nodeApp.SetAttribute ("AppUserModelId", aumidObj);
foreach (var kv in app)
{
string key = kv.Key;
string value = kv.Value;
// 跳过 AppUserModelId因为已经作为属性
if (string.Equals (key, "AppUserModelId", StringComparison.OrdinalIgnoreCase))
continue;
XmlElement nodeProp = xml.CreateElement (key);
// 文件资源类型
if (Utils.AppFileProperties.Contains (key, StringComparer.OrdinalIgnoreCase))
{
foreach (var skv in priAllRes.FileResourceAllValues (value, zos))
{
var fileKey = skv.Key;
var fileValue = skv.Value;
XmlElement nodeFile = xml.CreateElement ("File");
// Name 必有
XmlAttribute attrName = xml.CreateAttribute ("Name");
attrName.Value = fileValue;
nodeFile.Attributes.Append (attrName);
// Contrast 可选
if (fileKey.Contrast != PriResourceKey.PriContrast.None)
{
string contrast = "";
switch (fileKey.Contrast)
{
case PriResourceKey.PriContrast.Black: contrast = "black"; break;
case PriResourceKey.PriContrast.White: contrast = "white"; break;
case PriResourceKey.PriContrast.High: contrast = "high"; break;
case PriResourceKey.PriContrast.Low: contrast = "low"; break;
}
if (!string.IsNullOrEmpty (contrast))
{
XmlAttribute attrContrast = xml.CreateAttribute ("Contrast");
attrContrast.Value = contrast;
nodeFile.Attributes.Append (attrContrast);
}
}
// TargetSize
if (fileKey.IsTargetSize)
{
XmlAttribute attrTS = xml.CreateAttribute ("TargetSize");
attrTS.Value = fileKey.Value.ToString ();
nodeFile.Attributes.Append (attrTS);
}
// Scale
else if (fileKey.IsScale)
{
XmlAttribute attrS = xml.CreateAttribute ("Scale");
attrS.Value = fileKey.Value.ToString ();
nodeFile.Attributes.Append (attrS);
}
// Language
else if (fileKey.IsString)
{
XmlAttribute attrL = xml.CreateAttribute ("Lang");
attrL.Value = fileKey.Value.ToString ();
nodeFile.Attributes.Append (attrL);
}
nodeProp.AppendChild (nodeFile);
}
}
// 多语言资源
else if (PriFileHelper.IsMsResourcePrefix (value))
{
Dictionary<string, string> localeDict = priAllRes.LocaleResourceAllValues (value);
localeDict ["root"] = value.ToString ();
foreach (KeyValuePair<string, string> lkv in localeDict)
{
XmlElement nodeLocale = xml.CreateElement ("LocaleResource");
nodeLocale.SetAttribute ("Lang", lkv.Key);
nodeLocale.InnerText = lkv.Value;
nodeProp.AppendChild (nodeLocale);
}
}
else
{
nodeProp.InnerText = value.ToString ();
}
nodeApp.AppendChild (nodeProp);
}
nodeApplications.AppendChild (nodeApp);
}
root.AppendChild (nodeApplications);
#endregion
}
#region prerequistes
var preq = Prerequisites;
{
var nodepreq = xml.CreateElement ("Prerequisites");
var nodeosmin = xml.CreateElement ("OSMinVersion");
nodeosmin.InnerText = preq.OSMinVersion.ToString ();
nodeosmin.SetAttribute ("Description", preq.OSMinVersionDescription);
var nodeosmaxt = xml.CreateElement ("OSMaxVersionTested");
nodeosmaxt.InnerText = preq.OSMaxVersionTested.ToString ();
nodeosmaxt.SetAttribute ("Description", preq.OSMaxVersionDescription);
nodepreq.AppendChild (nodeosmin);
nodepreq.AppendChild (nodeosmaxt);
root.AppendChild (nodepreq);
}
#endregion
#region resources
XmlElement nodeResources = xml.CreateElement ("Resources");
var res = Resources;
if (res.Languages != null)
{
foreach (var lang in res.Languages)
{
XmlElement nodeRes = xml.CreateElement ("Resource");
XmlAttribute attrLang = xml.CreateAttribute ("Language");
attrLang.Value = lang;
nodeRes.Attributes.Append (attrLang);
nodeResources.AppendChild (nodeRes);
}
}
if (res.Scales != null)
{
foreach (var scale in res.Scales)
{
XmlElement nodeRes = xml.CreateElement ("Resource");
XmlAttribute attrScale = xml.CreateAttribute ("Scale");
attrScale.Value = scale.ToString ();
nodeRes.Attributes.Append (attrScale);
nodeResources.AppendChild (nodeRes);
}
}
if (res.DXFeatures != null)
{
foreach (var d in res.DXFeatures)
{
int level = -1;
switch (d)
{
case DXFeatureLevel.Level9: level = 9; break;
case DXFeatureLevel.Level10: level = 10; break;
case DXFeatureLevel.Level11: level = 11; break;
case DXFeatureLevel.Level12: level = 12; break;
case DXFeatureLevel.Unspecified:
default: level = -1; break;
}
XmlElement nodeRes = xml.CreateElement ("Resource");
XmlAttribute attrDX = xml.CreateAttribute ("DXFeatureLevel");
attrDX.Value = level.ToString ();
nodeRes.Attributes.Append (attrDX);
nodeResources.AppendChild (nodeRes);
}
}
root.AppendChild (nodeResources);
#endregion
#region capabilities
XmlElement nodeCapabilities = xml.CreateElement ("Capabilities");
var caps = Capabilities;
if (caps.Capabilities != null)
{
foreach (var cap in caps.Capabilities)
{
XmlElement nodeCap = xml.CreateElement ("Capability");
XmlAttribute attrName = xml.CreateAttribute ("Name");
attrName.Value = cap;
nodeCap.Attributes.Append (attrName);
nodeCapabilities.AppendChild (nodeCap);
}
}
if (caps.DeviceCapabilities != null)
{
foreach (var devCap in caps.DeviceCapabilities)
{
XmlElement nodeDevCap = xml.CreateElement ("DeviceCapability");
XmlAttribute attrName = xml.CreateAttribute ("Name");
attrName.Value = devCap;
nodeDevCap.Attributes.Append (attrName);
nodeCapabilities.AppendChild (nodeDevCap);
}
}
root.AppendChild (nodeCapabilities);
#endregion
#region dependencies
XmlElement nodeDependencies = xml.CreateElement ("Dependencies");
var deps = Dependencies;
if (deps != null)
{
foreach (var dep in deps)
{
XmlElement nodeDep = xml.CreateElement ("Dependency");
XmlAttribute attrName = xml.CreateAttribute ("Name");
attrName.Value = dep.Name ?? "";
nodeDep.Attributes.Append (attrName);
XmlAttribute attrPublisher = xml.CreateAttribute ("Publisher");
attrPublisher.Value = dep.Publisher ?? "";
nodeDep.Attributes.Append (attrPublisher);
XmlAttribute attrMinVersion = xml.CreateAttribute ("MinVersion");
attrMinVersion.Value = dep.Version != null ? dep.Version.ToString () : "";
nodeDep.Attributes.Append (attrMinVersion);
nodeDependencies.AppendChild (nodeDep);
}
}
root.AppendChild (nodeDependencies);
#endregion
var ze = new ZipEntry ("info.xml");
ze.DateTime = DateTime.Now;
zos.PutNextEntry (ze);
byte [] bytes;
using (var ms = new MemoryStream ())
{
var settings = new XmlWriterSettings {
Encoding = Encoding.UTF8,
Indent = true,
OmitXmlDeclaration = false
};
using (var writer = XmlWriter.Create (ms, settings))
{
xml.Save (writer);
}
bytes = ms.ToArray ();
}
zos.Write (bytes, 0, bytes.Length);
zos.CloseEntry ();
return true;
}
finally
{
EnablePri = usePri;
UsePri = parsePri;
}
}
}
#endregion
}
catch (Exception ex)
{
throw ex;
return false;
}
}
public void SaveJsonFile (string savefilepath, object resolve, object reject)
{
try
@@ -2060,7 +2837,7 @@ namespace AppxPackage
}
catch (Exception ex)
{
if (reject != null) JSHelper.CallJS (reject, ex);
if (reject != null) JSHelper.CallJS (reject, new DataUtils._I_Exception (ex));
}
}
public void SaveJsonFileAsync (string savefilepath, object resolve, object reject)
@@ -2531,7 +3308,7 @@ namespace AppxPackage
}
catch (Exception ex)
{
if (reject != null) JSHelper.CallJS (reject, ex);
if (reject != null) JSHelper.CallJS (reject, new DataUtils._I_Exception (ex));
}
}
public void SaveXmlFileAsync (string savefilepath, object resolve, object reject)

View File

@@ -32,6 +32,24 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>

View File

@@ -797,6 +797,14 @@ namespace Bridge
}
public void UpdateApplicationItems (object items)
{
lock (_I_PackageReader._cacheCleanupLock)
{
try
{
_I_PackageReader._cache?.Clear ();
}
catch { }
}
var stritems = JsArrayToList (items).Select (e => e?.ToString ()).ToList ();
PackageReader.UpdateApplicationItems (stritems);
}

View File

@@ -29,6 +29,24 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>

215
LICENSE
View File

@@ -1,21 +1,202 @@
MIT License
Copyright (c) 2025 Windows Modern
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Definitions.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -13,7 +13,7 @@
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x86</PlatformTarget>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
@@ -34,6 +34,24 @@
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -62,7 +62,7 @@ namespace Launch
}
string appUserModelId = args [0];
string argumentLine = BuildCommandLine (args, 1);
AppxPackage.PackageManager.ActiveApp (appUserModelId, string.IsNullOrEmpty (argumentLine) ? null : argumentLine);
AppxPackage.PackageManager.ActiveApp (appUserModelId, argumentLine);
}
}
}

View File

@@ -115,10 +115,10 @@
this.label1.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.label1, 5);
this.label1.Dock = System.Windows.Forms.DockStyle.Fill;
this.label1.Font = new System.Drawing.Font("微软雅黑 Light", 20F);
this.label1.Font = new System.Drawing.Font("Segoe UI", 19.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label1.Location = new System.Drawing.Point(27, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(727, 45);
this.label1.Size = new System.Drawing.Size(727, 46);
this.label1.TabIndex = 0;
this.label1.Text = "Create Desktop Shortcut";
//
@@ -127,7 +127,7 @@
this.label2.AutoSize = true;
this.tableLayoutPanel1.SetColumnSpan(this.label2, 5);
this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
this.label2.Location = new System.Drawing.Point(27, 79);
this.label2.Location = new System.Drawing.Point(27, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(727, 60);
this.label2.TabIndex = 1;
@@ -147,7 +147,7 @@
this.tableLayoutPanel2.Controls.Add(this.label7, 0, 8);
this.tableLayoutPanel2.Controls.Add(this.customIconDisplay, 0, 9);
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel2.Location = new System.Drawing.Point(27, 152);
this.tableLayoutPanel2.Location = new System.Drawing.Point(27, 153);
this.tableLayoutPanel2.Name = "tableLayoutPanel2";
this.tableLayoutPanel2.RowCount = 10;
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
@@ -160,7 +160,7 @@
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 39F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 13F));
this.tableLayoutPanel2.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel2.Size = new System.Drawing.Size(235, 323);
this.tableLayoutPanel2.TabIndex = 2;
//
// label3
@@ -251,7 +251,7 @@
this.customIconDisplay.Dock = System.Windows.Forms.DockStyle.Fill;
this.customIconDisplay.Location = new System.Drawing.Point(3, 230);
this.customIconDisplay.Name = "customIconDisplay";
this.customIconDisplay.Size = new System.Drawing.Size(229, 91);
this.customIconDisplay.Size = new System.Drawing.Size(229, 90);
this.customIconDisplay.TabIndex = 7;
this.customIconDisplay.TabStop = false;
//
@@ -273,7 +273,7 @@
this.tableLayoutPanel3.Controls.Add(this.label12, 0, 9);
this.tableLayoutPanel3.Controls.Add(this.shortcutNameInput, 0, 10);
this.tableLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel3.Location = new System.Drawing.Point(273, 152);
this.tableLayoutPanel3.Location = new System.Drawing.Point(273, 153);
this.tableLayoutPanel3.Name = "tableLayoutPanel3";
this.tableLayoutPanel3.RowCount = 11;
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
@@ -287,7 +287,7 @@
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 32F));
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 18F));
this.tableLayoutPanel3.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel3.Size = new System.Drawing.Size(235, 323);
this.tableLayoutPanel3.TabIndex = 3;
//
// label5
@@ -476,14 +476,14 @@
this.tableLayoutPanel4.Controls.Add(this.imageSizeList, 0, 1);
this.tableLayoutPanel4.Controls.Add(this.imagesPreview, 0, 3);
this.tableLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel4.Location = new System.Drawing.Point(519, 152);
this.tableLayoutPanel4.Location = new System.Drawing.Point(519, 153);
this.tableLayoutPanel4.Name = "tableLayoutPanel4";
this.tableLayoutPanel4.RowCount = 4;
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel4.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel4.Size = new System.Drawing.Size(235, 324);
this.tableLayoutPanel4.Size = new System.Drawing.Size(235, 323);
this.tableLayoutPanel4.TabIndex = 4;
//
// label8
@@ -500,7 +500,7 @@
//
this.label9.AutoSize = true;
this.label9.Dock = System.Windows.Forms.DockStyle.Fill;
this.label9.Location = new System.Drawing.Point(3, 162);
this.label9.Location = new System.Drawing.Point(3, 161);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(229, 20);
this.label9.TabIndex = 1;
@@ -516,7 +516,7 @@
this.imageSizeList.Location = new System.Drawing.Point(3, 23);
this.imageSizeList.Name = "imageSizeList";
this.imageSizeList.RowTemplate.Height = 27;
this.imageSizeList.Size = new System.Drawing.Size(229, 136);
this.imageSizeList.Size = new System.Drawing.Size(229, 135);
this.imageSizeList.TabIndex = 2;
this.imageSizeList.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.imageSizeList_CellDoubleClick);
//
@@ -536,7 +536,7 @@
this.imagesPreview.AutoScroll = true;
this.imagesPreview.Dock = System.Windows.Forms.DockStyle.Fill;
this.imagesPreview.FlowDirection = System.Windows.Forms.FlowDirection.TopDown;
this.imagesPreview.Location = new System.Drawing.Point(3, 185);
this.imagesPreview.Location = new System.Drawing.Point(3, 184);
this.imagesPreview.Name = "imagesPreview";
this.imagesPreview.Size = new System.Drawing.Size(229, 136);
this.imagesPreview.TabIndex = 3;

View File

@@ -31,6 +31,24 @@
<WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

13
NOTICE.TXT Normal file
View File

@@ -0,0 +1,13 @@
Copyright (c) 2025-2026 Windows Modern
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

230
PkgCLI/CliParsing.cs Normal file
View File

@@ -0,0 +1,230 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace PkgCLI
{
public class NormalizeStringComparer: IEqualityComparer<string>
{
public bool Equals (string x, string y) => Polyfill.NEquals (x, y);
public int GetHashCode (string obj) => obj.NNormalize ().GetHashCode ();
}
public class NormalizeCharacterComparer: IEqualityComparer<char>
{
public bool Equals (char x, char y) => char.ToLowerInvariant (x) == char.ToLowerInvariant (y);
public int GetHashCode (char obj) => char.ToLowerInvariant (obj).GetHashCode ();
}
public class StringNSet: HashSet<string>
{
public StringNSet () : base (new NormalizeStringComparer ()) { }
public StringNSet (IEnumerable<string> list) : base (list, new NormalizeStringComparer ()) { }
}
public class CharNSet: HashSet<char>
{
public CharNSet () : base (new NormalizeCharacterComparer ()) { }
public CharNSet (IEnumerable<char> list) : base (list, new NormalizeCharacterComparer ()) { }
}
public static class CliParsingConst
{
public static readonly char [] defaultPrefixs = new char [] { '/', '-' };
public static readonly char [] defaultPostfixs = new char [] { '=', ':' };
public static readonly string [] emptyStringArray = new string [] { };
}
public class CmdParamName: IEquatable<CmdParamName>, IComparable<CmdParamName>, IDisposable
{
private string _id = "";
private string _name = "";
/// <summary>
/// 命令唯一标识,但不作为命令名,仅用于内部识别。命令 ID 可以作为命令名或别名。
/// </summary>
public string Id { get { return _id.NNormalize (); } set { _id = value; } }
/// <summary>
/// 命令名,唯一。命令名不能与别名重复。首字符不能为前缀中的字符,尾字符不能为后缀中的字符。
/// </summary>
public string Name { get { return _name.NNormalize (); } set { _name = value; } }
/// <summary>
/// 命令别名,唯一。不能与命令名重复。首字符不能为前缀中的字符,尾字符不能为后缀中的字符。
/// </summary>
/// </summary>
public StringNSet Aliases { get; private set; } = new StringNSet ();
/// <summary>
/// 命令前缀,为一个字符,标点符号。不能为命令名或别名的首字符。
/// </summary>
public CharNSet Prefixs { get; set; } = new CharNSet (CliParsingConst.defaultPrefixs);
/// <summary>
/// 命令后缀,为一个字符,标点符号。不能为命令名或别名的尾字符。
/// </summary>
public CharNSet Postfixs { get; set; } = new CharNSet (CliParsingConst.defaultPostfixs);
public bool Equals (CmdParamName other)
{
if (other == null) return false;
if (ReferenceEquals (this, other)) return true;
return string.Equals (this.Id, other.Id, StringComparison.Ordinal);
}
public int CompareTo (CmdParamName other)
{
if (other == null) return 1;
if (ReferenceEquals (this, other)) return 0;
return string.Compare (this.Id, other.Id, StringComparison.Ordinal);
}
public override bool Equals (object obj) => Equals (obj as CmdParamName);
public override int GetHashCode () => this.Id?.GetHashCode () ?? 0;
public bool ParamContains (string param)
{
var ret = Name.NEquals (param);
if (!ret)
{
foreach (var alias in Aliases)
{
if (alias.NEquals (param)) return true;
}
}
return ret;
}
public void Dispose ()
{
Aliases?.Clear ();
Prefixs?.Clear ();
}
public CmdParamName (string id, string name, IEnumerable<string> aliases, IEnumerable<char> prefixs, IEnumerable<char> postfixs)
{
Id = id;
Name = name;
Aliases = new StringNSet (aliases);
Prefixs = new CharNSet (prefixs);
Postfixs = new CharNSet (postfixs);
}
public CmdParamName (string name, IEnumerable<string> aliases) : this (name, name, aliases, CliParsingConst.defaultPrefixs, CliParsingConst.defaultPostfixs) { }
public CmdParamName (string name) : this (name, CliParsingConst.emptyStringArray) { }
public CmdParamName () { }
}
public class CommandParam: IEquatable<string>
{
private string _id = "";
public string Id { get { return _id.NNormalize (); } set { _id = value; } }
public string Value = "";
public bool Equals (string other)
{
return (_id ?? "").NEquals (other);
}
public override bool Equals (object obj)
{
if (obj is string) return Equals (obj as string);
else if (obj is CommandParam) return Equals ((obj as CommandParam).Id);
else return base.Equals (obj);
}
public override int GetHashCode ()
{
return Id.GetHashCode ();
}
}
public class CliParsing: IDisposable
{
public HashSet<CmdParamName> Params { get; set; } = new HashSet<CmdParamName> ();
public void Dispose ()
{
Params = null;
}
public List<CommandParam> Parse (string [] args)
{
var ret = new List<CommandParam> ();
CommandParam last = new CommandParam ();
for (long i = 0; i < args.LongLength; i++)
{
var arg = args [i]?.Trim () ?? "";
var item = args [i]?.NNormalize () ?? "";
if (string.IsNullOrWhiteSpace (item)) continue;
var first = item [0];
bool isfind = false;
foreach (var param in Params)
{
if (param.Prefixs.Contains (first))
{
var minser = param.Postfixs.Select (e => {
var index = item.IndexOf (e);
return index == -1 ? int.MaxValue : index;
}).Min ();
string paramPart, postfixPart;
if (minser == int.MaxValue)
{
paramPart = arg.Substring (1);
postfixPart = "";
}
else
{
paramPart = arg.Substring (1, minser - 1);
postfixPart = arg.Substring (minser + 1);
}
if (param.ParamContains (paramPart))
{
isfind = true;
var cmdParam = new CommandParam ();
cmdParam.Id = param.Id;
if (!string.IsNullOrEmpty (postfixPart))
cmdParam.Value = postfixPart;
last = cmdParam;
ret.Add (cmdParam);
break;
}
}
}
if (!isfind)
{
var valueparam = new CommandParam ();
valueparam.Value = arg;
ret.Add (valueparam);
}
}
return ret;
}
}
public static class CliPasingUtils
{
public static bool ParamContains (this List<CommandParam> cpl, string id)
{
foreach (var i in cpl)
{
if (i.Id.NEquals (id)) return true;
}
return false;
}
public static bool ParamContains (this List<CommandParam> cpl, CmdParamName param)
{
foreach (var i in cpl)
{
if (i.Id.NEquals (param.Id)) return true;
}
return false;
}
public static bool ParamsContainsOr (this List<CommandParam> cpl, params string [] ids)
{
foreach (var i in cpl)
{
foreach (var j in ids)
{
if (i.Id.NEquals (j)) return true;
}
}
return false;
}
public static bool ParamsContainsAnd (this List<CommandParam> cpl, params string [] ids)
{
if (ids == null || ids.Length == 0) return true;
foreach (var id in ids)
{
if (!ParamContains (cpl, id)) return false;
}
return true;
}
public static CommandParam GetFromId (this List <CommandParam> cpl, string id)
{
foreach (var c in cpl)
{
if (c.Id.NEquals (id)) return c;
}
return null;
}
}
}

View File

@@ -50,6 +50,10 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.4\lib\net40\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -59,19 +63,29 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CliParsing.cs" />
<Compile Include="Polyfill.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Text.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\AppxPackage\AppxPackage.csproj">
<Project>{bd681a4f-eb60-4bb8-90b5-65968fc7da59}</Project>
<Name>AppxPackage</Name>
</ProjectReference>
<ProjectReference Include="..\DataUtils\DataUtils.csproj">
<Project>{ffd3fd52-37a8-4f43-883c-de8d996cb0e0}</Project>
<Name>DataUtils</Name>
</ProjectReference>
<ProjectReference Include="..\PrivateInit\PrivateInit.csproj">
<Project>{8e708d9a-6325-4aa9-b5a5-d1b5eca8eef7}</Project>
<Name>PrivateInit</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.

987
PkgCLI/Polyfill.cs Normal file
View File

@@ -0,0 +1,987 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using AppxPackage;
using AppxPackage.Info;
using Newtonsoft.Json;
namespace PkgCLI
{
public static class Polyfill
{
static public bool NEquals (this string s1, string s2)
{
if (string.IsNullOrWhiteSpace (s1) && string.IsNullOrWhiteSpace (s2)) return true;
else return s1?.Trim ()?.ToLowerInvariant () == s2?.Trim ()?.ToLowerInvariant ();
}
static public string NNormalize (this string s1)
{
return s1?.Trim ()?.ToLowerInvariant ();
}
static public string Join<T> (this IEnumerable<T> ie, string divide = ", ")
{
var ret = "";
for (var i = 0; i < ie.Count (); i++)
{
if (i != 0) ret += divide;
var item = ie.ElementAt (i);
if (item == null) ret += "(null)";
else ret += item.ToString ();
}
return ret;
}
/// <summary>
/// 将对象通过指定的选择器转换为目标类型。
/// 类似于 LINQ 的 Select但适用于单一对象。
/// </summary>
/// <typeparam name="T">目标类型</typeparam>
/// <param name="obj">源对象</param>
/// <param name="selector">转换委托,输入源对象,输出目标对象</param>
/// <returns>转换后的结果</returns>
public static T ToOther<T> (this object obj, Func<object, T> selector)
{
if (selector == null)
throw new ArgumentNullException (nameof (selector));
return selector (obj);
}
/// <summary>
/// 将字典格式化为对齐的文本,每个键值对一行,分隔符垂直对齐。
/// </summary>
/// <param name="dict">要格式化的字典</param>
/// <param name="separator">分隔符(如 ":", "="),默认为 ":"</param>
/// <param name="indent">每行前的缩进字符串,默认为空</param>
/// <param name="sortKeys">是否按键名排序(不区分大小写),默认为 false</param>
/// <returns>格式化后的字符串,例如:
/// Name : Alice
/// Age : 30
/// </returns>
public static string FormatDictionaryAligned (
this IDictionary<string, string> dict,
string separator = ":",
string indent = "",
bool sortKeys = false)
{
if (dict == null || dict.Count == 0)
return string.Empty;
var keys = sortKeys
? dict.Keys.OrderBy (k => k, StringComparer.OrdinalIgnoreCase).ToList ()
: dict.Keys.ToList ();
int maxKeyLength = keys.Max (k => k.Length);
var sb = new StringBuilder ();
foreach (string key in keys)
{
string value = dict [key] ?? string.Empty;
sb.AppendLine ($"{indent}{key.PadRight (maxKeyLength)} {separator} {value}");
}
return sb.ToString ().TrimEnd (Environment.NewLine.ToCharArray ());
}
public static string Format (this string format, params object [] args)
{
return String.Format (format, args);
}
public static string Format (this string format, object args)
{
return String.Format (format, args);
}
}
public static class PackageReaderExt
{
static public object GetJsonObjectForCli (this PackageReader pr)
{
var id = pr.Identity;
var prop = pr.Properties;
var pre = pr.Prerequisites;
var apps = pr.Applications;
var caps = pr.Capabilities;
var deps = pr.Dependencies;
dynamic obj = new {
valid = pr.IsValid,
type = pr.Type.ToOther (e => {
switch ((AppxPackage.Info.PackageType)e)
{
case AppxPackage.Info.PackageType.Appx: return "appx";
case AppxPackage.Info.PackageType.Bundle: return "bundle";
default:
case AppxPackage.Info.PackageType.Unknown: return "unknown";
}
}),
role = pr.Role.ToOther (o => {
switch ((AppxPackage.Info.PackageRole)o)
{
case AppxPackage.Info.PackageRole.Application: return "application";
case AppxPackage.Info.PackageRole.Framework: return "framework";
case AppxPackage.Info.PackageRole.Resource: return "resource";
default:
case AppxPackage.Info.PackageRole.Unknown: return "unknown";
}
}),
identity = new {
name = id.Name,
publisher = id.Publisher,
version = id.Version.Expression,
realVersion = id.RealVersion.Expression,
architecture = id.ProcessArchitecture.Select (e => {
switch (e)
{
case AppxPackage.Info.Architecture.ARM: return "arm";
case AppxPackage.Info.Architecture.ARM64: return "arm64";
case AppxPackage.Info.Architecture.Neutral: return "neutral";
default:
case AppxPackage.Info.Architecture.Unknown: return "unknown";
case AppxPackage.Info.Architecture.x64: return "x64";
case AppxPackage.Info.Architecture.x86: return "x86";
}
}).ToList (),
familyName = id.FamilyName,
fullName = id.FullName,
resourceId = id.ResourceId
},
properties = new {
displayName = prop.DisplayName,
publisherDisplayName = prop.Publisher,
description = prop.Description,
logo = prop.Logo,
framework = prop.Framework,
resourcePackage = prop.ResourcePackage
},
prerequisite = new {
osMinVersion = pre.OSMinVersion.ToString (),
osMaxVersionTested = pre.OSMaxVersionTested.ToString (),
_osMinVersion = pre.OSMinVersionDescription,
_osMaxVersionTested = pre.OSMaxVersionDescription
},
applications = apps.Select (e => {
var dict = new Dictionary<string, string> ();
foreach (var kv in e)
{
if (kv.Key.IndexOf ("Base64") >= 0) continue;
var value = e.NewAt (kv.Key, pr.EnablePri);
if (string.IsNullOrWhiteSpace (value))
value = e.At (kv.Key);
dict [kv.Key] = value;
}
return dict;
}).ToList (),
capabilities = new {
capabilities = caps.Capabilities,
deviceCapabilities = caps.DeviceCapabilities
},
dependencies = deps.Select (e => new {
name = e.Name,
publisher = e.Publisher,
minVersion = e.Version.ToString ()
})
};
return obj;
}
/// <summary>
/// 从 PackageReader 中获取指定路径的值。
/// 支持格式:路径中可使用 '.' 或 ':' 分隔,支持索引器 '[index]',支持 '.length'。
/// 大小写不敏感,自动去除首尾空白。
/// 示例:
/// "Identity" -> 返回 Identity 字典
/// "Identity.Name" -> 返回名称
/// "Properties.Publisher" -> 返回发布者显示名称(别名)
/// "applications[0]" -> 返回第一个应用字典
/// "applications.length" -> 返回应用个数
/// "Applications[0].LogoBase64" -> 返回第一个应用的 LogoBase64
/// </summary>
public static object GetItem (this PackageReader pr, string item)
{
if (pr == null) throw new ArgumentNullException ("pr");
if (string.IsNullOrWhiteSpace (item)) return null;
string path = item.Trim ().Replace (':', '.');
object result = ResolvePath (pr, path);
return SerializeObject (result, pr, false);
}
private static object ResolvePath (object target, string path)
{
if (target == null) return null;
if (string.IsNullOrEmpty (path)) return target;
string [] segments = path.Split ('.');
object current = target;
foreach (string seg in segments)
{
if (current == null) return null;
if (seg.Contains ("[") && seg.Contains ("]"))
{
int bracketStart = seg.IndexOf ('[');
string propName = seg.Substring (0, bracketStart);
string indexStr = seg.Substring (bracketStart + 1, seg.Length - bracketStart - 2);
int index;
if (!int.TryParse (indexStr, out index))
return null;
object collection = GetPropertyValue (current, propName);
if (collection == null) return null;
current = GetIndexedValue (collection, index);
}
else if (string.Equals (seg, "length", StringComparison.OrdinalIgnoreCase) ||
string.Equals (seg, "count", StringComparison.OrdinalIgnoreCase))
{
current = GetLength (current);
}
else
{
current = GetPropertyValue (current, seg);
}
}
return current;
}
private static object GetPropertyValue (object target, string propName)
{
if (target == null) return null;
Type type = target.GetType ();
// 根对象 PackageReader 的属性名映射(不区分大小写)
if (type == typeof (PackageReader))
{
string mapped = null;
string lower = propName.ToLowerInvariant ();
switch (lower)
{
case "pkgid":
case "id":
case "identity": mapped = "Identity"; break;
case "prop":
case "properties": mapped = "Properties"; break;
case "prerequistes":
case "prerequisite":
case "prerequisites": mapped = "Prerequisites"; break;
case "res":
case "resources": mapped = "Resources"; break;
case "apps":
case "applications": mapped = "Applications"; break;
case "caps":
case "capabilities": mapped = "Capabilities"; break;
case "deps":
case "dependencies": mapped = "Dependencies"; break;
case "type": mapped = "Type"; break;
case "role": mapped = "Role"; break;
case "valid":
case "isvalid": mapped = "IsValid"; break;
case "filepath": mapped = "FilePath"; break;
}
if (mapped != null)
propName = mapped;
}
// PRProperties 别名Publisher / PublisherDisplayName 都映射到 Publisher 属性
if (type == typeof (PRProperties))
{
if (string.Equals (propName, "Publisher", StringComparison.OrdinalIgnoreCase) ||
string.Equals (propName, "PublisherDisplayName", StringComparison.OrdinalIgnoreCase))
{
propName = "Publisher";
}
}
// PRApplication 中以 Base64 结尾的属性 -> 调用 NewAtBase64
if (type == typeof (PRApplication) && propName.EndsWith ("Base64", StringComparison.OrdinalIgnoreCase))
{
string baseKey = propName.Substring (0, propName.Length - 6);
PRApplication app = (PRApplication)target;
MethodInfo method = typeof (PRApplication).GetMethod ("NewAtBase64", BindingFlags.Public | BindingFlags.Instance);
if (method != null)
{
return method.Invoke (app, new object [] { baseKey });
}
return null;
}
// PRApplication 普通属性访问(字典键,大小写不敏感)
if (type == typeof (PRApplication))
{
PRApplication app = (PRApplication)target;
// 直接使用索引器,内部已处理资源解析和大小写不敏感
return app [propName];
}
// MRApplication 同理
if (type == typeof (MRApplication))
{
MRApplication app = (MRApplication)target;
return app [propName];
}
// 反射属性(不区分大小写)
PropertyInfo prop = type.GetProperty (propName,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (prop != null)
{
return prop.GetValue (target, null);
}
// 反射字段
FieldInfo field = type.GetField (propName,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (field != null)
{
return field.GetValue (target);
}
return null;
}
private static object GetIndexedValue (object collection, int index)
{
if (collection == null) return null;
// PRApplications
PRApplications apps = collection as PRApplications;
if (apps != null)
{
if (index >= 0 && index < apps.Applications.Count)
return apps.Applications [index];
return null;
}
// IList
IList list = collection as IList;
if (list != null && index >= 0 && index < list.Count)
return list [index];
// 索引器属性
PropertyInfo indexer = collection.GetType ().GetProperty ("Item", new [] { typeof (int) });
if (indexer != null)
return indexer.GetValue (collection, new object [] { index });
return null;
}
private static int? GetLength (object obj)
{
if (obj == null) return null;
PRApplications apps = obj as PRApplications;
if (apps != null) return apps.Applications.Count;
PRDependencies deps = obj as PRDependencies;
if (deps != null) return deps.Dependencies.Count;
IList list = obj as IList;
if (list != null) return list.Count;
ICollection coll = obj as ICollection;
if (coll != null) return coll.Count;
return null;
}
private static object SerializeObject (object obj, PackageReader pr, bool filterBase64)
{
if (obj == null) return null;
Type type = obj.GetType ();
if (type.IsPrimitive || obj is string || obj is decimal || obj is Enum)
return obj;
// PRIdentity
if (type == typeof (PRIdentity))
{
PRIdentity id = (PRIdentity)obj;
return new {
name = id.Name,
publisher = id.Publisher,
version = id.Version.Expression,
realVersion = id.RealVersion.Expression,
architecture = id.ProcessArchitecture.Select (e => {
switch (e)
{
case Architecture.ARM: return "arm";
case Architecture.ARM64: return "arm64";
case Architecture.Neutral: return "neutral";
case Architecture.x64: return "x64";
case Architecture.x86: return "x86";
default: return "unknown";
}
}).ToList (),
familyName = id.FamilyName,
fullName = id.FullName,
resourceId = id.ResourceId
};
}
// PRProperties
if (type == typeof (PRProperties))
{
PRProperties prop = (PRProperties)obj;
return new {
displayName = prop.DisplayName,
publisherDisplayName = prop.Publisher,
description = prop.Description,
logo = prop.Logo,
framework = prop.Framework,
resourcePackage = prop.ResourcePackage
};
}
// PRPrerequisites
if (type == typeof (PRPrerequisites))
{
PRPrerequisites pre = (PRPrerequisites)obj;
return new {
osMinVersion = pre.OSMinVersion,
osMaxVersionTested = pre.OSMaxVersionTested,
_osMinVersion = pre.OSMinVersionDescription,
_osMaxVersionTested = pre.OSMaxVersionDescription
};
}
// PRCapabilities
if (type == typeof (PRCapabilities))
{
PRCapabilities caps = (PRCapabilities)obj;
return new {
capabilities = caps.Capabilities,
deviceCapabilities = caps.DeviceCapabilities
};
}
// PRDependencies
if (type == typeof (PRDependencies))
{
PRDependencies deps = (PRDependencies)obj;
return deps.Select (e => new {
name = e.Name,
publisher = e.Publisher,
minVersion = e.Version.ToString ()
}).ToList ();
}
// PRApplications (集合)
if (type == typeof (PRApplications))
{
PRApplications apps = (PRApplications)obj;
return apps.Select (e => SerializeObject (e, pr, filterBase64)).ToList ();
}
// PRApplication (单个应用)
if (type == typeof (PRApplication))
{
PRApplication app = (PRApplication)obj;
var dict = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
foreach (var kv in app)
{
if (kv.Key.IndexOf ("Base64", StringComparison.OrdinalIgnoreCase) >= 0)
continue;
string value = app.NewAt (kv.Key, pr.EnablePri);
if (string.IsNullOrWhiteSpace (value))
value = app.At (kv.Key);
dict [kv.Key] = value;
}
return dict;
}
// IDictionary
IDictionary dictObj = obj as IDictionary;
if (dictObj != null)
{
var result = new Dictionary<string, object> (StringComparer.OrdinalIgnoreCase);
foreach (DictionaryEntry entry in dictObj)
{
string key = entry.Key?.ToString ();
if (string.IsNullOrEmpty (key)) continue;
if (filterBase64 && key.EndsWith ("_Base64", StringComparison.OrdinalIgnoreCase))
continue;
result [key] = SerializeObject (entry.Value, pr, filterBase64);
}
return result;
}
// IEnumerable (非字符串)
if (!(obj is string))
{
IEnumerable enumerable = obj as IEnumerable;
if (enumerable != null)
{
var list = new List<object> ();
foreach (var item in enumerable)
list.Add (SerializeObject (item, pr, filterBase64));
return list;
}
}
// 后备:反射属性
var props = type.GetProperties (BindingFlags.Public | BindingFlags.Instance);
var propDict = new Dictionary<string, object> (StringComparer.OrdinalIgnoreCase);
foreach (var prop in props)
{
if (prop.GetIndexParameters ().Length > 0) continue;
string propName = prop.Name;
if (filterBase64 && propName.EndsWith ("Base64", StringComparison.OrdinalIgnoreCase))
continue;
object val = prop.GetValue (obj, null);
propDict [propName] = SerializeObject (val, pr, filterBase64);
}
return propDict;
}
}
public static class ManifestReaderExt
{
/// <summary>
/// 获取用于 CLI 输出的 JSON 对象(与 PackageReaderExt.GetJsonObjectForCli 结构一致)。
/// </summary>
public static object GetJsonObjectForCli (this ManifestReader mr)
{
var id = mr.Identity;
var prop = mr.Properties;
var pre = mr.Prerequisites;
var apps = mr.Applications;
var caps = mr.Capabilities;
var deps = mr.Dependencies;
var res = mr.Resources;
dynamic obj = new {
valid = mr.IsValid,
type = mr.Type.ToOther (e => {
switch ((PackageType)e)
{
case PackageType.Appx: return "appx";
case PackageType.Bundle: return "bundle";
default:
case PackageType.Unknown: return "unknown";
}
}),
role = mr.Role.ToOther (o => {
switch ((PackageRole)o)
{
case PackageRole.Application: return "application";
case PackageRole.Framework: return "framework";
case PackageRole.Resource: return "resource";
default:
case PackageRole.Unknown: return "unknown";
}
}),
identity = new {
name = id.Name,
publisher = id.Publisher,
version = id.Version.Expression,
architecture = id.ProcessArchitecture.Select (e => {
switch (e)
{
case Architecture.ARM: return "arm";
case Architecture.ARM64: return "arm64";
case Architecture.Neutral: return "neutral";
case Architecture.x64: return "x64";
case Architecture.x86: return "x86";
default: return "unknown";
}
}).ToList (),
familyName = id.FamilyName,
fullName = id.FullName,
resourceId = id.ResourceId
},
properties = new {
displayName = prop.DisplayName,
publisherDisplayName = prop.Publisher,
description = prop.Description,
logo = prop.Logo,
framework = prop.Framework,
resourcePackage = prop.ResourcePackage
},
prerequisite = new {
osMinVersion = pre.OSMinVersion.ToString (),
osMaxVersionTested = pre.OSMaxVersionTested.ToString (),
_osMinVersion = pre.OSMinVersionDescription,
_osMaxVersionTested = pre.OSMaxVersionDescription
},
resources = new {
languages = res.Languages,
scales = res.Scales,
dxFeatureLevels = res.DXFeatures.Select (d => {
switch (d)
{
case DXFeatureLevel.Level9: return 9;
case DXFeatureLevel.Level10: return 10;
case DXFeatureLevel.Level11: return 11;
case DXFeatureLevel.Level12: return 12;
default: return -1;
}
}).ToList ()
},
applications = apps.Select (e => {
var dict = new Dictionary<string, string> ();
foreach (var kv in e)
{
if (kv.Key.IndexOf ("Base64", StringComparison.OrdinalIgnoreCase) >= 0)
continue;
string value = e.NewAt (kv.Key, mr.EnablePri);
if (string.IsNullOrWhiteSpace (value))
value = e.At (kv.Key);
dict [kv.Key] = value;
}
return dict;
}).ToList (),
capabilities = new {
capabilities = caps.Capabilities,
deviceCapabilities = caps.DeviceCapabilities
},
dependencies = deps.Select (e => new {
name = e.Name,
publisher = e.Publisher,
minVersion = e.Version.ToString ()
})
};
return obj;
}
/// <summary>
/// 从 ManifestReader 中获取指定路径的值。
/// 支持格式:路径中可使用 '.' 或 ':' 分隔,支持索引器 '[index]',支持 '.length'。
/// 大小写不敏感,自动去除首尾空白。
/// 示例:
/// "Identity" -> 返回 Identity 字典
/// "Identity.Name" -> 返回名称
/// "Properties.Publisher" -> 返回发布者显示名称(别名)
/// "applications[0]" -> 返回第一个应用字典
/// "applications.length" -> 返回应用个数
/// "Applications[0].LogoBase64" -> 返回第一个应用的 LogoBase64
/// </summary>
public static object GetItem (this ManifestReader mr, string item)
{
if (mr == null) throw new ArgumentNullException ("mr");
if (string.IsNullOrWhiteSpace (item)) return null;
string path = item.Trim ().Replace (':', '.');
object result = ResolvePath (mr, path);
return SerializeObject (result, mr, false);
}
private static object ResolvePath (object target, string path)
{
if (target == null) return null;
if (string.IsNullOrEmpty (path)) return target;
string [] segments = path.Split ('.');
object current = target;
foreach (string seg in segments)
{
if (current == null) return null;
if (seg.Contains ("[") && seg.Contains ("]"))
{
int bracketStart = seg.IndexOf ('[');
string propName = seg.Substring (0, bracketStart);
string indexStr = seg.Substring (bracketStart + 1, seg.Length - bracketStart - 2);
int index;
if (!int.TryParse (indexStr, out index))
return null;
object collection = GetPropertyValue (current, propName);
if (collection == null) return null;
current = GetIndexedValue (collection, index);
}
else if (string.Equals (seg, "length", StringComparison.OrdinalIgnoreCase) ||
string.Equals (seg, "count", StringComparison.OrdinalIgnoreCase))
{
current = GetLength (current);
}
else
{
current = GetPropertyValue (current, seg);
}
}
return current;
}
private static object GetPropertyValue (object target, string propName)
{
if (target == null) return null;
Type type = target.GetType ();
// 根对象 ManifestReader 的属性名映射(不区分大小写)
if (type == typeof (ManifestReader))
{
string mapped = null;
string lower = propName.ToLowerInvariant ();
switch (lower)
{
case "pkgid":
case "id":
case "identity": mapped = "Identity"; break;
case "prop":
case "properties": mapped = "Properties"; break;
case "prerequistes":
case "prerequisite":
case "prerequisites": mapped = "Prerequisites"; break;
case "res":
case "resources": mapped = "Resources"; break;
case "apps":
case "applications": mapped = "Applications"; break;
case "caps":
case "capabilities": mapped = "Capabilities"; break;
case "deps":
case "dependencies": mapped = "Dependencies"; break;
case "type": mapped = "Type"; break;
case "role": mapped = "Role"; break;
case "valid":
case "isvalid": mapped = "IsValid"; break;
case "file":
case "filepath": mapped = "FilePath"; break;
case "fileroot": mapped = "FileRoot"; break;
}
if (mapped != null)
propName = mapped;
}
// MRProperties 别名Publisher / PublisherDisplayName 都映射到 Publisher 属性
if (type == typeof (MRProperties))
{
if (string.Equals (propName, "Publisher", StringComparison.OrdinalIgnoreCase) ||
string.Equals (propName, "PublisherDisplayName", StringComparison.OrdinalIgnoreCase))
{
propName = "Publisher";
}
}
// MRApplication 中以 Base64 结尾的属性 -> 调用 NewAtBase64
if (type == typeof (MRApplication) && propName.EndsWith ("Base64", StringComparison.OrdinalIgnoreCase))
{
string baseKey = propName.Substring (0, propName.Length - 6);
MRApplication app = (MRApplication)target;
MethodInfo method = typeof (MRApplication).GetMethod ("NewAtBase64", BindingFlags.Public | BindingFlags.Instance);
if (method != null)
{
return method.Invoke (app, new object [] { baseKey });
}
return null;
}
// MRApplication 普通属性访问(字典键,大小写不敏感)
if (type == typeof (MRApplication))
{
MRApplication app = (MRApplication)target;
return app [propName];
}
// 反射属性(不区分大小写)
PropertyInfo prop = type.GetProperty (propName,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (prop != null)
{
return prop.GetValue (target, null);
}
// 反射字段
FieldInfo field = type.GetField (propName,
BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);
if (field != null)
{
return field.GetValue (target);
}
return null;
}
private static object GetIndexedValue (object collection, int index)
{
if (collection == null) return null;
MRApplications apps = collection as MRApplications;
if (apps != null)
{
if (index >= 0 && index < apps.Applications.Count)
return apps.Applications [index];
return null;
}
IList list = collection as IList;
if (list != null && index >= 0 && index < list.Count)
return list [index];
PropertyInfo indexer = collection.GetType ().GetProperty ("Item", new [] { typeof (int) });
if (indexer != null)
return indexer.GetValue (collection, new object [] { index });
return null;
}
private static int? GetLength (object obj)
{
if (obj == null) return null;
MRApplications apps = obj as MRApplications;
if (apps != null) return apps.Applications.Count;
MRDependencies deps = obj as MRDependencies;
if (deps != null) return deps.Dependencies.Count;
IList list = obj as IList;
if (list != null) return list.Count;
ICollection coll = obj as ICollection;
if (coll != null) return coll.Count;
return null;
}
private static object SerializeObject (object obj, ManifestReader mr, bool filterBase64)
{
if (obj == null) return null;
Type type = obj.GetType ();
if (type.IsPrimitive || obj is string || obj is decimal || obj is Enum)
return obj;
// MRIdentity
if (type == typeof (MRIdentity))
{
MRIdentity id = (MRIdentity)obj;
return new {
name = id.Name,
publisher = id.Publisher,
version = id.Version.Expression,
architecture = id.ProcessArchitecture.Select (e => {
switch (e)
{
case Architecture.ARM: return "arm";
case Architecture.ARM64: return "arm64";
case Architecture.Neutral: return "neutral";
case Architecture.x64: return "x64";
case Architecture.x86: return "x86";
default: return "unknown";
}
}).ToList (),
familyName = id.FamilyName,
fullName = id.FullName,
resourceId = id.ResourceId
};
}
// MRProperties
if (type == typeof (MRProperties))
{
MRProperties prop = (MRProperties)obj;
return new {
displayName = prop.DisplayName,
publisherDisplayName = prop.Publisher,
description = prop.Description,
logo = prop.Logo,
framework = prop.Framework,
resourcePackage = prop.ResourcePackage
};
}
// MRPrerequisites
if (type == typeof (MRPrerequisites))
{
MRPrerequisites pre = (MRPrerequisites)obj;
return new {
osMinVersion = pre.OSMinVersion,
osMaxVersionTested = pre.OSMaxVersionTested,
_osMinVersion = pre.OSMinVersionDescription,
_osMaxVersionTested = pre.OSMaxVersionDescription
};
}
// MRResources
if (type == typeof (MRResources))
{
MRResources res = (MRResources)obj;
return new {
languages = res.Languages,
scales = res.Scales,
dxFeatureLevels = res.DXFeatures.Select (d => {
switch (d)
{
case DXFeatureLevel.Level9: return 9;
case DXFeatureLevel.Level10: return 10;
case DXFeatureLevel.Level11: return 11;
case DXFeatureLevel.Level12: return 12;
default: return -1;
}
}).ToList ()
};
}
// MRCapabilities
if (type == typeof (MRCapabilities))
{
MRCapabilities caps = (MRCapabilities)obj;
return new {
capabilities = caps.Capabilities,
deviceCapabilities = caps.DeviceCapabilities
};
}
// MRDependencies
if (type == typeof (MRDependencies))
{
MRDependencies deps = (MRDependencies)obj;
return deps.Select (e => new {
name = e.Name,
publisher = e.Publisher,
minVersion = e.Version.ToString ()
}).ToList ();
}
// MRApplications (集合)
if (type == typeof (MRApplications))
{
MRApplications apps = (MRApplications)obj;
return apps.Select (e => SerializeObject (e, mr, filterBase64)).ToList ();
}
// MRApplication (单个应用)
if (type == typeof (MRApplication))
{
MRApplication app = (MRApplication)obj;
var dict = new Dictionary<string, string> (StringComparer.OrdinalIgnoreCase);
foreach (var kv in app)
{
if (kv.Key.IndexOf ("Base64", StringComparison.OrdinalIgnoreCase) >= 0)
continue;
string value = app.NewAt (kv.Key, mr.EnablePri);
if (string.IsNullOrWhiteSpace (value))
value = app.At (kv.Key);
dict [kv.Key] = value;
}
return dict;
}
// IDictionary
IDictionary dictObj = obj as IDictionary;
if (dictObj != null)
{
var result = new Dictionary<string, object> (StringComparer.OrdinalIgnoreCase);
foreach (DictionaryEntry entry in dictObj)
{
string key = entry.Key?.ToString ();
if (string.IsNullOrEmpty (key)) continue;
if (filterBase64 && key.EndsWith ("_Base64", StringComparison.OrdinalIgnoreCase))
continue;
result [key] = SerializeObject (entry.Value, mr, filterBase64);
}
return result;
}
// IEnumerable (非字符串)
if (!(obj is string))
{
IEnumerable enumerable = obj as IEnumerable;
if (enumerable != null)
{
var list = new List<object> ();
foreach (var item in enumerable)
list.Add (SerializeObject (item, mr, filterBase64));
return list;
}
}
// 后备:反射属性
var props = type.GetProperties (BindingFlags.Public | BindingFlags.Instance);
var propDict = new Dictionary<string, object> (StringComparer.OrdinalIgnoreCase);
foreach (var prop in props)
{
if (prop.GetIndexParameters ().Length > 0) continue;
string propName = prop.Name;
if (filterBase64 && propName.EndsWith ("Base64", StringComparison.OrdinalIgnoreCase))
continue;
object val = prop.GetValue (obj, null);
propDict [propName] = SerializeObject (val, mr, filterBase64);
}
return propDict;
}
}
}

View File

@@ -2,13 +2,858 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataUtils;
using AppxPackage;
using System.IO;
using static AppxPackage.PackageManager;
using Newtonsoft.Json;
using Win32;
namespace PkgCLI
{
class Program
{
public delegate _I_HResult PackageOperation (string filePath, IEnumerable<string> depUris, DeploymentOptions options, PackageProgressCallback progress = null);
static readonly string [] helpArgs = new string [] {
"/?",
"-?",
"help",
"/help",
"-help",
"/h",
"-h"
};
public static StringResXmlDoc res = new StringResXmlDoc (Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "locale\\pkgcli.xml"));
static bool IsHelpParam (string arg) => helpArgs.Contains (arg.Normalize ());
static void PrintVersion ()
{
var verFilePath = Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "version");
var verFileInst = new _I_File (verFilePath);
var verstr = verFileInst.Content?.Trim () ?? "0.0.0.1";
Console.WriteLine (String.Format (res.Get ("PKGCLI_VERSION"), verstr));
}
static void PrintTotalHelp ()
{
Console.WriteLine (res.Get ("PKGCLI_TOTALHELP"));
}
public static bool IsFilePathInList (List<string> filelist, string file)
{
foreach (var f in filelist)
{
if (f.NEquals (file)) return true;
}
return false;
}
public static void AddFiles (List<string> filelist, string file)
{
if (string.IsNullOrWhiteSpace (file)) return;
if (!File.Exists (file)) file = Path.Combine (Environment.CurrentDirectory, file);
if (!File.Exists (file)) return;
var ext = Path.GetExtension (file);
if (ext.NEquals (".txt"))
{
var lines = File.ReadAllLines (file);
foreach (var l in lines)
{
if (string.IsNullOrWhiteSpace (l)) continue;
var line = l.Trim ();
if (!File.Exists (l)) line = Path.Combine (Path.GetDirectoryName (file), l);
if (!File.Exists (line)) continue;
if (!IsFilePathInList (filelist, line))
filelist.Add (line);
}
}
else if (!IsFilePathInList (filelist, file)) filelist.Add (file);
}
public static void AddNStringItems (List<string> strlist, string str)
{
var find = false;
foreach (var l in strlist)
if (l.NEquals (str))
{
find = true;
break;
}
if (!find) strlist.Add (str);
}
public static void ToFormatString (PMPackageInfo pkg, IEnumerable<string> filter)
{
if (pkg == null) return;
var labels = new List<string> ();
var values = new List<string> ();
var id = pkg.Identity;
labels.Add ("Identity:Name"); values.Add (id.Name);
labels.Add ("Identity:Publisher"); values.Add (id.Publisher);
labels.Add ("Identity:FamilyName"); values.Add (id.FamilyName);
labels.Add ("Identity:FullName"); values.Add (id.FullName);
labels.Add ("Identity:PublisherId"); values.Add (id.PublisherId);
labels.Add ("Identity:ResourceId"); values.Add (id.ResourceId);
labels.Add ("Identity:Version"); values.Add (id.Version?.ToString () ?? "");
labels.Add ("Identity:ProcessArchitecture"); values.Add (string.Join (", ", id.ProcessArchitecture));
var prop = pkg.Properties;
labels.Add ("Properties:DisplayName"); values.Add (prop.DisplayName);
labels.Add ("Properties:Description"); values.Add (prop.Description);
labels.Add ("Properties:Publisher"); values.Add (prop.Publisher);
labels.Add ("Properties:Framework"); values.Add (prop.Framework.ToString ());
labels.Add ("Properties:ResourcePackage"); values.Add (prop.ResourcePackage.ToString ());
labels.Add ("Properties:Logo"); values.Add (prop.Logo);
labels.Add ("IsBundle"); values.Add (pkg.IsBundle.ToString ());
labels.Add ("DevelopmentMode"); values.Add (pkg.DevelopmentMode.ToString ());
labels.Add ("InstallLocation"); values.Add (pkg.InstallLocation);
labels.Add ("Users"); values.Add (string.Join ("; ", pkg.Users));
Console.WriteLine ($"[{pkg.Identity.FullName}]");
var indicesToOutput = new List<int> ();
bool outputAll = (filter == null || !filter.Any ());
for (int i = 0; i < labels.Count; i++)
{
if (outputAll)
{
indicesToOutput.Add (i);
}
else
{
string label = labels [i];
foreach (string patternRaw in filter)
{
if (MatchPattern (label, patternRaw))
{
indicesToOutput.Add (i);
break;
}
}
}
}
if (indicesToOutput.Count == 0) return;
int maxLabelLen = 0;
foreach (int i in indicesToOutput)
if (labels [i].Length > maxLabelLen) maxLabelLen = labels [i].Length;
string format = "{0,-" + maxLabelLen + "} = {1}";
foreach (int i in indicesToOutput)
Console.WriteLine (format, labels [i], values [i]);
}
/// <summary>
/// 匹配模式(忽略大小写,首尾空格,支持通配符 *
/// </summary>
private static bool MatchPattern (string text, string pattern)
{
if (string.IsNullOrEmpty (pattern)) return true;
pattern = pattern.Trim ();
text = text ?? "";
if (pattern == "*") return true;
// 忽略大小写
var comparison = StringComparison.OrdinalIgnoreCase;
// 检查通配符位置
bool startsWithStar = pattern.StartsWith ("*");
bool endsWithStar = pattern.EndsWith ("*");
if (startsWithStar && endsWithStar)
{
// *middle* 包含子串
string middle = pattern.Substring (1, pattern.Length - 2);
return text.IndexOf (middle, comparison) >= 0;
}
else if (startsWithStar)
{
// *suffix 以 suffix 结尾
string suffix = pattern.Substring (1);
return text.EndsWith (suffix, comparison);
}
else if (endsWithStar)
{
// prefix* 以 prefix 开头
string prefix = pattern.Substring (0, pattern.Length - 1);
return text.StartsWith (prefix, comparison);
}
else
{
// 精确匹配(忽略大小写)
return string.Equals (text, pattern, comparison);
}
}
/// <summary>
/// 判断字符串是否为有效的包全名 (Package Full Name)
/// 格式: <IdentityName>_<Version>_<ProcessorArchitecture>_<ResourceId>_<PublisherId>
/// 其中 ResourceId 可以为空(表现为连续两个下划线)
/// </summary>
public static bool IsPackageFullName (string fullName)
{
if (string.IsNullOrWhiteSpace (fullName)) return false;
string [] parts = fullName.Split (new char [] { '_' }, StringSplitOptions.None);
if (parts.Length != 5)
return false;
if (string.IsNullOrEmpty (parts [0])) // IdentityName
return false;
if (string.IsNullOrEmpty (parts [1])) // Version
return false;
if (string.IsNullOrEmpty (parts [2])) // ProcessorArchitecture
return false;
if (string.IsNullOrEmpty (parts [4])) // PublisherId
return false;
if (!parts [1].Contains ('.')) return false;
return true;
}
/// <summary>
/// 判断字符串是否为有效的包系列名 (Package Family Name)
/// 格式: <IdentityName>_<PublisherId>
/// </summary>
public static bool IsPackageFamilyName (string familyName)
{
if (string.IsNullOrWhiteSpace (familyName)) return false;
string [] parts = familyName.Split ('_');
if (parts.Length != 2) return false;
if (string.IsNullOrEmpty (parts [0]) || string.IsNullOrEmpty (parts [1]))
return false;
return true;
}
/// <summary>
/// 从 args[startIndex..] 生成安全的命令行字符串
/// </summary>
private static string BuildCommandLine (string [] args, int startIndex)
{
if (args.Length <= startIndex) return null;
var sb = new StringBuilder ();
for (int i = startIndex; i < args.Length; i++)
{
if (i > startIndex) sb.Append (' ');
sb.Append (EscapeArgument (args [i]));
}
return sb.ToString ();
}
/// <summary>
/// 按 Win32 命令行规则转义单个参数
/// </summary>
private static string EscapeArgument (string arg)
{
if (string.IsNullOrEmpty (arg)) return "\"\"";
bool needQuotes = false;
foreach (char c in arg)
{
if (char.IsWhiteSpace (c) || c == '"')
{
needQuotes = true;
break;
}
}
if (!needQuotes) return arg;
var sb = new StringBuilder ();
sb.Append ('"');
foreach (char c in arg)
{
if (c == '"') sb.Append ("\\\"");
else sb.Append (c);
}
sb.Append ('"');
return sb.ToString ();
}
public static readonly string [] configItems = new string [] {
"AppMetadataItems"
};
public static void RefreshConfig ()
{
var conf = new InitConfig (Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "config.ini"));
var sSettings = conf.GetSection ("Settings");
var kAppMetadatas = sSettings.GetKey ("PkgCLI:AppMetadataItems");
var appMd = kAppMetadatas.ReadString ("Id,BackgroundColor,DisplayName,ForegroundText,ShortName,SmallLogo,Square44x44Logo");
var appMdList = (appMd ?? "").Split (',', ';', '|');
for (var i = 0; i < appMdList.Length; i ++)
{
appMdList [i] = appMdList [i].Trim ();
}
PackageReader.UpdateApplicationItems (appMdList);
}
static void Main (string [] args)
{
var currencoding = Console.OutputEncoding;
try
{
//Console.OutputEncoding = Encoding.UTF8;
if (args.Length <= 0 || args.Length >= 1 && IsHelpParam (args [0]))
{
PrintVersion ();
PrintTotalHelp ();
return;
}
var parser = new CliParsing ();
parser.Params = new HashSet<CmdParamName> (new CmdParamName [] {
new CmdParamName ("install", new string [] { "add" }),
new CmdParamName ("register", new string [] { "reg" }),
new CmdParamName ("update", new string [] { "up" }),
new CmdParamName ("stage"),
new CmdParamName ("remove", new string [] { "uninstall" }),
new CmdParamName ("read"),
new CmdParamName ("get"),
new CmdParamName ("find"),
new CmdParamName ("active", new string [] { "launch", "start", "activate" }),
new CmdParamName ("config", new string [] { "conf" }),
new CmdParamName ("version", new string [] { "ver" }),
new CmdParamName ("help", new string [] { "?", "h" }),
new CmdParamName ("developmode", new string [] { "develop" }),
new CmdParamName ("forceappshutdown", new string [] { "forceshutdown" , "appshutdown", "forcesd", "force"}),
new CmdParamName ("installallresources", new string [] {"allresources", "allres"}),
new CmdParamName ("savexml"),
new CmdParamName ("savejson"),
new CmdParamName ("fullname"),
new CmdParamName ("filter"),
new CmdParamName ("package", new string [] { "pkg" }),
new CmdParamName ("manifest", new string [] { "mani" }),
new CmdParamName ("usepri", new string [] { "pri" }),
new CmdParamName ("item"),
new CmdParamName ("set"),
new CmdParamName ("refresh"),
new CmdParamName ("show"),
new CmdParamName ("encoding", new string [] { "en", "charset", "encode" }),
new CmdParamName ("yes", new string [] {"y", "agree"})
});
RefreshConfig ();
var cmds = parser.Parse (args);
if (cmds.ParamContains ("encoding"))
{
#region help text: encoding
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_ENCODING"));
return;
}
#endregion
try
{
var c = cmds.GetFromId ("encoding");
var i = 0;
var isint = false;
Encoding en = null;
try { i = Convert.ToInt32 (c.Value); isint = true; } catch { isint = false; }
if (isint) en = Encoding.GetEncoding (i);
else en = Encoding.GetEncoding (c.Value);
Console.OutputEncoding = en;
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine (String.Format (res.Get ("PKGCLI_WARNING_ENCODING"), ex.GetType (), ex.Message));
Console.ResetColor ();
}
}
if (CliPasingUtils.ParamsContainsOr (cmds, "install", "register", "update", "stage"))
{
#region help text: install register, update, stage
PrintVersion ();
if (CliPasingUtils.ParamContains (cmds, "help"))
{
Console.WriteLine (res.Get ("PKGCLI_HELP_IRUS"));
return;
}
#endregion
var options = DeploymentOptions.None;
if (CliPasingUtils.ParamContains (cmds, "developmode")) options |= DeploymentOptions.DevelopmentMode;
if (CliPasingUtils.ParamContains (cmds, "forceappshutdown")) options |= DeploymentOptions.ForceAppShutdown;
if (CliPasingUtils.ParamContains (cmds, "installallresources")) options |= DeploymentOptions.InstallAllResources;
var totallist = new List<Tuple<int, string>> ();
var filelist = new List<string> ();
foreach (var f in cmds)
{
if (string.IsNullOrWhiteSpace (f.Id))
{
var file = f.Value;
AddFiles (filelist, file);
}
else
{
switch (f.Id)
{
case "install":
case "register":
case "update":
case "stage":
AddFiles (filelist, f.Value);
break;
}
}
}
foreach (var f in filelist) totallist.Add (new Tuple<int, string> (0, f));
if (cmds.ParamContains ("register") && cmds.ParamContains ("fullname"))
{
foreach (var f in cmds)
{
if (f.Id.NEquals ("fullname"))
{
if (string.IsNullOrWhiteSpace (f.Value))
{
totallist.Add (new Tuple<int, string> (1, f.Value));
}
}
}
}
PackageOperation ope = null;
if (cmds.ParamContains ("install")) ope = AddPackage;
else if (cmds.ParamContains ("register")) ope = RegisterPackage;
else if (cmds.ParamContains ("update")) ope = UpdatePackage;
else if (cmds.ParamContains ("stage")) ope = StagePackage;
for (int i = 0; i < totallist.Count; i++)
{
Console.WriteLine ();
var file = totallist [i];
Console.Write ("\r" + String.Format (res.Get ("PKGCLI_PROGRESS_OPERATION"), i + 1, totallist.Count));
var hr = new _I_HResult (0);
var tempope = ope;
if (file.Item1 == 1)
{
if (cmds.ParamContains ("register")) tempope = RegisterPackageByFullName;
}
hr = tempope (file.Item2, null, options, prog => {
var str = "\r" + String.Format (res.Get ("PKGCLI_PROGRESS_OPERATION_WITHPROGRESS"), i + 1, totallist.Count, prog, (int)((i + prog * 0.01) / totallist.Count * 100));
Console.Write (str);
});
if (hr.Failed)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write ("\n" + String.Format (res.Get ("PKGCLI_ERROR_IRUS_EXCEPTION"), i + 1, file.Item2, "0x" + hr.HResult.ToString ("X8"), hr.Message));
Console.ResetColor ();
}
}
Console.WriteLine ("\n" + res.Get ("PKGCLI_COMPLETE_OPERATION"));
return;
}
else if (cmds.ParamsContainsOr ("remove"))
{
#region help text: remove
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_REMOVE"));
return;
}
#endregion
var list = new List<string> ();
foreach (var c in cmds)
{
if (string.IsNullOrWhiteSpace (c.Id) || c.Id.NEquals ("remove"))
{
if (!string.IsNullOrWhiteSpace (c.Value)) list.Add (c.Value);
}
}
var agreecmd = cmds.GetFromId ("yes");
bool? agree = null;
if (agreecmd != null) agree = true;
if (agree == null)
{
if (list.Count <= 0) agree = true;
else
{
Console.Write (String.Format (res.Get ("PKGCLI_ASK_REMOVE"), list.Count));
var userinput = Console.ReadLine ();
if (userinput.NEquals ("y") || userinput.NEquals ("yes")) agree = true;
else agree = false;
}
}
if (agree == false) throw new OperationCanceledException (res.Get ("PKGCLI_ERROR_USERABORT"));
for (int i = 0; i < list.Count; i++)
{
Console.WriteLine ();
var file = list [i];
Console.Write ("\r" + String.Format (res.Get ("PKGCLI_PROGRESS_OPERATION"), i + 1, list.Count));
var hr = RemovePackage (file, prog => {
var str = "\r" + String.Format (res.Get ("PKGCLI_PROGRESS_OPERATION_WITHPROGRESS"), i + 1, list.Count, prog, (int)((i + prog * 0.01) / list.Count * 100));
Console.Write (str);
});
if (hr.Failed)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write ("\n" + String.Format (res.Get ("PKGCLI_ERROR_IRUS_EXCEPTION"), i + 1, file, "0x" + hr.HResult.ToString ("X8"), hr.Message));
Console.ResetColor ();
}
}
Console.WriteLine ("\n" + res.Get ("PKGCLI_COMPLETE_OPERATION"));
return;
}
else if (cmds.ParamsContainsOr ("get"))
{
#region help text: get
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_GET"));
return;
}
#endregion
var filter = new HashSet<string> (new NormalizeStringComparer ());
if (cmds.ParamContains ("filter"))
{
foreach (var c in cmds)
{
if (c.Id.NEmpty () || c.Id.NEquals ("filter"))
{
var items = c.Value.Split (',', ';');
foreach (var i in items) filter.Add (i);
}
}
}
var hr = GetPackages ();
if (hr.Item1.Failed)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine (String.Format (res.Get ("PKGCLI_ERROR_EXCEPTION"), "0x" + hr.Item1.HResult.ToString ("X8"), hr.Item1.Message));
Console.ResetColor ();
return;
}
foreach (var i in hr.Item2)
{
ToFormatString (i, filter);
Console.WriteLine ();
}
Console.WriteLine ("[Statistic]");
Console.WriteLine ($"Length = {hr.Item2.Count}");
return;
}
else if (cmds.ParamsContainsOr ("find"))
{
#region help text: find
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_FIND"));
return;
}
#endregion
var names = new List<string> ();
foreach (var c in cmds)
{
if (c.Id.NEmpty ())
{
if (c.Value.NEmpty ()) continue;
names.Add (c.Value);
}
}
var filter = new HashSet<string> (new NormalizeStringComparer ());
if (cmds.ParamContains ("filter"))
{
foreach (var c in cmds)
{
if (c.Id.NEquals ("filter"))
{
var items = c.Value.Split (',', ';');
foreach (var i in items) filter.Add (i);
}
}
}
var result = new List<Tuple<string, Tuple<_I_HResult, List<PMPackageInfo>>>> ();
if (names.Count == 2)
{
result.Add (new Tuple<string, Tuple<_I_HResult, List<PMPackageInfo>>> (names [0], FindPackage (names [0], names [1])));
}
else
{
foreach (var n in names)
{
if (IsPackageFullName (n))
{
result.Add (new Tuple<string, Tuple<_I_HResult, List<PMPackageInfo>>> (n, FindPackageByFullName (n)));
}
else
{
result.Add (new Tuple<string, Tuple<_I_HResult, List<PMPackageInfo>>> (n, FindPackage (n)));
}
}
}
foreach (var r in result)
{
foreach (var l in r.Item2.Item2)
{
ToFormatString (l, filter);
Console.WriteLine ();
}
Console.WriteLine ($"[Statistic:{r.Item1}]");
Console.WriteLine ($"HResult = {"0x" + r.Item2.Item1.HResult.ToString ("X8")}");
Console.WriteLine ($"Message = {Escape.ToEscape (r.Item2.Item1.Message)}");
Console.WriteLine ($"Length = {r.Item2.Item2.Count}");
}
return;
}
else if (cmds.ParamsContainsOr ("active"))
{
#region help text: active
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_ACTIVATE"));
return;
}
#endregion
foreach (var c in cmds)
{
if (string.IsNullOrWhiteSpace (c.Id) || c.Id.NEquals ("active"))
{
if (c.Value.NEmpty ()) continue;
var i = 0;
for (i = 0; i < args.Length; i++)
{
if (args [i].NNormalize ().IndexOf (c.Value.NNormalize ()) >= 0) break;
}
var hr = ActiveApp (c.Value, BuildCommandLine (args, i + 1));
if (hr.Succeeded) Console.WriteLine (res.Get ("PKGCLI_COMPLETE_DONE"));
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.Write (String.Format (res.Get ("PKGCLI_ERROR_EXCEPTION"), "0x" + hr.HResult.ToString ("X8"), hr.Message));
Console.ResetColor ();
}
return;
}
}
return;
}
else if (cmds.ParamsContainsOr ("read"))
{
#region help text: read
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_READ"));
return;
}
#endregion
var filename = "";
var readtype = "";
var savename = "";
var savetype = "default";
CommandParam cmd = null;
cmd = cmds.GetFromId ("manifest");
if (cmd != null)
{
filename = cmd.Value;
readtype = "manifest";
}
cmd = cmds.GetFromId ("package");
if (cmd != null)
{
filename = cmd.Value;
readtype = "package";
}
if (string.IsNullOrWhiteSpace (filename) || !File.Exists (filename))
{
cmd = cmds.GetFromId ("");
if (cmd != null)
{
if (File.Exists (cmd.Value))
{
filename = cmd.Value;
if (string.IsNullOrWhiteSpace (readtype))
{
var ext = Path.GetExtension (cmd.Value);
if (ext.NEquals (".xml") || ext.NEquals (".appxpackage") || ext.NEquals (".msixpackage"))
readtype = "manifest";
else readtype = "package";
}
}
}
}
if (string.IsNullOrWhiteSpace (filename) || !File.Exists (filename))
{
cmd = cmds.GetFromId ("read");
if (cmd != null)
{
if (File.Exists (cmd.Value))
{
filename = cmd.Value;
if (string.IsNullOrWhiteSpace (readtype))
{
var ext = Path.GetExtension (cmd.Value);
if (ext.NEquals (".xml") || ext.NEquals (".appxpackage") || ext.NEquals (".msixpackage"))
readtype = "manifest";
else readtype = "package";
}
}
}
}
if (string.IsNullOrWhiteSpace (filename) || !File.Exists (filename)) throw new FileNotFoundException ();
cmd = cmds.GetFromId ("savexml");
if (cmd != null)
{
savename = cmd.Value;
savetype = "xml";
}
if (string.IsNullOrWhiteSpace (savename))
{
cmd = cmds.GetFromId ("savejson");
if (cmd != null)
{
savename = cmd.Value;
savetype = "json";
}
}
if (string.IsNullOrWhiteSpace (savename))
{
savetype = "ini";
}
switch (readtype)
{
default:
case "package":
{
var pr = new PackageReader (filename);
pr.UsePri = cmds.ParamContains ("usepri");
pr.EnablePri = true;
switch (savetype)
{
default:
case "default":
{
if (cmds.ParamContains ("item"))
{
object value = pr.GetItem (cmds.GetFromId ("item").Value);
if (value is string) Console.WriteLine (value as string);
else if (value is DataUtils.Version) Console.WriteLine (value.ToString ());
else Console.WriteLine (JsonConvert.SerializeObject (value, Formatting.Indented));
}
else Console.WriteLine (JsonConvert.SerializeObject (pr.GetJsonObjectForCli (), Formatting.Indented));
}
break;
case "json":
{
var res = pr.SaveJsonFileCS (savename);
if (res) Console.WriteLine ("Succeeded!");
else Console.WriteLine ("Failed.");
}
break;
case "xml":
{
var res = pr.SaveXmlFileCS (savename);
if (res) Console.WriteLine ("Succeeded!");
else Console.WriteLine ("Failed.");
}
break;
}
}
break;
case "manifest":
{
var mr = new ManifestReader (filename);
mr.UsePri = cmds.ParamContains ("usepri");
mr.EnablePri = true;
if (cmds.ParamContains ("item"))
{
object value = mr.GetItem (cmds.GetFromId ("item").Value);
if (value is string) Console.WriteLine (value as string);
else if (value is DataUtils.Version) Console.WriteLine (value.ToString ());
else Console.WriteLine (JsonConvert.SerializeObject (value, Formatting.Indented));
}
else Console.WriteLine (JsonConvert.SerializeObject (mr.GetJsonObjectForCli (), Formatting.Indented));
//Console.WriteLine (mr.BuildJsonText ());
}
break;
}
return;
}
else if (cmds.ParamsContainsOr ("config"))
{
#region help text: config
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_CONFIG"));
return;
}
#endregion
var conf = new InitConfig (Path.Combine (AppDomain.CurrentDomain.BaseDirectory, "config.ini"));
var sSettings = conf.GetSection ("Settings");
if (cmds.ParamContains ("refresh")) RefreshConfig ();
else if (cmds.ParamContains ("set"))
{
var cmd = cmds.GetFromId ("set");
var key = cmd.Value;
if (string.IsNullOrWhiteSpace (key)) throw new InvalidOperationException (Program.res.Get ("PKGCLI_ERROR_KEYSTRINGEMPTY"));
var isfind = false;
foreach (var i in configItems)
{
if (i.NEquals (key))
{
isfind = true;
break;
}
}
if (!isfind) throw new KeyNotFoundException (String.Format (Program.res.Get("PKGCLI_ERROR_CANNOTFINDKEY"), key));
var valuelist = new List<string> ();
foreach (var c in cmds)
{
if (c.Id.NEmpty ())
{
if (string.IsNullOrWhiteSpace (c.Value)) continue;
valuelist.Add (c.Value);
}
}
var res = sSettings.GetKey ($"PkgCLI:{key.Trim ()}").Set (valuelist.Join (","));
if (res) Console.WriteLine ("Succeeded!");
else Console.WriteLine ("Failed.");
}
else if (cmds.ParamContains ("show"))
{
var cmd = cmds.GetFromId ("show");
var key = cmd.Value;
if (string.IsNullOrWhiteSpace (key))
{
var dict = new Dictionary<string, string> ();
foreach (var k in configItems)
{
var cKey = sSettings.GetKey ($"PkgCLI:{k}");
dict [k] = cKey.ReadString ("(use default)");
}
Console.WriteLine (dict.FormatDictionaryAligned ("="));
return;
}
var isfind = false;
foreach (var i in configItems)
{
if (i.NEquals (key))
{
isfind = true;
break;
}
}
if (!isfind) throw new KeyNotFoundException (String.Format (Program.res.Get ("PKGCLI_ERROR_CANNOTFINDKEY"), key));
var value = sSettings.GetKey ($"PkgCLI:{key.Trim ()}").ReadString ("(use default)");
Console.WriteLine (value);
}
return;
}
else if (cmds.ParamsContainsOr ("version"))
{
#region help text: version
if (CliPasingUtils.ParamContains (cmds, "help"))
{
PrintVersion ();
Console.WriteLine (res.Get ("PKGCLI_HELP_VERSION"));
return;
}
#endregion
PrintVersion ();
return;
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine ("Invalid args. Please use \"/help\" to get help.");
Console.ResetColor ();
}
}
catch (Exception ex)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine (String.Format (res.Get ("PKGCLI_ERROR_FINALEXCEPTION"), ex.GetType (), ex.Message, ex.StackTrace));
}
finally
{
Console.ResetColor ();
Console.OutputEncoding = currencoding;
}
}
}
}

112
PkgCLI/Text.cs Normal file
View File

@@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
namespace System
{
namespace Text
{
public static class Escape
{
/// <summary>按 JSON 规范对字符串进行转义。</summary>
/// <param name="input">原始字符串。</param>
/// <returns>转义后的 JSON 字符串字面量内容(不含外围双引号)。</returns>
public static string ToEscape (string input)
{
if (input == null) throw new ArgumentNullException (nameof (input));
if (input.Length == 0) return string.Empty;
StringBuilder sb = new StringBuilder (input.Length);
foreach (char c in input)
{
switch (c)
{
case '"': sb.Append ("\\\""); break;
case '\\': sb.Append ("\\\\"); break;
case '\b': sb.Append ("\\b"); break;
case '\f': sb.Append ("\\f"); break;
case '\n': sb.Append ("\\n"); break;
case '\r': sb.Append ("\\r"); break;
case '\t': sb.Append ("\\t"); break;
default:
// 控制字符 (U+0000 - U+001F) 需转义为 \uXXXX
if (c <= 0x1F)
{
sb.Append ("\\u");
sb.Append (((int)c).ToString ("X4"));
}
else
{
sb.Append (c);
}
break;
}
}
return sb.ToString ();
}
/// <summary>按 JSON 规范反转义字符串。</summary>
/// <param name="input">转义后的 JSON 字符串内容(不含外围双引号)。</param>
/// <returns>原始字符串。</returns>
/// <exception cref="FormatException">遇到非法转义序列时抛出。</exception>
public static string Unescape (string input)
{
if (input == null) throw new ArgumentNullException (nameof (input));
if (input.Length == 0) return string.Empty;
StringBuilder sb = new StringBuilder (input.Length);
int i = 0;
while (i < input.Length)
{
char c = input [i];
if (c == '\\')
{
i++;
if (i >= input.Length)
throw new FormatException ("字符串末尾包含不完整的转义序列。");
char next = input [i];
switch (next)
{
case '"': sb.Append ('"'); break;
case '\\': sb.Append ('\\'); break;
case '/': sb.Append ('/'); break; // 允许转义斜杠
case 'b': sb.Append ('\b'); break;
case 'f': sb.Append ('\f'); break;
case 'n': sb.Append ('\n'); break;
case 'r': sb.Append ('\r'); break;
case 't': sb.Append ('\t'); break;
case 'u':
i++;
if (i + 4 > input.Length)
throw new FormatException ("\\u 转义后必须跟随 4 位十六进制数字。");
string hex = input.Substring (i, 4);
int codePoint; // 先声明变量,兼容 C# 5/6
if (!int.TryParse (hex,
NumberStyles.HexNumber,
CultureInfo.InvariantCulture,
out codePoint))
{
throw new FormatException (string.Format ("无效的 Unicode 转义序列: \\u{0}", hex));
}
sb.Append ((char)codePoint);
i += 3; // 循环末尾会再加1因此这里只增加3
break;
default:
throw new FormatException (string.Format ("未识别的转义序列: \\{0}", next));
}
}
else
{
sb.Append (c);
}
i++;
}
return sb.ToString ();
}
}
}
}

4
PkgCLI/packages.config Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="13.0.4" targetFramework="net40" />
</packages>

View File

@@ -142,6 +142,11 @@ namespace PriFileFormat
comStream.SetSize (value);
}
}
public override void Close ()
{
comStream = null;
base.Close ();
}
~ComStreamWrapper () { comStream = null;}
}
}

View File

@@ -174,11 +174,15 @@ namespace PriFileFormat
}
~HierarchicalSchemaSection ()
{
Version = null;
foreach (var item in Items) { item.Parent = null; }
foreach (var scope in Scopes) { scope.Parent = null; }
Scopes = null;
Items = null;
try
{
Version = null;
foreach (var item in Items) { item.Parent = null; }
foreach (var scope in Scopes) { scope.Parent = null; }
Scopes = null;
Items = null;
}
catch { }
}
// Checksum computation is buggy for some files

View File

@@ -35,6 +35,25 @@
<Prefer32Bit>false</Prefer32Bit>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -48,7 +67,6 @@
<Compile Include="ByteSpan.cs" />
<Compile Include="ComStreamWrapper.cs" />
<Compile Include="DataItemSection.cs" />
<Compile Include="DataTree.cs" />
<Compile Include="DecisionInfoSection.cs" />
<Compile Include="HierarchicalSchemaSection.cs" />
<Compile Include="PriDescriptorSection.cs" />

View File

@@ -1,3 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/></startup></configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6"/>
</startup>
</configuration>

View File

@@ -30,6 +30,25 @@
<WarningLevel>4</WarningLevel>
<RegisterForComInterop>false</RegisterForComInterop>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -12,12 +12,21 @@
<p>Download the latest release from the Releases section.</p>
<a href="https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/releases" target="_blank"><img src="https://img.shields.io/github/v/release/modernw/App-Installer-For-Windows-8.x-Reset"></a>
<p>Note: There is no official release yet, but the test version still does not have the Pre-released label; this is for testing upgrade functionality. Once the official release is complete, previous versions will be marked as Pre-released.</p>
<p>Note 2: Ensure that .NET Framework 4.6 is installed on your computer, as the runtime libraries automatically installed by the installer may not actually be installed on your system. Therefore, after completing the installation via the installer, be sure to download and run the .NET Framework 4.6 runtime library installer again.</p>
<p>Note 3: The x86 runtime library must be installed, as the program itself is compiled for the x86 architecture. (Unless the program is compiled for the ARM architecture, in which case the ARM runtime library must be installed.)</p>
<a href="https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/releases/tag/0.0.0.0" target="blank">Download Runtime Libraries</a><br>
<a href="https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/releases/download/0.0.0.1/depsinstaller.zip" target="blank">Download Dependencies for Metro Apps</a>
<h2>Attention</h2>
<ul>
<li><del>This program is an x86 program, not an ARM application, not cross-platform, and cannot be used on Windows RT.</del></li>
<li>The program uses some third-party libraries and other GitHub projects, and is completed with the assistance of AI (ChatGTP). This project can be used for learning and communication purposes.</li>
<li>(Important) Internet Explorer must support TLS 1.2 (requiring the use of IE's XMLHttpRequest to retrieve update information), especially IE10. You can do this by opening the "Advanced" tab in Control Panel/Internet Explorer's "Internet Options," finding "Use TLS 1.2" and checking the box, then clicking "OK" and saving. The settings will take effect the next time you open the browser.<br><img width="300" height="395" alt="屏幕截图 2025-12-08 103450" src="https://github.com/user-attachments/assets/69ee21ca-7f47-4d56-8dde-37e5704776c1" /></li>
</ul>
<h2>Special Thanks</h2>
<a href="https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/graphs/contributors">
<!-- Made with [contrib.rocks](https://contrib.rocks). -->
<img src="https://contrib.rocks/image?repo=modernw/App-Installer-For-Windows-8.x-Reset" />
</a>
<hr>
<p>(Translated by Google Translate)</p>
<picture>

View File

@@ -36,6 +36,24 @@
<PropertyGroup>
<ApplicationIcon>Project1.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -29,6 +29,25 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>2</WarningLevel>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>..\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<LangVersion>default</LangVersion>
<ErrorReport>prompt</ErrorReport>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -1808,6 +1808,7 @@ std::vector <std::wstring> LoadFileListW (const std::wstring &filePath)
std::wstring line;
while (std::getline (file, line))
{
line = std::wnstring::trim (line);
if (!line.empty () && line.back () == L'\r') line.pop_back ();
if (!line.empty () && !std::wnstring::empty (line) && IsFileExists (line)) result.push_back (line);
auto fullFile = CombinePath (GetFileDirectoryW (filePath), line);

View File

@@ -269,7 +269,7 @@ std::string GetSuitableLanguageValue (const std::map <std::nstring, std::string>
if (map.empty ()) return "";
std::string ret = GetSuitableLanguageValue (map, pugi::as_utf8 (GetComputerLocaleCodeW ()));
if (ret.empty ()) ret = GetSuitableLanguageValue (map, "en-US");
if (ret.empty ()) ret = map.begin ()->second;
//if (ret.empty ()) ret = map.begin ()->second;
return ret;
}
struct xmldoc
@@ -323,7 +323,8 @@ std::wstring GetCapabilityDisplayName (const std::wstring &capname)
{
for (auto &it : g_nameToId)
{
if (it.first == searchname) return GetRCStringSW (it.second);
if (it.first == searchname)
return GetRCStringSW (it.second);
}
}
else return ret;

Binary file not shown.

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{33D91B58-1981-4A3C-B4D1-86EE406CDE12}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>priformatcli</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>true</CLRSupport>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<LinkIncremental>true</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<LinkIncremental>false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PRIFORMATCLI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;PRIFORMATCLI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AdditionalDependencies>shlwapi.lib;version.lib;dwmapi.lib;winhttp.lib;Psapi.lib;advapi32.lib;gdi32.lib;comdlg32.lib;shell32.lib;ole32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PRIFORMATCLI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>
</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PRIFORMATCLI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>
</AdditionalLibraryDirectories>
<AdditionalDependencies>shlwapi.lib;version.lib;dwmapi.lib;winhttp.lib;Psapi.lib;advapi32.lib;gdi32.lib;comdlg32.lib;shell32.lib;ole32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="localeex.h" />
<ClInclude Include="mpstr.h" />
<ClInclude Include="nstring.h" />
<ClInclude Include="prifile.h" />
<ClInclude Include="priformatcli.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="strcmp.h" />
<ClInclude Include="syncutil.h" />
<ClInclude Include="targetver.h" />
<ClInclude Include="themeinfo.h" />
<ClInclude Include="typestrans.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
</PrecompiledHeader>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="priformatcli.cpp" />
<ClCompile Include="stdafx.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="priformatcli.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PriFileFormat\PriFile.csproj">
<Project>{ef4012d4-ef08-499c-b803-177739350b2d}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -381,6 +381,7 @@ void DestroyPriFileInstance (PCSPRIFILE pFilePri)
if (!pFilePri) return;
try
{
#ifdef ELDER_FUNC
CreateScopedLock (g_threadlock);
auto it = g_tasklist.find (pFilePri);
if (it != g_tasklist.end ())
@@ -388,6 +389,7 @@ void DestroyPriFileInstance (PCSPRIFILE pFilePri)
it->second.bIsRunning = false;
g_tasklist.erase (it);
}
#endif
IntPtr handlePtr = IntPtr (pFilePri);
System::Runtime::InteropServices::GCHandle handle = System::Runtime::InteropServices::GCHandle::FromIntPtr (handlePtr);
PriFileInst ^inst = safe_cast <PriFileInst ^> (handle.Target);

View File

@@ -224,7 +224,7 @@ typedef class prifile
{
LPWSTR lpstr = nullptr;
reltask release ([&lpstr] () {
if (lpstr) free (lpstr);
if (lpstr) PriFormatFreeString (lpstr);
lpstr = nullptr;
});
lpstr = GetPriResource (m_hPriFile, resname.c_str ());

View File

@@ -127,6 +127,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;PRIFORMATCLI_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<WholeProgramOptimization>true</WholeProgramOptimization>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

Binary file not shown.

Binary file not shown.

View File

@@ -372,7 +372,7 @@
supportDisplay.classList.add("not-support");
supportDisplay.classList.remove("support");
}
supportDisplay.setAttribute("title", strutils.format("OS Min Version: {0}, Architecture: {1}", support.showOsminversionText, support.showArchitectureText));
supportDisplay.setAttribute("title", strutils.format(Bridge.Resources.byname("IDS_PREINSTALL_SUITCONDITION"), support.showOsminversionText, support.showArchitectureText));
var hres = Bridge.Package.installResult(this.value);
if (hres && hres.failed) {
reason.textContent = hres.message;

View File

@@ -442,6 +442,8 @@
createShortcutButton.setAttribute("data-app-user-model-id", item.AppUserModelID);
createShortcutButton.textContent = strres.get("MANAGER_APP_SHORTCUTCREATE_TITLE");
createShortcutButton.style.marginRight = "10px";
appItem.setAttribute("title", item.Id);
appItem.setAttribute("aria-label", item.DisplayName || item.ShortName);
Windows.UI.Event.Util.addEvent(launchButton, "click", function(e) {
e.stopPropagation();
Package.manager.active(this.getAttribute("data-app-user-model-id"));

View File

@@ -30,35 +30,45 @@
}
.win-contentdialog .win-contentdialog-title {
width: 100%;
font-size: 20pt;
font-weight: normal;
padding: 0 172px;
box-sizing: border-box;
display: block;
}
.win-contentdialog .win-contentdialog-content {
width: 100%;
padding: 0 172px;
overflow-y: auto;
box-sizing: border-box;
max-height: calc(100vh - 200px);
margin: 10px 0 20px 0;
margin-top: 10px;
margin-bottom: 20px;
padding-right: 24px;
font-weight: normal;
}
.win-contentdialog .win-contentdialog-commands {
width: 100%;
padding: 0 172px;
box-sizing: border-box;
display: -ms-flexbox;
display: flex;
-ms-flex-direction: row;
flex-direction: row;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-line-pack: start;
align-content: flex-start;
-ms-flex-pack: end;
justify-content: flex-end;
}
.win-contentdialog .win-contentdialog-title,
.win-contentdialog .win-contentdialog-content,
.win-contentdialog .win-contentdialog-commands {
width: 680px;
max-width: calc(100vw - 172px * 2);
margin-left: auto;
margin-right: auto;
}
.win-contentdialog .win-contentdialog-commands>button {
margin-left: 20px;
}
@@ -117,4 +127,11 @@
.win-ui-dark .win-contentdialog .win-contentdialog-dialog,
.win-contentdialog.win-ui-dark .win-contentdialog-dialog {
background-color: rgb(31, 0, 104);
}
.win-ui-dark .win-contentdialog .win-contentdialog-dialog button[type=submit],
.win-contentdialog.win-ui-dark .win-contentdialog-dialog button[type=submit],
.win-ui-dark .win-contentdialog .win-contentdialog-dialog input[type=submit],
.win-contentdialog.win-ui-dark .win-contentdialog-dialog input[type=submit] {
border-color: white;
}

View File

@@ -3,7 +3,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/

View File

@@ -3,7 +3,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/

View File

@@ -4,7 +4,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/

View File

@@ -4,7 +4,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/

View File

@@ -4,7 +4,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/

View File

@@ -4,7 +4,7 @@
This library is supported for use in Windows Store apps only.
Build: 1.0.9200.20602.win8_ldr.130108-1504
Build: 1.0.9200.20789.win8_ldr.130802-2151
Version: Microsoft.WinJS.1.0
*/
@@ -12320,7 +12320,7 @@ WinJS.Namespace.define("WinJS.UI", {
var animations = WinJS.UI.Animation;
var leftBufferAmount = 500,
var leftBufferAmount = 50,
itemSelectedEventDelay = 250;
var strings = {
@@ -12401,8 +12401,9 @@ WinJS.Namespace.define("WinJS.UI", {
}, true);
this._panningDivContainer.addEventListener("MSManipulationStateChanged", function (event) {
that._manipulationState = event.currentState;
if (event.currentState === 0) {
if (event.currentState === 0 && event.srcElement === that._panningDivContainer) {
that._itemSettledOn();
that._ensureCentered();
}
}, true);
},

View File

@@ -110,11 +110,11 @@
<div id="page-appinfo" class="ispage app-detailpage" style="display: none;">
<header>
<button class="win-backbutton"></button>
<h2 class="display-name">App DisplayName</h2>
<h2 class="display-name"></h2>
</header>
<span class="publisher-display-name">App PublisherDisplayName</span><br>
<span class="version">App Version</span><br>
<span class="description">App Description</span>
<span class="publisher-display-name"></span><br>
<span class="version"></span><br>
<span class="description"></span>
<p><strong data-res-resxml="MANAGER_APP_IDENTITY"></strong></p>
<div class="identity win-type-body" style="width: 100%; max-width: 100%; box-sizing: border-box; -ms-user-select: element;">
<span style="font-weight: bold;" data-res-resxml="MANAGER_APP_IDENTITY_NAME"></span><span>: </span><span class="name"></span><br>

View File

@@ -252,6 +252,7 @@
var readSave = document.getElementById("read-result-save");
var readToXml = document.getElementById("read-result-xml");
var readToJson = document.getElementById("read-result-json");
var readRefreshItem = document.getElementById("read-refreshmetadata");
readUsepri.checked = set.getKey("PackageReader:DefaultParsingPriFile").readBool();
readResult.style.display = "none";
readBtn.onclick = function() {
@@ -265,6 +266,7 @@
readToXml.disabled = true;
readToJson.disabled = true;
readUsepri.disabled = true;
readRefreshItem.disabled = true;
function onCompleted() {
self.disabled = false;
@@ -274,6 +276,7 @@
readToXml.disabled = false;
readToJson.disabled = false;
readUsepri.disabled = false;
readRefreshItem.disabled = false;
}
if (!readPkgpath.value) {
readResult.style.display = "";

View File

@@ -80,6 +80,9 @@
<p>
<a id="about-eula" data-res-fromfile="publicRes(137)"></a>
</p>
<p>
<a id="about-thanks" data-res-fromfile="publicRes (230)"></a>
</p>
<p data-res-fromfile="publicRes (138)"></p>
<ul>
<li><a href="https://github.com/chausner/PriTools" target="_blank">chausner/PriTools</a></li>
@@ -88,8 +91,8 @@
<li><a href="https://github.com/winjs/winjs" target="_blank">WinJS</a></li>
<li><a href="https://github.com/evilstreak/markdown-js" target="_blank">markdown.js</a></li>
<li><a href="https://codemirror.net/" target="_blank">CodeMirror</a></li>
<li><a href="https://www.newtonsoft.com/json" target="_blank">Newtonsoft.Json</a></li>
<li><a href="https://icsharpcode.github.io/SharpZipLib/" target="_blank">SharpZipLib</a></li>
<li><a href="https://www.newtonsoft.com/json" target="_blank">Newtonsoft.Json</a></li>
<li><a href="https://icsharpcode.github.io/SharpZipLib/" target="_blank">SharpZipLib</a></li>
</ul>
<script>
(function() {
@@ -185,7 +188,6 @@
});
eventutil.addEvent(aboutProjectDescription, "click", function() {
function decodeBase64(base64) {
// GitHub 的 content 有换行,必须清理
base64 = base64.replace(/\s/g, "");
return atob(base64);
}
@@ -300,6 +302,22 @@
body.style.color = "black";
}, 0);
});
var aboutThanks = document.getElementById("about-thanks");
eventutil.addEvent(aboutThanks, "click", function() {
var content = document.createElement("div");
var p = document.createElement("p");
p.textContent = getPublicRes(231);
content.appendChild(p);
var contributes = '<a href="https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/graphs/contributors" target="_blank">\n \x3C!-- Made with [contrib.rocks](https://contrib.rocks). -->\n <img src="https://contrib.rocks/image?repo=modernw/App-Installer-For-Windows-8.x-Reset&columns=10" style="max-width:100%" />\n</a>\n';
content.innerHTML += contributes;
var p1 = document.createElement("p");
p1.textContent = getPublicRes(232);
content.appendChild(p1);
var dlg = new MsgBox();
dlg.text = content;
dlg.title = getPublicRes(230);
dlg.show();
});
})();
</script>
</div>

View File

@@ -1,21 +1,202 @@
MIT License
Copyright (c) 2025 Windows Modern
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
1. Definitions.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

13
shared/license/NOTICE Normal file
View File

@@ -0,0 +1,13 @@
Copyright (c) 2025-2026 Windows Modern
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -65,7 +65,7 @@ text-align: center;
<p>Copyright &#169; 2025 Windows Modern. 本软件及其源码受版权法保护。</p>
<h2>二、许可范围</h2>
<p>本软件遵循 MIT 许可协议。您可以在符合 MIT 许可条件下自由使用、复制、修改、分发本软件及其源码,包括商业用途。</p>
<p>本软件遵循 Apache 2.0 许可。您可以在遵守 Apache 2.0 许可条件下自由使用、复制、修改、分发本软件及其源码,包括商业用途。需保留版权声明和许可证文本。</p>
<h2>三、第三方组件</h2>
<p>本软件包含以下第三方开源组件,使用这些组件受其原始许可证约束:</p>

View File

@@ -67,7 +67,7 @@ text-align: center;
<p>Copyright © 2025 Windows Modern. This software and its source code are protected by copyright law.</p>
<h2>2. License</h2>
<p>This software is licensed under the MIT License. You are free to use, copy, modify, and distribute this software and its source code, including for commercial purposes, subject to the terms of the MIT License.</p>
<p>This software is licensed under the Apache 2.0 License. You are free to use, copy, modify, and distribute this software and its source code, including for commercial purposes, provided you comply with the Apache 2.0 License. You must retain the copyright notice and license text.</p>
<h2>3. Third-Party Components</h2>
<p>This software includes the following third-party open source components, which are subject to their original licenses:</p>

File diff suppressed because it is too large Load Diff

579
shared/locale/pkgcli.xml Normal file
View File

@@ -0,0 +1,579 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resource id="PKGCLI_VERSION">
<lang name="zh-CN"><![CDATA[Package Manager CLI [版本 {0}]
(C) Windows Modern。保留所有权利。]]></lang>
<lang name="en-US"><![CDATA[Package Manager CLI [Version {0}]
(C) Windows Modern. All rights reserved.]]></lang>
</resource>
<resource id="PKGCLI_TOTALHELP">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli <命令> [参数列表]
命令:
/install 安装一个包。
/update 更新一个包(必须已安装旧版本)。
/register 注册一个应用程序清单文件。
/stage 暂存一个包。
/remove 移除包。
/read 读取包信息。
/get 列出所有已安装的应用。
/find 查找已安装的应用。
/active 启动一个应用。
/config 配置设置。
/version 显示版本信息。
/encoding 设置控制台输出编码。可与其他命令一起使用。
/? 显示本帮助信息。
您可以使用“pkgcli <命令> /?”来获取有关该命令的详细信息。
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli <command> [arguments]
Commands:
/install Install a package.
/update Update a package (previous version must be installed).
/register Register an app manifest file.
/stage Stage a package.
/remove Remove the package.
/read Read package information.
/get List all installed apps.
/find Find installed apps.
/active Launch an app.
/config Configure settings.
/version Display version information.
/encoding Set console output encoding. With other commands.
/? Show this help.
You can use "pkgcli <command> /?" to get the detail infomation about this command.
]]></lang>
</resource>
<resource id="PKGCLI_HELP_ENCODING">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /encoding:<代码页|名称>
pkgcli /en:<代码页|名称>
操作说明:
为当前会话设置控制台输出编码。
当输出内容包含非 ASCII 字符时非常有用。
参数:
<代码页> 数字代码页标识符(例如 65001 表示 UTF-8936 表示 GB2312
<名称> 编码名称(例如 utf-8、gb2312、windows-1252
示例:
pkgcli /encoding:65001 (设置为 UTF-8
pkgcli /encoding:utf-8
pkgcli /en:936 (设置为 GB2312/GBK
pkgcli /en:gb2312
注意:
此设置仅影响当前 pkgcli 进程,不会持久保存。
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /encoding:<code_page|name>
pkgcli /en:<code_page|name>
Operation:
Set the console output encoding for the current session.
Useful when the output contains non-ASCII characters.
Arguments:
<code_page> Numeric code page identifier (e.g., 65001 for UTF-8, 936 for GB2312).
<name> Encoding name (e.g., utf-8, gb2312, windows-1252).
Examples:
pkgcli /encoding:65001 (Set to UTF-8)
pkgcli /encoding:utf-8
pkgcli /en:936 (Set to GB2312/GBK)
pkgcli /en:gb2312
Note:
This setting only affects the current pkgcli process and does not persist.
]]></lang>
</resource>
<resource id="PKGCLI_HELP_IRUS">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli <命令> <文件路径...> [/developmode] [/force] [/allres]
命令:
/install 安装一个包。支持 .appx、.appxbundle、.msix、.msixbundle。
/register 注册一个包。支持 AppxManifest.xml 或 *.appxmanifest。
/update 更新已安装的应用。支持的格式与 /install 相同。
/stage 暂存一个包(预部署)。支持的格式与 /install 相同。
选项(部署选项标志):
/developmode 以开发模式安装/注册。请勿与捆绑包一起使用。
/force 当包或其依赖项正在使用时,强制关闭应用程序以允许注册。
/allres 跳过资源适用性检查;暂存/注册捆绑包中的所有资源包。
参数:
<文件路径...> 一个或多个包或清单文件路径。可以是:
- 直接指向 .appx、.msix、.appxbundle、.msixbundle 或 .xml 清单的路径。
- 一个包含此类路径列表的 .txt 文件(每行一个路径)。
- 如果命令没有重复,则该命令适用于所有列出的文件。
示例:
pkgcli /install MyApp.appx
pkgcli /register /manifest:AppxManifest.xml /developmode
pkgcli /update MyApp.msixbundle /force
pkgcli /stage MyApp.appx /allres
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli <command> <file_path...> [/developmode] [/force] [/allres]
Commands:
/install Install a package. Supports .appx, .appxbundle, .msix, .msixbundle.
/register Register a package. Supports AppxManifest.xml or *.appxmanifest.
/update Update an installed app. Supports same formats as /install.
/stage Stage a package (pre-deploy). Supports same formats as /install.
Options (DeploymentOptions flags):
/developmode Install/register in development mode. Do not use with bundle packages.
/force Force application shutdown to allow registration when the package or its dependencies are in use.
/allres Skip resource applicability checks; stage/register all resource packages in a bundle.
Arguments:
<file_path...> One or more package or manifest file paths. Can be:
- Direct path to .appx, .msix, .appxbundle, .msixbundle, or .xml manifest.
- A .txt file containing a list of such paths (one per line).
- If no command is repeated, the command applies to all listed files.
Examples:
pkgcli /install MyApp.appx
pkgcli /register /manifest:AppxManifest.xml /developmode
pkgcli /update MyApp.msixbundle /force
pkgcli /stage MyApp.appx /allres
]]></lang>
</resource>
<resource id="PKGCLI_HELP_REMOVE">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /remove <包全名> [<包全名>...] [/yes]
操作说明:
移除一个或多个包。
参数:
<包全名> 已安装包的全名 (Package Full Name)。
格式:<标识名>_<版本号>_<处理器架构>_<资源ID>_<发布者ID>
示例Microsoft.WinJS.1.0_1.0.9200.20789_neutral__8wekyb3d8bbwe
选项:
/yes 自动确认卸载,不进行提示。
别名:/y、/agree
您可以指定多个包全名,用空格分隔。
示例:
pkgcli /remove MyPackage_1.0.0.0_x64__abcd1234
pkgcli /remove PackageA_1.0.0.0_neutral__abcd1234 PackageB_2.0.0.0_x86__efgh5678 /yes
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /remove <package_full_name> [<package_full_name>...] [/yes]
Operation:
Remove one or more packages.
Arguments:
<package_full_name> The full name of the installed package.
Format: <identity_name>_<version>_<architecture>_<resource_id>_<publisher_id>
Example: Microsoft.WinJS.1.0_1.0.9200.20789_neutral__8wekyb3d8bbwe
Options:
/yes Automatically confirm the uninstallation without prompting.
Aliases: /y, /agree
You can specify multiple full names separated by spaces.
Examples:
pkgcli /remove MyPackage_1.0.0.0_x64__abcd1234
pkgcli /remove PackageA_1.0.0.0_neutral__abcd1234 PackageB_2.0.0.0_x86__efgh5678 /yes
]]></lang>
</resource>
<resource id="PKGCLI_HELP_GET">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /get [/filter:<筛选器1,筛选器2,...>]
操作说明:
列出所有已安装包及其属性。
注意:
若想执行此命令,请以管理员模式运行。
选项:
/filter:<筛选器> 仅显示指定的属性。
筛选器不区分大小写,支持通配符“*”。
多个筛选器用逗号“,”或分号“;”分隔。
示例:
/filter:Identity:Name,Identity:Version
/filter:Identity:* (所有 Identity 属性)
/filter:Properties:DisplayName
输出:
每个包以 [FullName] 节的形式输出,后跟 key = value 行。
可将输出重定向到文件,以保存为类似 INI 的格式。
示例:
pkgcli /get
pkgcli /get /filter:Identity:FullName,Properties:DisplayName
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /get [/filter:<filter1,filter2,...>]
Operation:
List all installed packages with their properties.
Note:
To run this command, please use Administrator mode.
Options:
/filter:<filters> Show only the specified properties.
Filters are case-insensitive and support '*' wildcard.
Multiple filters separated by comma ',' or semicolon ';'.
Examples:
/filter:Identity:Name,Identity:Version
/filter:Identity:* (all Identity properties)
/filter:Properties:DisplayName
Output:
Each package is printed as a section [FullName] followed by key = value lines.
Redirect output to a file to save as INI-like format.
Examples:
pkgcli /get
pkgcli /get /filter:Identity:FullName,Properties:DisplayName
]]></lang>
</resource>
<resource id="PKGCLI_HELP_FIND">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /find <包全名|包系列名> [/filter:<筛选器>]
pkgcli /find <标识名> <标识发布者> [/filter:<筛选器>]
操作说明:
查找与给定标识符匹配的已安装包。
注意:
若想执行此命令,请以管理员模式运行。
参数:
<包全名> 包的全名。
<包系列名> 包的系列名。
<标识名> 包标识的名称部分(例如 "Microsoft.WindowsStore")。
<标识发布者> 发布者部分(例如 "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US")。
选项:
/filter:<筛选器> 与 /get 命令中的 /filter 相同。
示例:
pkgcli /find Microsoft.WindowsStore_8wekyb3d8bbwe!App
pkgcli /find Microsoft.WindowsStore
pkgcli /find Microsoft.WindowsStore "CN=Microsoft Corporation, ..."
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /find <package_full_name|package_family_name> [/filter:<filters>]
pkgcli /find <identity_name> <identity_publisher> [/filter:<filters>]
Operation:
Find installed packages matching the given identifier.
Note:
To run this command, please use Administrator mode.
Arguments:
<package_full_name> Full name of a package.
<package_family_name> Family name of a package.
<identity_name> Name part of the package identity (e.g., "Microsoft.WindowsStore").
<identity_publisher> Publisher part (e.g., "CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US").
Options:
/filter:<filters> Same as in /get command.
Examples:
pkgcli /find Microsoft.WindowsStore_8wekyb3d8bbwe!App
pkgcli /find Microsoft.WindowsStore
pkgcli /find Microsoft.WindowsStore "CN=Microsoft Corporation, ..."
]]></lang>
</resource>
<resource id="PKGCLI_HELP_ACTIVATE">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /active <app_user_model_id> [args]
操作说明:
启动一个 Windows 商店应用。
参数:
<app_user_model_id> App User Model ID (AUMID)。
格式:<包系列名>!<应用ID>
示例Microsoft.WindowsStore_8wekyb3d8bbwe!App
[args] 传递给应用的可选命令行参数。
示例:
pkgcli /active Microsoft.WindowsStore_8wekyb3d8bbwe!App
pkgcli /active MyAppFamily!App --fullscreen --debug
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /active <app_user_model_id> [arguments]
Operation:
Launch a Windows Store app.
Arguments:
<app_user_model_id> The Application User Model ID (AUMID).
Format: <package_family_name>!<app_id>
Example: Microsoft.WindowsStore_8wekyb3d8bbwe!App
[arguments] Optional command-line arguments passed to the app.
Examples:
pkgcli /active Microsoft.WindowsStore_8wekyb3d8bbwe!App
pkgcli /active MyAppFamily!App --fullscreen --debug
]]></lang>
</resource>
<resource id="PKGCLI_HELP_READ">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /read [选项] [<文件>]
说明:
读取 Appx/MSIX 包(.appx、.appxbundle、.msix、.msixbundle或其清单文件.xml、.appxpackage、.msixpackage
提取包/清单信息,并以 JSON 格式输出到控制台,或保存为包含 info.json 或 info.xml 的 ZIP 压缩包。
选项:
/manifest:<文件> 指定要读取的清单文件。
/package:<文件> 指定要读取的包文件。
<文件> 如果未提供 /manifest 或 /package则使用第一个无名参数作为输入文件。
文件类型根据扩展名自动检测:
.xml、.appxpackage、.msixpackage → 使用清单读取器
.appx、.appxbundle、.msix、.msixbundle → 使用包读取器
/item:<路径> 不输出整个 JSON 对象,仅输出给定路径下的值。
路径语法:使用 '.' 或 ':' 作为分隔符,不区分大小写。
支持索引器(例如 [0])、集合的 .length 以及自动 Base64 访问(例如 LogoBase64
示例:
/item:Identity.Name
/item:Properties.Publisher
/item:applications[0]
/item:applications.length
/item:applications[0].LogoBase64
/usepri 启用 PRI 资源解析(本地化和缩放图片)。要正确解析资源字符串和图片,需要此选项。
/savexml:<输出文件> 将提取的数据保存为 XML 文件,并放入 ZIP 压缩包中。
压缩包中将包含一个 info.xml 文件,内含结构化数据。
/savejson:<输出文件> 将提取的数据保存为 JSON 文件,并放入 ZIP 压缩包中。
压缩包中将包含一个 info.json 文件,内含结构化数据。
/help 显示此帮助文本。
输出行为:
- 如果既未指定 /savexml 也未指定 /savejson则信息直接以 JSON 格式输出到控制台。
- 如果使用了 /item则仅输出指定路径下的值以字符串、版本或格式化 JSON 的形式)。
- 如果使用了 /savexml 或 /savejson则数据将保存到指定的文件ZIP 压缩包),并显示成功/失败信息。
示例:
pkgcli /read MyApp.appx
pkgcli /read /manifest:AppxManifest.xml /usepri
pkgcli /read /package:MyApp.msixbundle /item:Identity.Name
pkgcli /read /package:MyApp.appx /savejson:output.zip
pkgcli /read MyApp.appx /item:applications[0].DisplayName
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /read [options] [<file>]
Description:
Read an Appx/MSIX package (.appx, .appxbundle, .msix, .msixbundle) or its manifest file (.xml, .appxpackage, .msixpackage).
Extracts package/manifest information and outputs as JSON to the console, or saves as a ZIP archive containing either info.json or info.xml.
Options:
/manifest:<file> Specify a manifest file to read.
/package:<file> Specify a package file to read.
<file> If no /manifest or /package is provided, the first unnamed parameter is used as the input file.
File type is auto-detected by extension:
.xml, .appxpackage, .msixpackage → ManifestReader
.appx, .appxbundle, .msix, .msixbundle → PackageReader
/item:<path> Instead of outputting the whole JSON object, output only the value at the given path.
Path syntax: use '.' or ':' as separators, case-insensitive.
Supports indexers (e.g., [0]), .length for collections, and automatic Base64 access (e.g., LogoBase64).
Examples:
/item:Identity.Name
/item:Properties.Publisher
/item:applications[0]
/item:applications.length
/item:applications[0].LogoBase64
/usepri Enable PRI resource resolution (localization and scaled images). Required for proper resource string and image resolution.
/savexml:<output> Save extracted data as an XML file wrapped in a ZIP archive.
The archive will contain an info.xml file with the structured data.
/savejson:<output> Save extracted data as a JSON file wrapped in a ZIP archive.
The archive will contain an info.json file with the structured data.
/help Display this help text.
Output Behavior:
- If neither /savexml nor /savejson is given, the information is printed directly to the console as JSON.
- If /item is used, only the value at the specified path is printed (as a string, version, or formatted JSON).
- If /savexml or /savejson is used, the data is saved to the specified file (ZIP archive) and a success/failure message is shown.
Examples:
pkgcli /read MyApp.appx
pkgcli /read /manifest:AppxManifest.xml /usepri
pkgcli /read /package:MyApp.msixbundle /item:Identity.Name
pkgcli /read /package:MyApp.appx /savejson:output.zip
pkgcli /read MyApp.appx /item:applications[0].DisplayName
]]></lang>
</resource>
<resource id="PKGCLI_HELP_CONFIG">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /config 显示当前配置(所有键值)。
pkgcli /config /show:<键名> 显示指定配置键的值。
pkgcli /config /set:<键名> <值> 将配置键设置为指定值。
pkgcli /config /refresh 从 config.ini 重新加载配置。
配置键(部分):
AppMetadataItems 从清单中读取的应用元数据字段列表,用逗号分隔。
默认值:"Id,BackgroundColor,DisplayName,ForegroundText,ShortName,SmallLogo,Square44x44Logo"
配置文件:
位于 pkgcli.exe 同目录下的 config.ini。
示例:
pkgcli /config
pkgcli /config /show:AppMetadataItems
pkgcli /config /set:AppMetadataItems "Id,DisplayName,Logo"
pkgcli /config /refresh
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /config Show current configuration (all keys).
pkgcli /config /show:<key> Show value of a specific configuration key.
pkgcli /config /set:<key> <value> Set configuration key to the given value.
pkgcli /config /refresh Reload configuration from config.ini.
Configuration keys (partial):
AppMetadataItems Comma-separated list of application metadata fields to read from manifests.
Default: ""Id,BackgroundColor,DisplayName,ForegroundText,ShortName,SmallLogo,Square44x44Logo""
Configuration file:
config.ini in the same directory as pkgcli.exe.
Examples:
pkgcli /config
pkgcli /config /show:AppMetadataItems
pkgcli /config /set:AppMetadataItems ""Id,DisplayName,Logo""
pkgcli /config /refresh
]]></lang>
</resource>
<resource id="PKGCLI_HELP_VERSION">
<lang name="zh-CN"><![CDATA[
用法:
pkgcli /version
pkgcli /ver
操作说明:
显示 Package Manager CLI 的当前版本。
示例:
pkgcli /version
pkgcli /ver
]]></lang>
<lang name="en-US"><![CDATA[
Usage:
pkgcli /version
pkgcli /ver
Operation:
Display the current version of Package Manager CLI.
Examples:
pkgcli /version
pkgcli /ver
]]></lang>
</resource>
<resource id="PKGCLI_WARNING_ENCODING">
<lang name="zh-CN"><![CDATA[警告:设置输出编码失败。异常:{0}
信息:
{1}
将使用默认编码。]]></lang>
<lang name="en-US"><![CDATA[Warning: Set encoding for output failed. Exception {0}
Message:
{1}
We will use default encoding.]]></lang>
</resource>
<resource id="PKGCLI_PROGRESS_OPERATION">
<lang name="zh-CN">({0}/{1}) 正在执行操作...</lang>
<lang name="en-US">({0}/{1}) Performing operation...</lang>
</resource>
<resource id="PKGCLI_PROGRESS_OPERATION_WITHPROGRESS">
<lang name="zh-CN">({0}/{1}) 正在执行操作... {2}% of {3}%</lang>
<lang name="en-US">({0}/{1}) Performing operation... {2}% of {3}%</lang>
</resource>
<resource id="PKGCLI_COMPLETE_OPERATION">
<lang name="zh-CN">操作已完成。</lang>
<lang name="en-US">All Done.</lang>
</resource>
<resource id="PKGCLI_ERROR_IRUS_EXCEPTION">
<lang name="zh-CN"><![CDATA[包 {0} "{1}" 操作错误 ({2})
{3}]]></lang>
<lang name="en-US"><![CDATA[Package {0} "{1}" Operation Error ({2}):
{3}]]></lang>
</resource>
<resource id="PKGCLI_ASK_REMOVE">
<lang name="zh-CN">我们将要移除 {0} 个应用。确定要继续吗?(Y/N) </lang>
<lang name="en-US">We are about to remove {0} app(-s). Do you want to continue? (Y/N) </lang>
</resource>
<resource id="PKGCLI_ERROR_USERABORT">
<lang name="zh-CN">用户取消操作</lang>
<lang name="en-US">User canceled.</lang>
</resource>
<resource id="PKGCLI_ERROR_EXCEPTION">
<lang name="zh-CN"><![CDATA[操作错误 ({0})
{1}]]></lang>
<lang name="en-US"><![CDATA[Operation Error ({0}):
{1}]]></lang>
</resource>
<resource id="PKGCLI_COMPLETE_DONE">
<lang name="zh-CN">已完成。</lang>
<lang name="en-US">Done.</lang>
</resource>
<resource id="PKGCLI_ERROR_CANNOTFINDKEY">
<lang name="zh-CN">无法找到键 "{0}"。</lang>
<lang name="en-US">Cannot find key "{0}".</lang>
</resource>
<resource id="PKGCLI_ERROR_KEYSTRINGEMPTY">
<lang name="zh-CN">键为空值。</lang>
<lang name="en-US">Key is empty.</lang>
</resource>
<resource id="PKGCLI_ERROR_FINALEXCEPTION">
<lang name="zh-CN"><![CDATA[异常 {0}:
信息:
{1}
堆栈轨迹:
{2}]]></lang>
<lang name="en-US"><![CDATA[Exception {0}:
Message:
{1}
Stack:
{2}]]></lang>
</resource>
</resources>

View File

@@ -671,10 +671,10 @@
<lang name="en-US">Problem occurred during saving</lang>
</resource>
<resource id="READER_READER_SAVEINGJSON">
<lang name="zh-CN"><![CDATA[正在生成 JSON 文件,请稍候...
这可能需要比较长的时间。]]></lang>
<lang name="en-US"><![CDATA[Generating JSON file, please wait...
This may take a long time.]]></lang>
<lang name="zh-CN">正在生成 JSON 文件,请稍候...
这可能需要比较长的时间。</lang>
<lang name="en-US">Generating JSON file, please wait...
This may take a long time.</lang>
</resource>
<resource id="READER_READER_JSONFILE">
<lang name="zh-CN">包含 JSON 报告的 ZIP 文件</lang>
@@ -685,10 +685,10 @@ This may take a long time.]]></lang>
<lang name="en-US">ZIP file containing XML report</lang>
</resource>
<resource id="READER_READER_SAVEINGXML">
<lang name="zh-CN"><![CDATA[正在生成 XML 文件,请稍候...
这可能需要比较长的时间。]]></lang>
<lang name="en-US"><![CDATA[Generating XML file, please wait...
This may take a long time.]]></lang>
<lang name="zh-CN">正在生成 XML 文件,请稍候...
这可能需要比较长的时间。</lang>
<lang name="en-US">Generating XML file, please wait...
This may take a long time.</lang>
</resource>
<resource id="READER_ACQUIRE_TITLE">
<lang name="zh-CN">获取</lang>
@@ -876,7 +876,7 @@ This may take a long time.]]></lang>
</resource>
<resource id="APPMETADATA_Square44x44Logo">
<lang name="zh-CN">应用列表图标 (Windows Phone 或 UWP)</lang>
<lang name="en-US">App List Logo (Windows Phone UWP)</lang>
<lang name="en-US">App List Logo (Windows Phone or UWP)</lang>
</resource>
<resource id="APPMETADATA_Square70x70Logo">
<lang name="zh-CN">小磁贴图标 (Windows 8.1)</lang>

View File

@@ -1 +1 @@
0.3.1.0
1.0.0.0