Compare commits

..

11 Commits

Author SHA1 Message Date
Julian
96871dc58a support browserautoms 2026-09-05 10:56:03 -04:00
Julian
c4adac7b41 update url and chrome 2026-09-05 10:32:04 -04:00
Julian
25301bd60e change all cn to en to avoid annoying errors 2026-05-20 20:43:42 -04:00
Julian
39c0420835 fix manifest temp msi locked 2026-05-20 20:25:29 -04:00
Julian
e9aa6024ff support force post install 2026-05-16 23:01:12 -04:00
Julian
4b92de1b38 fix manifest install 2026-05-15 21:03:55 -04:00
Julian
d13c505143 update custom manifest 2026-05-15 19:40:04 -04:00
Julian
8b8d109ba6 support custom manifest 2026-05-15 19:23:54 -04:00
Julian Freeman
11cfa1e823 change json to ini 2026-02-04 13:02:00 -04:00
Julian Freeman
8270fa3ec1 add teams icon, add vs revo, etc 2026-02-04 12:51:35 -04:00
Julian Freeman
406317db78 support individual selection 2026-02-04 12:12:21 -04:00
15 changed files with 434 additions and 84 deletions

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.5

Binary file not shown.

View File

@@ -15,7 +15,8 @@
{
"Name": "Google Chrome",
"Id": "Google.Chrome",
"Version": "",
"Version": "152.0.7977.83",
"Manifest": "../manifests/Google.Chrome.yaml",
"Enabled": 1,
"PostInstall": [
{
@@ -52,7 +53,13 @@
"Id": "Microsoft.Teams",
"Version": "",
"Enabled": 1,
"PostInstall": []
"PostInstall": [
{
"Type": "FileCopy",
"Source": "./assets/msteams/Microsoft Teams.lnk",
"Destination": "$HOME\\Desktop\\Microsoft Teams.lnk"
}
]
},
{
"Name": "KeePassXC",
@@ -69,6 +76,10 @@
"Type": "FileCopy",
"Source": "./assets/keepassxc/KeePassXC.lnk",
"Destination": "$HOME\\Desktop\\KeePassXC.lnk"
},
{
"Type": "RegImport",
"Path": "./config/keepassxc.reg"
}
]
},
@@ -119,6 +130,19 @@
}
]
},
{
"Name": "Revo Uninstaller",
"Id": "RevoUninstaller.RevoUninstaller",
"Version": "2.6.8",
"Manifest": "../manifests/RevoUninstaller.RevoUninstaller.yaml",
"Enabled": 0,
"PostInstall": [
{
"Type": "RegImport",
"Path": "./config/revo_uninstaller.reg"
}
]
},
{
"Name": "Adobe Acrobat Reader",
"Id": "Adobe.Acrobat.Reader.64-bit",
@@ -131,6 +155,18 @@
}
]
},
{
"Name": "Browserautoms",
"Id": "Special.Browserautoms",
"Version": "3.3.1",
"Enabled": 0,
"PostInstall": [
{
"Type": "Command",
"Command": "\"$PSScriptRoot\\config\\browserautoms.bat\""
}
]
},
{
"Name": "System Optimize",
"Id": "System.Config",

View File

@@ -1,15 +1,15 @@
# 设置严格模式,遇到错误停止,防止错误的命令雪崩
# Stop on errors to avoid cascading failures.
$ErrorActionPreference = "Stop"
#Set-StrictMode -Version Latest
# === 1. 加载依赖库 ===
# 确保 lib 目录存在
# === 1. Check dependencies ===
# Make sure the lib directory exists.
if (-not (Test-Path "$PSScriptRoot\..\lib")) {
Write-Error "Cannot find .\lib, some files missing."
exit 1
}
# === 2. 读取配置 ===
# === 2. Read configuration ===
$jsonPath = "$PSScriptRoot\apps.json"
if (-not (Test-Path $jsonPath)) {
Write-Error "Cannot find: $jsonPath"
@@ -17,14 +17,100 @@ if (-not (Test-Path $jsonPath)) {
}
Write-Host "Reading configurations..." -ForegroundColor Cyan
# 使用 UTF8 读取防止中文乱码
# Read as UTF-8.
$apps = Get-Content $jsonPath -Encoding UTF8 | ConvertFrom-Json
$forcePostInstall = $false
# === 3. 主循环 ===
function Unblock-WinGetCache {
param(
[Parameter(Mandatory=$true)] [string]$PackageId
)
$wingetCacheRoot = Join-Path $env:TEMP "WinGet"
if (-not (Test-Path $wingetCacheRoot)) {
return
}
$cacheItems = Get-ChildItem -Path $wingetCacheRoot -Recurse -File -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*\$PackageId.*" }
foreach ($item in $cacheItems) {
try {
Unblock-File -LiteralPath $item.FullName -ErrorAction Stop
Write-Host "-> Unblocked cached installer: $($item.FullName)" -ForegroundColor DarkGray
} catch {
Write-Warning "Failed to unblock cached installer: $($item.FullName), $_"
}
}
}
# === 2.1 Load selection.ini overrides ===
# selection.ini is located in the project root, one level above bin.
$selectionPath = Join-Path (Split-Path $PSScriptRoot -Parent) "selection.ini"
if (Test-Path $selectionPath) {
Write-Host "Loading selection overrides from selection.ini..." -ForegroundColor Cyan
try {
# Store app switches and global options separately.
$selectionConfig = @{}
$optionsConfig = @{}
$currentSection = ""
foreach ($line in (Get-Content $selectionPath -Encoding UTF8)) {
$line = $line.Trim()
if ([string]::IsNullOrWhiteSpace($line) -or $line.StartsWith(";") -or $line.StartsWith("#")) {
continue
}
if ($line -match '^\[(.+)\]$') {
$currentSection = $matches[1].Trim()
continue
}
if ($line -notmatch "=") {
continue
}
# Split on the first equals sign only.
$parts = $line -split '=', 2
if ($parts.Count -eq 2) {
$key = $parts[0].Trim()
$value = $parts[1].Trim()
if ($currentSection -eq "Options") {
$optionsConfig[$key] = $value
} else {
$selectionConfig[$key] = $value
}
}
}
if ($optionsConfig.ContainsKey("ForcePostInstall")) {
$forcePostInstall = $optionsConfig["ForcePostInstall"] -eq "1"
}
# Apply app enabled overrides.
foreach ($app in $apps) {
if ($selectionConfig.ContainsKey($app.Name)) {
# Convert to integer 1 or 0.
$app.Enabled = [int]$selectionConfig[$app.Name]
}
}
} catch {
Write-Warning "Error reading selection.ini: $_"
}
}
# === 2.2 Enable local manifest installation ===
# winget install --manifest requires LocalManifestFiles. Re-running this is harmless.
Write-Host "Enabling winget local manifest support..." -ForegroundColor Cyan
winget settings --enable LocalManifestFiles
# === 3. Main loop ===
foreach ($app in $apps) {
if ($app.Enabled -ne 1) {
Write-Host "[Skipping] $($app.Name)" -ForegroundColor DarkGray
continue # 立即结束本次循环,进入下一个软件
continue # Skip this app.
}
Write-Host "`n==========================================" -ForegroundColor Cyan
@@ -32,56 +118,117 @@ foreach ($app in $apps) {
Write-Host "=========================================="
if ($app.Id -eq "System.Config") {
# 如果是纯配置项,直接打印跳过信息
# This is a configuration-only item.
Write-Host "[System Config] Skipping install..." -ForegroundColor Magenta
} elseif ($app.Id -eq "Special.Browserautoms") {
Write-Host "[Special] Install Browserautoms..." -ForegroundColor Magenta
} else {
# --- 步骤 A: Winget 安装 ---
$wingetArgs = @(
"install",
"--id", $app.Id,
"-e",
"--silent",
"--accept-package-agreements",
"--accept-source-agreements",
"--disable-interactivity"
# "--scope", "machine"
)
# --- Step A: Winget install ---
$manifestPath = $null
$manifestTempDir = $null
# [版本检查逻辑]
# 检查 Version 是否存在且不为空字符串
if (-not [string]::IsNullOrWhiteSpace($app.Version)) {
Write-Host "-> Version: $($app.Version)"
$wingetArgs += "-v"
$wingetArgs += $app.Version
if (-not [string]::IsNullOrWhiteSpace($app.Manifest)) {
Write-Host "-> Manifest: $($app.Manifest)"
if ($app.Manifest -match '^https?://') {
$manifestTempDir = Join-Path $env:TEMP ("winit-helper-manifest-" + [guid]::NewGuid().ToString("N"))
New-Item -ItemType Directory -Path $manifestTempDir -Force | Out-Null
$manifestFileName = [System.IO.Path]::GetFileName(([uri]$app.Manifest).AbsolutePath)
if ([string]::IsNullOrWhiteSpace($manifestFileName)) {
$manifestFileName = "$($app.Id).yaml"
}
$manifestPath = Join-Path $manifestTempDir $manifestFileName
Write-Host "-> Downloading custom manifest..."
Invoke-WebRequest -Uri $app.Manifest -OutFile $manifestPath
} else {
$manifestPath = $app.Manifest
if (-not [System.IO.Path]::IsPathRooted($manifestPath)) {
$manifestPath = Join-Path $PSScriptRoot $manifestPath
}
if (-not (Test-Path $manifestPath)) {
Write-Error "Cannot find manifest: $manifestPath"
continue
}
}
$wingetArgs = @(
"install",
"--manifest", $manifestPath,
"--silent",
"--accept-package-agreements",
"--accept-source-agreements",
"--disable-interactivity"
# "--scope", "machine"
)
} else {
Write-Host "-> Version: latest"
$wingetArgs = @(
"install",
"--id", $app.Id,
"-e",
"--silent",
"--accept-package-agreements",
"--accept-source-agreements",
"--disable-interactivity"
# "--scope", "machine"
)
# Add Version only when configured.
if (-not [string]::IsNullOrWhiteSpace($app.Version)) {
Write-Host "-> Version: $($app.Version)"
$wingetArgs += "-v"
$wingetArgs += $app.Version
} else {
Write-Host "-> Version: latest"
}
}
Write-Host "-> Installing via winget..."
# 执行安装
$proc = Start-Process -FilePath "winget" -ArgumentList $wingetArgs -Wait -PassThru -NoNewWindow
# Run install command.
try {
& winget @wingetArgs
$exitCode = $LASTEXITCODE
# 检查安装结果 (0=成功, -1978335189=已安装)
if ($proc.ExitCode -eq 0) {
if ($exitCode -eq -1978335231 -and -not [string]::IsNullOrWhiteSpace($app.Manifest)) {
Write-Warning "winget failed after download. Unblocking cached installer and retrying once..."
Unblock-WinGetCache -PackageId $app.Id
& winget @wingetArgs
$exitCode = $LASTEXITCODE
}
} finally {
if ($manifestTempDir -and (Test-Path $manifestTempDir)) {
Remove-Item -LiteralPath $manifestTempDir -Recurse -Force
}
}
# Check install result (0=success, -1978335189=already installed).
if ($exitCode -eq 0) {
Write-Host "[Success]" -ForegroundColor Green
} elseif ($proc.ExitCode -eq -1978335189) {
Write-Host "[Skip] Already installed" -ForegroundColor Yellow
continue # 已经安装的为了避免覆盖配置,也就不配置了
} elseif ($exitCode -eq -1978335189) {
if ($forcePostInstall) {
Write-Host "[Skip] Already installed, running PostInstall..." -ForegroundColor Yellow
} else {
Write-Host "[Skip] Already installed" -ForegroundColor Yellow
continue # Skip PostInstall when already installed.
}
} else {
Write-Error "[Fail] Error code: $($proc.ExitCode)"
continue # 安装失败则跳过后续配置
Write-Error "[Fail] Error code: $exitCode"
continue # Skip PostInstall on install failure.
}
}
# --- 步骤 B: PostInstall 配置 ---
# --- Step B: PostInstall configuration ---
if ($app.PostInstall -and $app.PostInstall.Count -gt 0) {
Write-Host "`n-> Configuring..." -ForegroundColor Cyan
$stepIndex = 0
foreach ($action in $app.PostInstall) {
# [间隔逻辑] 如果这不是第一步,先等待 2 秒
# Wait between PostInstall steps.
if ($stepIndex -gt 0) {
Write-Host "(Waiting 2 seconds...)" -ForegroundColor DarkGray
Start-Sleep -Seconds 2
@@ -90,20 +237,20 @@ foreach ($app in $apps) {
try {
switch ($action.Type) {
# 1. 复制文件
# 1. Copy file.
"FileCopy" {
& "$PSScriptRoot\..\lib\invoke-filecopy.ps1" `
-Source $action.Source `
-Destination $action.Destination
}
# 2. 导入注册表
# 2. Import registry file.
"RegImport" {
& "$PSScriptRoot\..\lib\invoke-regimport.ps1" `
-Path $action.Path
}
# 3. 执行 CMD
# 3. Run command.
"Command" {
& "$PSScriptRoot\..\lib\invoke-cmdexec.ps1" `
-Command $action.Command `

3
config/browserautoms.bat Normal file
View File

@@ -0,0 +1,3 @@
@echo off
msiexec.exe /i "https://dl.oranjee.org/winget-repo/manifests/i/Internal/Browserautoms/3.3.1/browserautoms.msi" /qn /norestart

View File

@@ -4,6 +4,14 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionSettings\ddkjiahejlhfcafbddmgiahcphecmpfh]
"installation_mode"="normal_installed"
"update_url"="https://clients2.google.com/service/update2/crx"
;TrafficLight
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionSettings\cfnpidifppmenkapgihekkeednfoenal]
"installation_mode"="normal_installed"
"update_url"="https://clients2.google.com/service/update2/crx"
;Easy Clean
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionSettings\bjpclojdgakmcjmfdgiodjgfncaejaki]
"installation_mode"="normal_installed"
"update_url"="https://clients2.google.com/service/update2/crx"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\Recommended]
"AutofillAddressEnabled"=dword:00000000
@@ -21,6 +29,10 @@ Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionSettings\odfafepnkmbhccpbejgmiehpchacaeak]
"installation_mode"="normal_installed"
"update_url"="https://edge.microsoft.com/extensionwebstorebase/v1/crx"
;Click&Clean
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\ExtensionSettings\dacknjoogbepndbemlmljdobinliojbk]
"installation_mode"="normal_installed"
"update_url"="https://edge.microsoft.com/extensionwebstorebase/v1/crx"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Edge\Recommended]
"AlternateErrorPagesEnabled"=dword:00000000

5
config/keepassxc.reg Normal file
View File

@@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
; disable automatically start
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run]
"KeePassXC"=-

View File

@@ -0,0 +1,72 @@
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\General]
"AU on startup"=dword:00000000
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\Uninstaller]
"Create System Restore Pont"=dword:00000000
"Maximize uninstall wizard"=dword:00000000
"Select leftovers by default"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Browsers\CHR]
"Clear History of Visited Internet Web Pages"=dword:00000001
"Delete Temporary Internet Files"=dword:00000001
"Delete Cookies"=dword:00000000
"Delete Download History"=dword:00000001
"Delete Form History"=dword:00000001
"Delete Session History"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Browsers\EDGE]
"Clear History of Visited Internet Web Pages"=dword:00000001
"Delete Temporary Internet Files"=dword:00000001
"Delete Cookies"=dword:00000000
"Delete Download History"=dword:00000001
"Delete Form History"=dword:00000001
"Delete Session History"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Browsers\FF]
"Clear History of Visited Internet Web Pages"=dword:00000001
"Delete Temporary Internet Files"=dword:00000001
"Delete Cookies"=dword:00000001
"Delete Download History"=dword:00000001
"Delete Form History"=dword:00000001
"Delete Session History"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Browsers\IE]
"Clear History of Visited Internet Web Pages"=dword:00000001
"Delete Address Bar History"=dword:00000001
"Delete Temporary Internet Files"=dword:00000001
"Delete Cookies"=dword:00000001
"Delete Index.dat files"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Browsers\Opera]
"Clear History of Visited Internet Web Pages"=dword:00000001
"Delete Download History"=dword:00000001
"Delete Temporary Internet Files"=dword:00000001
"Delete Cookies"=dword:00000001
"Delete Session History"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\MSOffice]
"CWRDH"=dword:00000001
"CERDH"=dword:00000001
"CARDH"=dword:00000001
"CPPRDH"=dword:00000001
"CFPEDH"=dword:00000001
[HKEY_CURRENT_USER\Software\VS Revo Group\Revo Uninstaller\TrackCleaner\Windows]
"Clear Recent Documents History"=dword:00000001
"Clear Start Menu Run History"=dword:00000001
"Clear Find File History"=dword:00000001
"Clear Printers, Computers and People Find History"=dword:00000001
"Clear Paint Recent File History"=dword:00000001
"Clear Wordpad Recent File History"=dword:00000001
"Clear Regedit Last Opened Key History"=dword:00000001
"Clear Common Dialog Open Save Recent History"=dword:00000001
"Clear Common Dialog Last Visited Folder History"=dword:00000001
"Delete Start Menu Click Logs"=dword:00000001
"Empty Clipboard"=dword:00000001
"Empty Recycle Bin"=dword:00000001
"Delete Windows Temporary Files"=dword:00000001
"Delete Memory Dump Files"=dword:00000001
"Delete Chkdsk recovered file fragments"=dword:00000001
"Delete Thumbnail Cache"=dword:00000001

View File

@@ -1,26 +1,25 @@
@echo off
:: ==========================================
:: 自动化装机工具启动器
:: ==========================================
rem ==========================================
rem Winit Helper launcher
rem ==========================================
:: 1. 强制切换到当前批处理文件所在的目录
:: 这一步至关重要,防止以管理员身份运行时路径变成了 C:\Windows\System32
rem Always run from the project directory.
cd /d "%~dp0"
:: 2. 检查管理员权限
rem Relaunch as administrator when needed.
if not "%1" == "am_admin" (
rem you'd better keep the following line as it is.
powershell start -verb runas '%0' am_admin & exit /b
powershell.exe -NoProfile -Command "Start-Process -FilePath '%~f0' -ArgumentList 'am_admin' -Verb RunAs"
exit /b
)
:: ==========================================
:: 3. 核心执行逻辑
:: ==========================================
rem ==========================================
rem Run main script
rem ==========================================
echo Calling main.ps1...
:: -NoProfile: 不加载用户配置文件,加快启动速度
:: -ExecutionPolicy Bypass: 绕过默认的脚本执行策略限制
:: -File: 指定要运行的脚本文件
rem Remove Zone.Identifier from copied or downloaded project files.
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Get-ChildItem -LiteralPath '%~dp0' -Recurse -File -Include *.ps1,*.psm1,*.bat,*.cmd,*.json,*.yaml,*.yml,*.reg | Unblock-File -ErrorAction SilentlyContinue"
powershell.exe -NoExit -NoProfile -ExecutionPolicy Bypass -File ".\bin\main.ps1"

View File

@@ -3,36 +3,36 @@ param(
[string]$WorkDir = $null
)
# 1. 处理工作目录
# 1. Resolve work directory.
if ([string]::IsNullOrEmpty($WorkDir)) {
$WorkDir = $PSScriptRoot
} else {
# 如果 WorkDir 里包含变量(如 $env:APPDATA),展开它
# Expand variables in WorkDir, such as $env:APPDATA.
$WorkDir = $ExecutionContext.InvokeCommand.ExpandString($WorkDir)
}
# 确保目录存在,否则命令会报错
# Make sure the directory exists.
if (-not (Test-Path $WorkDir)) {
Write-Warning "`n[CMD] WARNING: The work dir does not exist, using ($WorkDir)"
$WorkDir = $PSScriptRoot
}
# 2. 处理命令中的环境变量
# 2. Expand variables in the command.
$ProjectRoot = Split-Path $PSScriptRoot -Parent
# === 替换 $PSScriptRoot 为实际的绝对路径 ===
# 注意:要处理反斜杠转义问题,直接用字符串替换最安全
# Replace $PSScriptRoot with the project root path.
# Direct string replacement is the safest option for backslashes.
if ($Command.Contains('$PSScriptRoot')) {
$Command = $Command.Replace('$PSScriptRoot', $ProjectRoot)
}
# 这一步很关键,让你可以写 "echo $env:USERNAME"
# This allows commands such as "echo $env:USERNAME".
$Command = $ExecutionContext.InvokeCommand.ExpandString($Command)
Write-Host "`n[CMD] Execute: $Command" -ForegroundColor Gray
# 3. 启动进程
# /c 表示执行完命令后关闭 cmd 窗口
# /s 开启参数的一般处理(忽略第一个和最后一个引号,为了兼容复杂引号情况)
# 3. Start cmd.exe.
# /c closes cmd after the command completes.
# /s enables cmd quote handling for complex command strings.
$processOptions = @{
FilePath = "cmd.exe"
ArgumentList = "/s", "/c", "`"$Command`""
@@ -45,10 +45,10 @@ $processOptions = @{
try {
$proc = Start-Process @processOptions
# 4. 检查退出代码 (ExitCode)
# 4. Check exit code.
if ($proc.ExitCode -ne 0) {
Write-Error "`n[CMD] Failed to execute, exit code: $($proc.ExitCode)"
}
} catch {
Write-Error "`n[CMD] Failed to start process: $_"
}
}

View File

@@ -7,35 +7,33 @@ param(
)
try {
# 1. 路径预处理:展开环境变量 (例如把 $env:APPDATA 变成 C:\Users\...\AppData\Roaming)
# 1. Expand variables in paths.
$ResolvedSource = $ExecutionContext.InvokeCommand.ExpandString($Source)
$ResolvedDest = $ExecutionContext.InvokeCommand.ExpandString($Destination)
# 2. 处理相对路径 (针对源文件)
# 如果源路径是相对路径 (./assets/...), 尝试将其转换为绝对路径
# 假设脚本是从项目根目录调用的
# 2. Resolve relative source paths from the project root.
if (-not (Test-Path $ResolvedSource) -and (Test-Path "$PWD\$ResolvedSource")) {
$ResolvedSource = Join-Path $PWD $ResolvedSource
}
# 3. 再次检查源文件是否存在
# 3. Make sure the source file exists.
if (-not (Test-Path $ResolvedSource -PathType Leaf)) {
Write-Warning "`n[FileCopy] [Skip] File not found: $ResolvedSource"
return # 退出脚本
return
}
# 4. 处理目标目录 (自动创建不存在的文件夹)
# 4. Create destination directory when needed.
$DestDir = Split-Path -Path $ResolvedDest -Parent
if (-not (Test-Path $DestDir)) {
Write-Host "`n[FileCopy] Create dir: $DestDir" -ForegroundColor DarkGray
New-Item -Path $DestDir -ItemType Directory -Force | Out-Null
}
# 5. 执行复制 (Force = 覆盖)
# 5. Copy file. Force overwrites existing files.
Copy-Item -Path $ResolvedSource -Destination $ResolvedDest -Force -ErrorAction Stop
Write-Host "`n[FileCopy] Success: $ResolvedDest" -ForegroundColor Green
} catch {
Write-Error "`n[FileCopy] Fail: $_"
}
}

View File

@@ -4,17 +4,15 @@ param(
)
try {
# 1. 路径预处理
# 展开环境变量 (虽然 .reg 路径通常是固定的,但支持一下没坏处)
# 1. Expand variables in the path.
$ResolvedPath = $ExecutionContext.InvokeCommand.ExpandString($Path)
# 2. 处理相对路径
# 如果路径是相对的 (./assets/...), 转换为绝对路径
# 2. Resolve relative paths from the project root.
if (-not (Test-Path $ResolvedPath) -and (Test-Path "$PWD\$ResolvedPath")) {
$ResolvedPath = Join-Path $PWD $ResolvedPath
}
# 3. 检查文件是否存在
# 3. Make sure the registry file exists.
if (-not (Test-Path $ResolvedPath)) {
Write-Warning "`n[RegImport] [Skip] Cannot find: $ResolvedPath"
return
@@ -22,8 +20,7 @@ try {
Write-Host "`n[RegImport] Importing: $(Split-Path $ResolvedPath -Leaf)" -ForegroundColor Gray
# 4. 调用 reg.exe 导入
# 使用 Start-Process 以获取退出代码
# 4. Import with reg.exe and capture the exit code.
$proc = Start-Process -FilePath "reg.exe" -ArgumentList "import", "`"$ResolvedPath`"" -Wait -PassThru -NoNewWindow
if ($proc.ExitCode -eq 0) {
@@ -34,4 +31,4 @@ try {
} catch {
Write-Error "`n[RegImport] Failed to start process: $_"
}
}

View File

@@ -0,0 +1,39 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.singleton.1.12.0.schema.json
PackageIdentifier: Google.Chrome
PackageVersion: 152.0.7977.83
PackageLocale: zh-CN
Publisher: Google LLC
PackageName: Google Chrome
License: 免费软件
ShortDescription: 快速安全的网络浏览器,专为您而打造
InstallerType: wix
Scope: machine
UpgradeBehavior: install
Protocols:
- http
- https
- mailto
- mms
- tel
- webcal
FileExtensions:
- htm
- html
- pdf
- shtml
- svg
- webp
- xht
- xhtml
ElevationRequirement: elevatesSelf
Installers:
- Architecture: x64
InstallerUrl: https://dl.oranjee.org/winget-repo/manifests/g/Google/Chrome/152.0.7977.83/googlechromestandaloneenterprise64.msi
InstallerSha256: 1C555A95C69153EF2D6D6CF82670A4F2FAE6EB455CECF96CBD9BC43E5ED3B9E8
ProductCode: '{D73883EB-7167-37B2-A69C-06A4744F64D2}'
AppsAndFeaturesEntries:
- ProductCode: '{042C29DE-2EAE-34E1-A978-C2BE5AB65557}'
UpgradeCode: '{C1DFDF69-5945-32F2-A35E-EE94C99C7CF4}'
ManifestType: singleton
ManifestVersion: 1.12.0

View File

@@ -0,0 +1,23 @@
# yaml-language-server: $schema=https://aka.ms/winget-manifest.singleton.1.10.0.schema.json
PackageIdentifier: RevoUninstaller.RevoUninstaller
PackageVersion: 2.6.8
PackageLocale: en-US
InstallerType: inno
Scope: machine
InstallModes:
- interactive
- silent
- silentWithProgress
UpgradeBehavior: install
ElevationRequirement: elevatesSelf
Installers:
- Architecture: x86
InstallerUrl: https://dl.oranjee.org/winget-repo/manifests/r/RevoUninstaller/RevoUninstaller/2.6.8/revosetup.exe
InstallerSha256: 8f90951459936a7e2d0eeb508297604bc3e2746d9f5e3646a3fcba1e35f4049b
ManifestType: singleton
ManifestVersion: 1.10.0
License: Freeware
PackageName: Revo Uninstaller
Publisher: VS Revo Group, Ltd.
ShortDescription: Revo Uninstaller helps you to uninstall software and remove unwanted programs easily.

18
selection.ini Normal file
View File

@@ -0,0 +1,18 @@
[Options]
# 设为 0 表示已安装的软件不会进行设置
# 设为 1 表示已安装的软件也会进行设置
ForcePostInstall=0
[Apps]
7-Zip=1
Google Chrome=1
OpenOffice=1
Microsoft Teams=1
KeePassXC=1
VeraCrypt=1
File Shredder=1
VLC=1
Revo Uninstaller=1
Adobe Acrobat Reader=0
Browserautoms=1
System Optimize=1