Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(server): install preview runtimes from release archives #11318

Mergedjuliusmarmingemerged 9 commits intosea/release-archives fromrefs/pull/11318/headmerged by juliusmarminge View on GitHub

Showing 25 changed files with 208 additions and 0 deletions (loading 22).

x
0 of 25 viewed, 25 left
95 additions and 0 deletionsapps/marketing/public/install.ps1Added
View file
@@ -0,0 +1,95 @@
+# Installs the T3 Code CLI from a GitHub Release archive on Windows. Needs
+# only PowerShell 5.1+; no Node, npm, or compiler.
+#
+# irm https://t3.codes/install.ps1 | iex
+#
+# Environment:
+# T3CODE_VERSION exact version to install (default: latest preview release)
+# T3CODE_HOME T3 home directory (default: ~\.t3)
+# T3CODE_INSTALL_BIN_DIR where t3.exe is linked (default: ~\.local\bin)
+# T3CODE_RELEASE_BASE_URL mirror for releases/download (default: GitHub)
+#
+# The archive is unpacked into $T3CODE_HOME\runtime\versions\<version>, the
+# same layout `t3 service install` uses, so the service reuses this download.
+$ErrorActionPreference = "Stop"
+[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
+​
+$repo = "pingdotgg/t3code"
+$baseUrl = if ($env:T3CODE_RELEASE_BASE_URL) { $env:T3CODE_RELEASE_BASE_URL.TrimEnd("/") } else { "https://github.com/$repo/releases/download" }
+$t3Home = if ($env:T3CODE_HOME) { $env:T3CODE_HOME } else { Join-Path $HOME ".t3" }
+$binDir = if ($env:T3CODE_INSTALL_BIN_DIR) { $env:T3CODE_INSTALL_BIN_DIR } else { Join-Path $HOME ".local\bin" }
+​
+function Fail([string] $message) {
+ Write-Error "t3 install: $message"
+ exit 1
+}
+​
+# PROCESSOR_ARCHITEW6432 reports the real machine when a 32-bit PowerShell
+# runs under WOW64; RuntimeInformation needs .NET 4.7.1+, which 5.1 hosts
+# may lack.
+$rawArch = if ($env:PROCESSOR_ARCHITEW6432) { $env:PROCESSOR_ARCHITEW6432 } else { $env:PROCESSOR_ARCHITECTURE }