Initial commit

This commit is contained in:
2026-04-24 17:41:53 +08:00
commit 7105e8b165
94 changed files with 8141 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
[Console]::OutputEncoding = [Text.Encoding]::UTF8
$ErrorActionPreference = 'Continue'
Write-Host "[*] Installing essential applications"
Write-Host "Apps: AnyDesk, LINE, Chrome, 7zip, Adobe Reader"
Write-Host ""
# Install via winget (preferred method)
$apps = @(
@{Name="AnyDesk"; WingetId="AnyDeskSoftwareGmbH.AnyDesk"}
@{Name="LINE"; WingetId="LINE.LINE"}
@{Name="Google Chrome"; WingetId="Google.Chrome"}
@{Name="7-Zip"; WingetId="7zip.7zip"}
@{Name="Adobe Reader"; WingetId="Adobe.Acrobat.Reader.64-bit"}
)
$successCount = 0
$totalApps = $apps.Count
foreach ($app in $apps) {
Write-Host "Installing $($app.Name)..."
try {
$result = & winget install $app.WingetId --accept-package-agreements --accept-source-agreements --silent 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [OK] $($app.Name) installed successfully"
$successCount++
} else {
Write-Host " [SKIP] $($app.Name) may already be installed or failed"
# Check if already installed
$checkResult = & winget list $app.WingetId 2>&1
if ($LASTEXITCODE -eq 0) {
Write-Host " [INFO] $($app.Name) appears to be already installed"
$successCount++
}
}
} catch {
Write-Host " [ERROR] Failed to install $($app.Name)"
# Try alternative download for critical apps
if ($app.Name -eq "Google Chrome") {
Write-Host " Trying alternative Chrome download..."
try {
$chromeUrl = "https://dl.google.com/chrome/install/GoogleChromeStandaloneEnterprise64.msi"
$chromePath = "$env:TEMP\ChromeSetup.msi"
Invoke-WebRequest -Uri $chromeUrl -OutFile $chromePath -UseBasicParsing
& msiexec /i $chromePath /quiet /norestart
Write-Host " [OK] Chrome installed via direct download"
$successCount++
} catch {
Write-Host " [ERROR] Chrome alternative install failed"
}
}
}
Write-Host ""
}
Write-Host "=== Installation Summary ==="
Write-Host "Successfully installed: $successCount / $totalApps applications"
Write-Host ""
# Verify installations by checking common install locations
Write-Host "Verification:"
$verifyApps = @(
@{Name="AnyDesk"; Path="C:\Program Files (x86)\AnyDesk\AnyDesk.exe"}
@{Name="LINE"; Path="C:\Users\$env:USERNAME\AppData\Local\LINE\bin\LineLauncher.exe"}
@{Name="Chrome"; Path="C:\Program Files\Google\Chrome\Application\chrome.exe"}
@{Name="7-Zip"; Path="C:\Program Files\7-Zip\7z.exe"}
@{Name="Adobe Reader"; Path="C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"}
)
foreach ($app in $verifyApps) {
if (Test-Path $app.Path) {
Write-Host " [OK] $($app.Name) - Found at expected location"
} else {
# Try to find in registry
$found = $false
$regPaths = @(
"HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*",
"HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
)
foreach ($regPath in $regPaths) {
$installed = Get-ItemProperty $regPath -ErrorAction SilentlyContinue |
Where-Object { $_.DisplayName -like "*$($app.Name.Split(' ')[0])*" }
if ($installed) {
Write-Host " [OK] $($app.Name) - Found in registry"
$found = $true
break
}
}
if (-not $found) {
Write-Host " [!] $($app.Name) - Not detected"
}
}
}
Write-Host ""
Write-Host "Installation completed!"
Write-Host "Note: Applications may require restart to appear in Start Menu"