# PowerShell Installer Script for Zenith Macros # Running this script will download, install, and create a shortcut for Zenith Macros. $ErrorActionPreference = "Stop" [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12 # 1. Configuration $AppName = "Zenith Macros" $InstallDir = Join-Path $env:LOCALAPPDATA "ZenithMacros" $ExePath = Join-Path $InstallDir "Zenith.exe" $DownloadUrl = "https://github.com/p45676462/Zenith-Macro/raw/refs/heads/main/20260722_152307_b3ed80596009.exe" $ShortcutPath = Join-Path (Join-Path $env:USERPROFILE "Desktop") "$AppName.lnk" Write-Host "=============================================" -ForegroundColor Cyan Write-Host " Installing $AppName..." -ForegroundColor Cyan Write-Host "=============================================" -ForegroundColor Cyan try { # 2. Create installation directory if (-not (Test-Path $InstallDir)) { Write-Host "Creating installation directory: $InstallDir..." -ForegroundColor DarkGray New-Item -ItemType Directory -Force -Path $InstallDir | Out-Null } # 3. Download the executable file Write-Host "Downloading application from host..." -ForegroundColor Yellow # Using modern WebClient for clean download progress $WebClient = New-Object System.Net.WebClient $WebClient.Headers.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)") # Simple console progress indicator $start_time = Get-Date $WebClient.DownloadFile($DownloadUrl, $ExePath) Write-Host "Download completed in $(([DateTime]::Now - $start_time).Seconds) seconds." -ForegroundColor Green Write-Host "Saved to: $ExePath" -ForegroundColor DarkGray # 4. Create Desktop Shortcut Write-Host "Creating Desktop shortcut..." -ForegroundColor Yellow $WshShell = New-Object -ComObject WScript.Shell $Shortcut = $WshShell.CreateShortcut($ShortcutPath) $Shortcut.TargetPath = $ExePath $Shortcut.WorkingDirectory = $InstallDir $Shortcut.Description = "Launch $AppName" $Shortcut.IconLocation = "$ExePath,0" $Shortcut.Save() Write-Host "Shortcut created at: $ShortcutPath" -ForegroundColor Green # 5. Success Message Write-Host "" Write-Host "=============================================" -ForegroundColor Green Write-Host " $AppName has been installed successfully!" -ForegroundColor Green Write-Host " You can now run it from your Desktop." -ForegroundColor Green Write-Host "=============================================" -ForegroundColor Green # 6. Optional: Start the app immediately $StartApp = Read-Host "Do you want to launch the application now? (Y/N)" if ($StartApp -eq "Y" -or $StartApp -eq "y") { Write-Host "Launching $AppName..." -ForegroundColor Cyan Start-Process $ExePath -WorkingDirectory $InstallDir } } catch { Write-Host "" Write-Host "An error occurred during installation:" -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor Red Write-Host "Please check your internet connection or run the script as Administrator if required." -ForegroundColor Yellow }