# Installs StudyLock 1.2 from https://apps.abrarzahin.com/ on Windows 10 or 11. # # irm https://apps.abrarzahin.com/studylock.ps1 | iex # # What it does, in order: # 1. downloads the same installer the download page offers (StudyLock-Setup.exe) # 2. checks its SHA-256 against the one below, and stops if it differs # 3. runs it silently for your account only (no admin password), which opens StudyLock when done # A file downloaded by a browser gets a "downloaded from the internet" mark, which is what makes # SmartScreen warn about an installer that isn't signed with a paid certificate. PowerShell doesn't # add that mark. Nothing else on your PC is changed. & { $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $App = 'StudyLock' $Sha = '9be64bfe0d0eb8f5c386527c0dcba553b0339ca4a9533436eb814bf0296ac17f' $Url = "https://apps.abrarzahin.com/$App-Setup.exe" $File = Join-Path $env:TEMP "$App-Setup.exe" Write-Host "Downloading $App-Setup.exe..." Invoke-WebRequest -Uri $Url -OutFile $File -UseBasicParsing if ((Get-FileHash -Path $File -Algorithm SHA256).Hash -ne $Sha.ToUpperInvariant()) { Remove-Item $File -ErrorAction SilentlyContinue throw "The download doesn't match the file published on abrarzahin.com, so nothing was installed. Try again in a few minutes." } Write-Host "Installing $App for your account..." # wait for the installer only: Start-Process -Wait would also wait for the app it opens, which keeps running $setup = Start-Process -FilePath $File -ArgumentList '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-' -PassThru $null = $setup.Handle # keeps ExitCode readable on Windows PowerShell 5.1 $setup.WaitForExit() Remove-Item $File -ErrorAction SilentlyContinue if ($setup.ExitCode -ne 0) { throw "The installer stopped with code $($setup.ExitCode)." } $Exe = Join-Path $env:LOCALAPPDATA "Programs\$App\$App.exe" if (-not (Test-Path $Exe)) { throw "The installer finished but $Exe isn't there." } Write-Host "Done. $App is installed and starts when you sign in." -ForegroundColor Green }