mirror of
https://github.com/modernw/App-Installer-For-Windows-8.x-Reset.git
synced 2026-04-11 17:57:19 +10:00
Compare commits
3 Commits
3c35a8acaa
...
880a834296
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
880a834296 | ||
|
|
e47813765a | ||
|
|
2f0d1dc27f |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -248,4 +248,5 @@ ModelManifest.xml
|
||||
[Oo]thers/
|
||||
|
||||
# Arm Build Files
|
||||
package.zip
|
||||
package.zip
|
||||
ArmPackage.zip
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.14.37012.4
|
||||
# Visual Studio 14
|
||||
VisualStudioVersion = 14.0.25420.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pkgread", "pkgread\pkgread.vcxproj", "{A7753282-AA16-43D9-8ACA-7065239DD702}"
|
||||
EndProject
|
||||
@@ -222,12 +222,12 @@ Global
|
||||
{4EC16578-EFBF-41E6-8D7F-976E3646DD1D}.Release|x86.Build.0 = Release|Any CPU
|
||||
{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|Any CPU
|
||||
{DC074727-72E4-43C5-BAAF-E0D548104797}.Debug|x86.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|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|Any CPU
|
||||
{DC074727-72E4-43C5-BAAF-E0D548104797}.Release|x86.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|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
|
||||
@@ -254,12 +254,12 @@ Global
|
||||
{F0288B24-7B84-42A5-9A92-2E16A012E4DE}.Release|x86.Build.0 = Release|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|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Debug|x86.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|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|Any CPU
|
||||
{26B3C19D-6182-4DB5-8B69-EE098A0FD3BB}.Release|x86.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|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
|
||||
|
||||
41
ArmBuild.ps1
41
ArmBuild.ps1
@@ -1,41 +1,51 @@
|
||||
# ArmBuild.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$root = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$staging = Join-Path $root "_staging"
|
||||
$outZip = Join-Path $root "package.zip"
|
||||
$outZip = Join-Path $root "ArmPackage.zip"
|
||||
$packageFolderName = "Desktop App Installer"
|
||||
$destRoot = Join-Path $staging $packageFolderName
|
||||
|
||||
function Copy-Binaries-ToRoot($src)
|
||||
function Copy-Binaries-ToDest($src, $dest)
|
||||
{
|
||||
if (!(Test-Path $src)) { return }
|
||||
|
||||
Get-ChildItem $src -File | Where-Object {
|
||||
$_.Extension -in ".exe", ".dll"
|
||||
} | ForEach-Object {
|
||||
Copy-Item $_.FullName $staging -Force
|
||||
Copy-Item -Path $_.FullName -Destination $dest -Force
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Preparing staging..."
|
||||
Remove-Item $staging -Recurse -Force -ErrorAction Ignore
|
||||
New-Item $staging -ItemType Directory | Out-Null
|
||||
# 清理旧的 staging
|
||||
if (Test-Path $staging) { Remove-Item $staging -Recurse -Force }
|
||||
New-Item $destRoot -ItemType Directory | Out-Null
|
||||
|
||||
# ① 先放 Release
|
||||
Copy-Binaries-ToRoot (Join-Path $root "Release")
|
||||
Copy-Binaries-ToDest (Join-Path $root "Release") $destRoot
|
||||
|
||||
# ② 再放 ARM\Release(覆盖同名)
|
||||
Copy-Binaries-ToRoot (Join-Path $root "ARM\Release")
|
||||
Copy-Binaries-ToDest (Join-Path $root "ARM\Release") $destRoot
|
||||
|
||||
# ③ shared 全部铺到根目录
|
||||
# ③ shared 全部铺到 Desktop App Installer 里
|
||||
$shared = Join-Path $root "shared"
|
||||
if (Test-Path $shared) {
|
||||
Get-ChildItem $shared -Recurse | ForEach-Object {
|
||||
$rel = $_.FullName.Substring($shared.Length).TrimStart('\')
|
||||
$dest = Join-Path $staging $rel
|
||||
$relativePath = $_.FullName.Substring($shared.Length).TrimStart('\')
|
||||
$destinationPath = Join-Path $destRoot $relativePath
|
||||
|
||||
if ($_.PSIsContainer) {
|
||||
New-Item $dest -ItemType Directory -Force | Out-Null
|
||||
if (!(Test-Path $destinationPath)) {
|
||||
New-Item -Path $destinationPath -ItemType Directory | Out-Null
|
||||
}
|
||||
} else {
|
||||
Copy-Item $_.FullName $dest -Force
|
||||
$parentDir = Split-Path $destinationPath -Parent
|
||||
if (!(Test-Path $parentDir)) {
|
||||
New-Item -Path $parentDir -ItemType Directory | Out-Null
|
||||
}
|
||||
Copy-Item -Path $_.FullName -Destination $destinationPath -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -43,11 +53,10 @@ if (Test-Path $shared) {
|
||||
Write-Host "Creating ZIP..."
|
||||
if (Test-Path $outZip) { Remove-Item $outZip -Force }
|
||||
|
||||
Compress-Archive `
|
||||
-Path (Join-Path $staging "*") `
|
||||
-DestinationPath $outZip `
|
||||
-CompressionLevel Fastest
|
||||
# 压缩 _staging 下的 Desktop App Installer 文件夹
|
||||
Compress-Archive -Path $destRoot -DestinationPath $outZip -CompressionLevel Optimal
|
||||
|
||||
# 清理 staging
|
||||
Remove-Item $staging -Recurse -Force
|
||||
|
||||
Write-Host "Done: $outZip"
|
||||
@@ -28,7 +28,7 @@
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -51,7 +51,7 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<OutputPath>..\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -59,7 +59,7 @@
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<OutputPath>..\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
@@ -53,6 +53,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="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
@echo off
|
||||
cd /d "%~dp0"
|
||||
set SCRIPT_DIR=%~dp0
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%ArmBuild.ps1"
|
||||
pause
|
||||
@@ -1,169 +0,0 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
Push-Location $PSScriptRoot
|
||||
try {
|
||||
# 语言检测函数
|
||||
function Get-Language {
|
||||
$lang = [System.Globalization.CultureInfo]::CurrentUICulture.TwoLetterISOLanguageName
|
||||
if ($lang -eq "zh") { return "zh" }
|
||||
return "en"
|
||||
}
|
||||
|
||||
$lang = Get-Language
|
||||
|
||||
# 本地化消息
|
||||
$messages = @{
|
||||
en = @{
|
||||
title = "Desktop App Installer Setup"
|
||||
confirm = "Do you want to install Desktop App Installer? (y/n)"
|
||||
invalid = "Invalid input. Please enter y or n."
|
||||
cancelled = "Installation cancelled."
|
||||
arch_error = "Error: Cannot continue installation because the computer's processor architecture is not ARM."
|
||||
creating_shortcuts = "Creating shortcuts in Start Screen..."
|
||||
registering = "Registering..."
|
||||
complete = "Installation complete!"
|
||||
}
|
||||
zh = @{
|
||||
title = "Desktop App Installer 安装程序"
|
||||
confirm = "是否安装 Desktop App Installer?(y/n)"
|
||||
invalid = "无效输入,请输入 y 或 n。"
|
||||
cancelled = "安装已取消。"
|
||||
arch_error = "错误:无法继续安装,因为计算机的处理器架构不是 ARM。"
|
||||
creating_shortcuts = "正在创建开始屏幕快捷方式..."
|
||||
registering = "正在注册..."
|
||||
complete = "安装完成!"
|
||||
}
|
||||
}
|
||||
|
||||
$msg = $messages[$lang]
|
||||
|
||||
# 函数定义
|
||||
function Create-Shortcut {
|
||||
param(
|
||||
[string]$LnkPath,
|
||||
[string]$TargetPath,
|
||||
[string]$AppId
|
||||
)
|
||||
$toolShortcutPath = Join-Path $PSScriptRoot "shortcut.exe"
|
||||
if (-not (Test-Path $toolShortcutPath)) {
|
||||
throw "Error: cannot find file 'shortcut.exe' in folder '$PSScriptRoot'"
|
||||
}
|
||||
& $toolShortcutPath $LnkPath $TargetPath $AppId
|
||||
return $LASTEXITCODE
|
||||
}
|
||||
|
||||
function Set-DesktopInit {
|
||||
param(
|
||||
[string]$IniPath,
|
||||
[string]$Section,
|
||||
[string]$Key,
|
||||
[string]$Value
|
||||
)
|
||||
$toolDesktopIniPath = Join-Path $PSScriptRoot "desktopini.exe"
|
||||
if (-not (Test-Path $toolDesktopIniPath)) {
|
||||
throw "Error: cannot find file 'desktopini.exe' in folder '$PSScriptRoot'"
|
||||
}
|
||||
& $toolDesktopIniPath $IniPath $Section $Key $Value
|
||||
return $LASTEXITCODE
|
||||
}
|
||||
|
||||
# 检查处理器架构
|
||||
if ($env:PROCESSOR_ARCHITECTURE.Trim() -ne "ARM") {
|
||||
throw $msg.arch_error
|
||||
}
|
||||
|
||||
# 确认安装
|
||||
do {
|
||||
$response = Read-Host $msg.confirm
|
||||
$response = $response.ToLower()
|
||||
if ($response -eq 'y') {
|
||||
$confirmed = $true
|
||||
break
|
||||
} elseif ($response -eq 'n') {
|
||||
Write-Host $msg.cancelled
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host $msg.invalid
|
||||
}
|
||||
} while ($true)
|
||||
|
||||
# 安装目录和快捷方式目录
|
||||
$appStartMenuFolder = "Desktop App Installer"
|
||||
$appPublicStartMenuFolder = [System.IO.Path]::Combine($env:ProgramData, "Microsoft\Windows\Start Menu\Programs")
|
||||
$startitemfolder = [System.IO.Path]::Combine($appPublicStartMenuFolder, $appStartMenuFolder)
|
||||
$AppFolder = $PSScriptRoot
|
||||
|
||||
Write-Output $msg.creating_shortcuts
|
||||
if (-not (Test-Path $startitemfolder)) {
|
||||
New-Item -ItemType Directory -Path $startitemfolder -Force | Out-Null
|
||||
}
|
||||
|
||||
$shortcuts = @(
|
||||
@{
|
||||
LnkPath = Join-Path $startitemfolder "App Installer.lnk"
|
||||
TargetPath = Join-Path $AppFolder "appinstaller.exe"
|
||||
AppId = "Microsoft.DesktopAppInstaller!App"
|
||||
},
|
||||
@{
|
||||
LnkPath = Join-Path $startitemfolder "Settings.lnk"
|
||||
TargetPath = Join-Path $AppFolder "settings.exe"
|
||||
AppId = "WindowsModern.PracticalToolsProject!Settings"
|
||||
},
|
||||
@{
|
||||
LnkPath = Join-Path $startitemfolder "Package Manager.lnk"
|
||||
TargetPath = Join-Path $AppFolder "Manager.exe"
|
||||
AppId = "WindowsModern.PracticalToolsProject!Manager"
|
||||
},
|
||||
@{
|
||||
LnkPath = Join-Path $startitemfolder "Update.lnk"
|
||||
TargetPath = Join-Path $AppFolder "Update.exe"
|
||||
AppId = "WindowsModern.PracticalToolsProject!Update"
|
||||
},
|
||||
@{
|
||||
LnkPath = Join-Path $startitemfolder "Package Reader.lnk"
|
||||
TargetPath = Join-Path $AppFolder "Reader.exe"
|
||||
AppId = "WindowsModern.PracticalToolsProject!Reader"
|
||||
}
|
||||
)
|
||||
|
||||
foreach ($item in $shortcuts) {
|
||||
$exitCode = Create-Shortcut -LnkPath $item.LnkPath -TargetPath $item.TargetPath -AppId $item.AppId
|
||||
}
|
||||
|
||||
# $desktopini = Join-Path $startitemfolder "desktop.ini"
|
||||
$desktopini = $startitemfolder
|
||||
Set-DesktopInit -IniPath $desktopini -Section ".ShellClassInfo" -Key "ConfirmFileOp" -Value 0
|
||||
Set-DesktopInit -IniPath $desktopini -Section "LocalizedFileNames" -Key "App Installer.lnk" -Value "@$AppFolder\appinstaller.exe,-300"
|
||||
Set-DesktopInit -IniPath $desktopini -Section "LocalizedFileNames" -Key "Settings.lnk" -Value "@$AppFolder\settings.exe,-200"
|
||||
Set-DesktopInit -IniPath $desktopini -Section "LocalizedFileNames" -Key "Update.lnk" -Value "@$AppFolder\reslib.dll,-103"
|
||||
Set-DesktopInit -IniPath $desktopini -Section "LocalizedFileNames" -Key "Package Manager.lnk" -Value "@$AppFolder\reslib.dll,-228"
|
||||
Set-DesktopInit -IniPath $desktopini -Section "LocalizedFileNames" -Key "Uninstall.lnk" -Value "@$AppFolder\reslib.dll,-131"
|
||||
Set-DesktopInit -IniPath $desktopini -Section ".ShellClassInfo" -Key "LocalizedResourceName" -Value "@$AppFolder\appinstaller.exe,-300"
|
||||
|
||||
Write-Output $msg.registering
|
||||
$reg = [Microsoft.Win32.Registry]::ClassesRoot
|
||||
$key = $reg.CreateSubKey("Microsoft.DesktopAppInstaller")
|
||||
$key.SetValue("", "Windows Store App Package")
|
||||
$key.Close()
|
||||
$subKey = $reg.CreateSubKey("Microsoft.DesktopAppInstaller\Shell\Open\Command")
|
||||
$subKey.SetValue("", "`"$AppFolder\appinstaller.exe`" `"%1`"")
|
||||
$subKey.Close()
|
||||
$subKey = $reg.CreateSubKey("Microsoft.DesktopAppInstaller\DefaultIcon")
|
||||
$subKey.SetValue("", "$AppFolder\appinstaller.exe,2")
|
||||
$subKey.Close()
|
||||
$subKey = $reg.CreateSubKey("Applications\AppInstaller.exe\DefaultIcon")
|
||||
$subKey.SetValue("", "$AppFolder\appinstaller.exe,-136")
|
||||
$subKey.Close()
|
||||
$subKey = $reg.CreateSubKey(".appx")
|
||||
$subKey.SetValue("", "Microsoft.DesktopAppInstaller")
|
||||
$subKey.Close()
|
||||
$subKey = $reg.CreateSubKey(".appxbundle")
|
||||
$subKey.SetValue("", "Microsoft.DesktopAppInstaller")
|
||||
$subKey.Close()
|
||||
|
||||
Write-Output ""
|
||||
Write-Output $msg.complete
|
||||
Start-Sleep -Seconds 5
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
BIN
shared/ArmInstaller.exe
Normal file
BIN
shared/ArmInstaller.exe
Normal file
Binary file not shown.
@@ -1,153 +0,0 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
Push-Location $PSScriptRoot
|
||||
try {
|
||||
# 语言检测函数
|
||||
function Get-Language {
|
||||
$lang = [System.Globalization.CultureInfo]::CurrentUICulture.TwoLetterISOLanguageName
|
||||
if ($lang -eq "zh") { return "zh" }
|
||||
return "en"
|
||||
}
|
||||
|
||||
$lang = Get-Language
|
||||
|
||||
# 本地化消息
|
||||
$messages = @{
|
||||
en = @{
|
||||
title = "Uninstall Desktop App Installer"
|
||||
confirm = "Are you sure you want to uninstall Desktop App Installer? (y/n)"
|
||||
invalid = "Invalid input. Please enter y or n."
|
||||
removing_start = "Removing Start Menu folder..."
|
||||
removing_reg = "Removing registry entries..."
|
||||
removing_dir = "Removing installation directory..."
|
||||
confirm_dir = "Do you also want to delete the installation directory? (y/n)"
|
||||
complete = "Uninstallation complete."
|
||||
error = "Error: "
|
||||
cancelled = "Uninstall cancelled."
|
||||
}
|
||||
zh = @{
|
||||
title = "卸载 Desktop App Installer"
|
||||
confirm = "确定要卸载 Desktop App Installer 吗?(y/n)"
|
||||
invalid = "无效输入,请输入 y 或 n。"
|
||||
removing_start = "正在删除开始菜单文件夹..."
|
||||
removing_reg = "正在删除注册表项..."
|
||||
removing_dir = "正在删除安装目录..."
|
||||
confirm_dir = "是否同时删除安装目录?(y/n)"
|
||||
complete = "卸载完成。"
|
||||
error = "错误:"
|
||||
cancelled = "卸载已取消。"
|
||||
}
|
||||
}
|
||||
|
||||
$msg = $messages[$lang]
|
||||
|
||||
if ($env:PROCESSOR_ARCHITECTURE.Trim() -ne "ARM") {
|
||||
throw "Error: Cannot continue installation because the computer's processor architecture is not ARM."
|
||||
}
|
||||
|
||||
# 确认卸载(控制台交互)
|
||||
do {
|
||||
$response = Read-Host $msg.confirm
|
||||
$response = $response.ToLower()
|
||||
if ($response -eq 'y') {
|
||||
$confirmed = $true
|
||||
break
|
||||
} elseif ($response -eq 'n') {
|
||||
Write-Host $msg.cancelled
|
||||
exit 0
|
||||
} else {
|
||||
Write-Host $msg.invalid
|
||||
}
|
||||
} while ($true)
|
||||
|
||||
# 定义路径
|
||||
$appStartMenuFolder = "Desktop App Installer"
|
||||
$appPublicStartMenuFolder = [System.IO.Path]::Combine($env:ProgramData, "Microsoft\Windows\Start Menu\Programs")
|
||||
$startitemfolder = [System.IO.Path]::Combine($appPublicStartMenuFolder, $appStartMenuFolder)
|
||||
$AppFolder = $PSScriptRoot
|
||||
|
||||
# 删除开始菜单文件夹
|
||||
Write-Host $msg.removing_start
|
||||
if (Test-Path $startitemfolder) {
|
||||
Remove-Item -Path $startitemfolder -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path $startitemfolder) {
|
||||
Write-Warning "$msg.error Could not remove $startitemfolder"
|
||||
} else {
|
||||
Write-Output "Removed $startitemfolder"
|
||||
}
|
||||
} else {
|
||||
Write-Output "Start Menu folder not found, skipping."
|
||||
}
|
||||
|
||||
# 删除注册表项
|
||||
Write-Host $msg.removing_reg
|
||||
$reg = [Microsoft.Win32.Registry]::ClassesRoot
|
||||
|
||||
$keysToDelete = @(
|
||||
"Microsoft.DesktopAppInstaller",
|
||||
".appx",
|
||||
".appxbundle"
|
||||
)
|
||||
foreach ($keyName in $keysToDelete) {
|
||||
try {
|
||||
if ($reg.OpenSubKey($keyName) -ne $null) {
|
||||
$reg.DeleteSubKeyTree($keyName)
|
||||
Write-Output "Removed registry key: HKCR\$keyName"
|
||||
} else {
|
||||
Write-Output "Registry key not found: HKCR\$keyName"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "$msg.error Could not remove HKCR\$keyName : $_"
|
||||
}
|
||||
}
|
||||
|
||||
# 删除 Applications\AppInstaller.exe 下的 DefaultIcon
|
||||
$appPath = "Applications\AppInstaller.exe"
|
||||
try {
|
||||
$appKey = $reg.OpenSubKey($appPath, $true)
|
||||
if ($appKey) {
|
||||
$subKeyNames = $appKey.GetSubKeyNames()
|
||||
if ($subKeyNames -contains "DefaultIcon") {
|
||||
$appKey.DeleteSubKey("DefaultIcon")
|
||||
Write-Output "Removed registry key: HKCR\$appPath\DefaultIcon"
|
||||
}
|
||||
$appKey.Close()
|
||||
} else {
|
||||
Write-Output "Registry key not found: HKCR\$appPath"
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "$msg.error Could not process HKCR\$appPath : $_"
|
||||
}
|
||||
|
||||
# 删除安装目录
|
||||
Write-Host $msg.removing_dir
|
||||
do {
|
||||
$respDir = Read-Host $msg.confirm_dir
|
||||
$respDir = $respDir.ToLower()
|
||||
if ($respDir -eq 'y') {
|
||||
if (Test-Path $AppFolder) {
|
||||
Remove-Item -Path $AppFolder -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path $AppFolder) {
|
||||
Write-Warning "$msg.error Could not delete $AppFolder"
|
||||
} else {
|
||||
Write-Output "Deleted installation directory."
|
||||
}
|
||||
} else {
|
||||
Write-Output "Installation directory not found."
|
||||
}
|
||||
break
|
||||
} elseif ($respDir -eq 'n') {
|
||||
Write-Output "Skipped deleting installation directory."
|
||||
break
|
||||
} else {
|
||||
Write-Host $msg.invalid
|
||||
}
|
||||
} while ($true)
|
||||
|
||||
Write-Host $msg.complete
|
||||
Start-Sleep -Seconds 3
|
||||
} catch {
|
||||
Write-Error "Uninstall failed: $_"
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
BIN
shared/ArmUninstaller.exe
Normal file
BIN
shared/ArmUninstaller.exe
Normal file
Binary file not shown.
@@ -1,13 +0,0 @@
|
||||
@echo off
|
||||
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
|
||||
bcdedit >nul
|
||||
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
|
||||
:UACPrompt
|
||||
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
|
||||
exit /B
|
||||
:UACAdmin
|
||||
cd /d "%~dp0"
|
||||
|
||||
set SCRIPT_DIR=%~dp0
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%ArmInstall.ps1"
|
||||
pause
|
||||
@@ -1,11 +1,11 @@
|
||||
对于 Windows RT 用户,请以管理员身份运行 arm_install.bat 或 arm_uninstall.bat 进行安装或卸载。安装前请务必将压缩包中的所有文件放置在一个独立的文件夹中,该文件夹请勿随意移动或删除,不建议放置在桌面上。若需更新或移动程序,请先执行原卸载脚本,然后再进行安装操作。x86、x64 以及支持 x86 兼容层的 ARM64 系统请使用标准安装程序,本方案仅适用于 ARM 设备。
|
||||
对于 Windows RT 用户,请以管理员身份运行 ArmInstaller.exe 或 ArmUninstaller.exe 进行安装或卸载。安装前请务必将压缩包中的所有文件放置在一个独立的文件夹中,该文件夹请勿随意移动或删除,不建议放置在桌面上。若需更新或移动程序,请先执行卸载程序,然后再进行安装操作。请不要使用程序中具有的安装程序来更新。 x86、x64 以及 具有 Windows on ARM 的 ARM64 系统 请使用标准安装程序,本方案仅适用于 ARM 设备。
|
||||
感谢“冰糖XH”(主页:https://github.com/bingtangxh)帮助我完成了针对 ARM 架构的程序编译。
|
||||
|
||||
适用于 ARM 设备的项目发行:https://github.com/bingtangxh/App-Installer-For-Windows-8.x-Reset/releases
|
||||
其余设备的项目发行:https://github.com/modernw/App-Installer-For-Windows-8.x-Reset/releases
|
||||
|
||||
(Translated by DeepSeek)
|
||||
For Windows RT users, please run arm_install.bat or arm_uninstall.bat as an administrator to install or uninstall. Before installation, extract all files from the compressed package into a dedicated folder; do not move or delete this folder arbitrarily, and it is not recommended to place it on the desktop. If you need to update or relocate the program, first run the original uninstall script, then proceed with the installation. For x86, x64, and ARM64 systems that support the x86 compatibility layer, please use the standard installer; this solution is specifically for ARM devices.
|
||||
For Windows RT users, please run ArmInstaller.exe or ArmUninstaller.exe as an administrator to install or uninstall. Before installation, extract all files from the compressed package into a dedicated folder; do not move or delete this folder arbitrarily, and it is not recommended to place it on the desktop. If you need to update or relocate the program, first run the uninstaller, then proceed with the installation. Do not use the installer included in the program to update. For x86, x64, and ARM64 systems with Windows on ARM please use the standard installer; this solution is specifically for ARM devices.
|
||||
Thanks to "BingTangXH" (Homepage: https://github.com/bingtangxh) for helping me complete the program compilation for the ARM architecture.
|
||||
|
||||
Project release for ARM devices: https://github.com/bingtangxh/App-Installer-For-Windows-8.x-Reset/releases
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
@echo off
|
||||
if exist "%SystemRoot%\SysWOW64" path %path%;%windir%\SysNative;%SystemRoot%\SysWOW64;%~dp0
|
||||
bcdedit >nul
|
||||
if '%errorlevel%' NEQ '0' (goto UACPrompt) else (goto UACAdmin)
|
||||
:UACPrompt
|
||||
%1 start "" mshta vbscript:createobject("shell.application").shellexecute("""%~0""","::",,"runas",1)(window.close)&exit
|
||||
exit /B
|
||||
:UACAdmin
|
||||
cd /d "%~dp0"
|
||||
|
||||
set SCRIPT_DIR=%~dp0
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%SCRIPT_DIR%ArmUninstall.ps1"
|
||||
pause
|
||||
@@ -37,6 +37,17 @@
|
||||
<link rel="stylesheet" href="css/statusbar.css">
|
||||
<script type="text/javascript" src="js/statusbar.js"></script>
|
||||
<script type="text/javascript" src="js/rdinit.js"></script>
|
||||
<style>
|
||||
.itemrow {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-content: center;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -48,9 +59,30 @@
|
||||
<p>请选择一个包,获取其信息。</p>
|
||||
<div>
|
||||
<label for="read-pkgpath">文件路径</label>
|
||||
<input type="file" id="read-pkgpath">
|
||||
<div class="itemrow">
|
||||
<input type="text" id="read-pkgpath">
|
||||
<button id="read-browse" style="margin-left: 5px;">浏览</button>
|
||||
</div>
|
||||
<script>
|
||||
(function() {
|
||||
var readBrowse = document.getElementById("read-browse");
|
||||
var readPkgpath = document.getElementById("read-pkgpath");
|
||||
var lastDir = "";
|
||||
readBrowse.onclick = function() {
|
||||
var explorer = external.Storage.Explorer;
|
||||
explorer.file(
|
||||
"{appxpkg}|*.appx;*.appxbundle;*.msix;*.msixbundle|{allfiles}|*.*",
|
||||
lastDir,
|
||||
function(result) {
|
||||
if (!result) return;
|
||||
readPkgpath.value = result;
|
||||
}
|
||||
);
|
||||
};
|
||||
})();
|
||||
</script>
|
||||
</div>
|
||||
<div>
|
||||
<div class="itemrow">
|
||||
<input type="checkbox" id="read-usepri">
|
||||
<label for="read-usepri">需要解析 PRI 资源文件</label>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user