122 lines
3.3 KiB
PowerShell
122 lines
3.3 KiB
PowerShell
[Console]::OutputEncoding = [Text.Encoding]::UTF8
|
|
$ErrorActionPreference = 'Continue'
|
|
|
|
Write-Host "[*] Installing applications via direct download"
|
|
Write-Host ""
|
|
|
|
$downloadFolder = "$env:TEMP\AppDownloads"
|
|
New-Item -ItemType Directory -Force -Path $downloadFolder | Out-Null
|
|
|
|
function Install-App {
|
|
param(
|
|
[string]$Name,
|
|
[string]$Url,
|
|
[string]$FileName,
|
|
[string]$InstallArgs
|
|
)
|
|
|
|
Write-Host "Installing $Name..."
|
|
Write-Host " URL: $Url"
|
|
|
|
$downloadPath = Join-Path $downloadFolder $FileName
|
|
|
|
try {
|
|
Write-Host " Downloading..."
|
|
Invoke-WebRequest -Uri $Url -OutFile $downloadPath -UseBasicParsing
|
|
|
|
Write-Host " Installing..."
|
|
if ($FileName.EndsWith(".msi")) {
|
|
& msiexec /i $downloadPath $InstallArgs
|
|
} else {
|
|
& $downloadPath $InstallArgs
|
|
}
|
|
|
|
Write-Host " [OK] $Name installation completed"
|
|
return $true
|
|
|
|
} catch {
|
|
Write-Host " [ERROR] Failed to install $Name"
|
|
Write-Host " Error: $($_.Exception.Message)"
|
|
return $false
|
|
}
|
|
}
|
|
|
|
# Application definitions
|
|
$apps = @(
|
|
@{
|
|
Name = "Google Chrome"
|
|
Url = "https://dl.google.com/chrome/install/GoogleChromeStandaloneEnterprise64.msi"
|
|
FileName = "ChromeSetup.msi"
|
|
InstallArgs = "/quiet /norestart"
|
|
},
|
|
@{
|
|
Name = "7-Zip"
|
|
Url = "https://www.7-zip.org/a/7z2301-x64.msi"
|
|
FileName = "7zip-setup.msi"
|
|
InstallArgs = "/quiet /norestart"
|
|
},
|
|
@{
|
|
Name = "AnyDesk"
|
|
Url = "https://download.anydesk.com/AnyDesk.msi"
|
|
FileName = "AnyDesk.msi"
|
|
InstallArgs = "/quiet /norestart"
|
|
}
|
|
)
|
|
|
|
$successCount = 0
|
|
|
|
foreach ($app in $apps) {
|
|
if (Install-App -Name $app.Name -Url $app.Url -FileName $app.FileName -InstallArgs $app.InstallArgs) {
|
|
$successCount++
|
|
}
|
|
Write-Host ""
|
|
Start-Sleep -Seconds 2
|
|
}
|
|
|
|
# Manual instructions for apps that need special handling
|
|
Write-Host "=== Manual Downloads Required ==="
|
|
Write-Host ""
|
|
|
|
Write-Host "LINE:"
|
|
Write-Host " Please download from: https://line.me/download"
|
|
Write-Host " Or direct: https://desktop.line-scdn.net/win/new/LineInst.exe"
|
|
Write-Host ""
|
|
|
|
Write-Host "Adobe Reader:"
|
|
Write-Host " Please download from: https://get.adobe.com/reader/"
|
|
Write-Host " Select version for Windows and download"
|
|
Write-Host ""
|
|
|
|
Write-Host "=== Installation Summary ==="
|
|
Write-Host "Automatically installed: $successCount / 3 applications"
|
|
Write-Host "Manual download required: 2 applications (LINE, Adobe Reader)"
|
|
Write-Host ""
|
|
|
|
# Create desktop shortcuts for manual downloads
|
|
$desktopPath = "C:\Users\User\Desktop"
|
|
|
|
# Create LINE download shortcut
|
|
$lineShortcut = @"
|
|
[InternetShortcut]
|
|
URL=https://line.me/download
|
|
IconIndex=0
|
|
"@
|
|
$lineShortcut | Out-File "$desktopPath\Download-LINE.url" -Encoding ASCII
|
|
|
|
# Create Adobe Reader download shortcut
|
|
$adobeShortcut = @"
|
|
[InternetShortcut]
|
|
URL=https://get.adobe.com/reader/
|
|
IconIndex=0
|
|
"@
|
|
$adobeShortcut | Out-File "$desktopPath\Download-Adobe-Reader.url" -Encoding ASCII
|
|
|
|
Write-Host "Created download shortcuts on User desktop:"
|
|
Write-Host " - Download-LINE.url"
|
|
Write-Host " - Download-Adobe-Reader.url"
|
|
|
|
# Clean up
|
|
Remove-Item $downloadFolder -Recurse -Force -ErrorAction SilentlyContinue
|
|
|
|
Write-Host ""
|
|
Write-Host "Installation process completed!" |