Download install.ps1 from Devseis/Ora: direct link, hf CLI and curl.
- Browser
- Download file 3.85 kB
-
https://huggingface.co/spaces/Devseis/Ora/resolve/main/install.ps1
- Command line
-
hf download hf://spaces/Devseis/Ora/install.ps1
-
curl -L -o install.ps1 https://huggingface.co/spaces/Devseis/Ora/resolve/main/install.ps1
3.85 kB
| # Ora installer for Windows 10/11 (64-bit). In PowerShell: | |
| # irm https://devseis-ora.static.hf.space/install.ps1 | iex | |
| # Downloads the current Ora release from Hugging Face (Devseis/ora-releases, folder releases/), checks its SHA-256 against the | |
| # published SHA256SUMS, installs it for this user (no administrator rights needed) and opens it. A file downloaded by | |
| # PowerShell is not marked as coming from the internet, so SmartScreen does not stop it. | |
| # Uninstall: Settings > Apps > Installed apps > Ora > Uninstall. Your plan and pictures stay in %APPDATA%\Ora until you | |
| # delete that folder. The previous version (Ora 0.4): irm https://devseis-ora.static.hf.space/previous/0.4/install.ps1 | iex | |
| $ErrorActionPreference = 'Stop' | |
| $ProgressPreference = 'SilentlyContinue' # much faster downloads in Windows PowerShell 5.1 | |
| [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 | |
| $Releases = if ($env:ORA_RELEASES) { $env:ORA_RELEASES } else { 'https://huggingface.co/datasets/Devseis/ora-releases/resolve/main/releases' } # ORA_RELEASES: testing only | |
| function Step($Text) { Write-Host '> ' -ForegroundColor Red -NoNewline; Write-Host $Text } | |
| function Fail($Text) { Write-Host "Ora install stopped: $Text" -ForegroundColor Red; throw "Ora install stopped" } | |
| try { | |
| if (-not [Environment]::Is64BitOperatingSystem) { Fail 'Ora needs 64-bit Windows 10 or 11.' } | |
| Write-Host 'Installing Ora - your marketing plan, step by step, with AI help' -ForegroundColor White | |
| Step 'finding the current version' | |
| $sums = (Invoke-WebRequest -UseBasicParsing "$Releases/SHA256SUMS").Content | |
| if ($sums -is [byte[]]) { $sums = [Text.Encoding]::UTF8.GetString($sums) } | |
| $version = (Invoke-RestMethod -UseBasicParsing "$Releases/latest.json").version | |
| if (-not $version) { Fail 'could not read the current version.' } | |
| $file = "Ora-$version-windows-x64-setup.exe" | |
| $want = ($sums -split "`n" | Where-Object { ($_ -split '\s+')[1] -eq $file } | ForEach-Object { ($_ -split '\s+')[0] }) | Select-Object -First 1 | |
| if (-not $want) { Fail "$file is not in SHA256SUMS." } | |
| $tmp = Join-Path $env:TEMP "ora-install-$([guid]::NewGuid().ToString('N'))" | |
| New-Item -ItemType Directory -Path $tmp | Out-Null | |
| $exe = Join-Path $tmp $file | |
| Step "downloading $file" | |
| Invoke-WebRequest -UseBasicParsing "$Releases/$file" -OutFile $exe | |
| $got = (Get-FileHash -Algorithm SHA256 $exe).Hash.ToLower() | |
| if ($got -ne $want.ToLower()) { Fail "the download does not match the published checksum (expected $want, got $got). Nothing was installed." } | |
| Step "checksum OK ($want)" | |
| try { Unblock-File $exe } catch { } # not needed for a PowerShell download; harmless where it applies | |
| Get-Process -Name 'Ora' -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue | |
| Step 'installing for this user (no administrator rights needed)' | |
| $p = Start-Process -FilePath $exe -ArgumentList '/S' -Wait -PassThru | |
| if ($p.ExitCode -ne 0) { Fail "the installer ended with code $($p.ExitCode)." } | |
| Remove-Item -Recurse -Force $tmp -ErrorAction SilentlyContinue | |
| $app = Join-Path $env:LOCALAPPDATA 'Programs\Ora\Ora.exe' | |
| if (-not (Test-Path $app)) { $app = (Get-ChildItem "$env:LOCALAPPDATA\Programs" -Recurse -Filter 'Ora.exe' -ErrorAction SilentlyContinue | Select-Object -First 1).FullName } | |
| Step "installed Ora $version" | |
| if ($app) { Start-Process $app; Write-Host 'Done. Ora is open. Next time, open Ora from the Start menu or the desktop shortcut.' -ForegroundColor White } | |
| else { Write-Host 'Done. Open Ora from the Start menu.' -ForegroundColor White } | |
| } catch { | |
| if ($_.Exception.Message -ne 'Ora install stopped') { Write-Host "Ora install stopped: $($_.Exception.Message)" -ForegroundColor Red } | |
| } | |