From dec393595baae1472d003b4bc82c37b2ee182e31 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 1 Jul 2025 19:42:10 +0200 Subject: [PATCH] feat: add windows debug installers and update installer docs --- assets/install-debug.ps1 | 65 ++++++++++++++++++++++++++++++++++++++++ content/index.smd | 42 +++++++++++++++++++++----- zine.ziggy | 1 + 3 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 assets/install-debug.ps1 diff --git a/assets/install-debug.ps1 b/assets/install-debug.ps1 new file mode 100644 index 0000000..afccd78 --- /dev/null +++ b/assets/install-debug.ps1 @@ -0,0 +1,65 @@ +$ErrorActionPreference = "Stop" + +$repo = "neurocyte/flow-nightly" +$title = "flow nightly build (debug)" +$updater = "install-debug" + +$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases/latest" +$version = $release.tag_name +$title_updater = "$title updater" +$install_dir = "$env:APPDATA\flow\bin" + +$existing_flow = Join-Path -Path $install_dir -ChildPath "flow.exe" +if (Test-Path $existing_flow) { + $existing_version_output = & $existing_flow --version 2>&1 | Out-String + $existing_version_lines = $existing_version_output -split "[\r\n]+" | Where-Object { $_ -match '^\s*version:\s*(.+?)\s*$' } + if ($existing_version_lines -and $matches) { + $existing_version = $matches[1] + if ($version -eq $existing_version) { + Write-Host "$title is up-to-date (version $version @ $install_dir)" + return + } + } +} + +$title = "$title $version" + +switch ($env:PROCESSOR_ARCHITECTURE) { + "AMD64" { $arch = "x86_64" } + "ARM64" { $arch = "aarch64" } + default { + Write-Host "unknown architecture: $($env:PROCESSOR_ARCHITECTURE)" + $LASTEXITCODE = 1 + return + } +} + +$filename = "flow-$version-windows-$arch-debug.zip" + +if (-not (Test-Path $install_dir)) { + Write-Host "creating installation directory: $install_dir" + New-Item -ItemType Directory -Path $install_dir | Out-Null +} + +Write-Host "downloading $title..." +Invoke-WebRequest -Uri "https://github.com/$repo/releases/download/$version/$filename" -OutFile "$install_dir\$filename" + +echo "installing $title to $install_dir ..." +Expand-Archive -Path "$install_dir\$filename" -DestinationPath $install_dir -Force +Remove-Item "$install_dir\$filename" + +echo "installing $title_updater to $install_dir\update-flow.ps1 ..." +Invoke-WebRequest -Uri "https://flow-control.dev/$updater.ps1" -OutFile "$install_dir\update-flow.ps1" + +echo "$title installed successfully to $install_dir" + +$current_path = [System.Environment]::GetEnvironmentVariable("Path", "User") +if ($current_path -notlike "*$install_dir*") { + $response = Read-Host "do you want to add $install_dir to your PATH? (y/n)" + if ($response -eq "y") { + $newPath = "$current_path;$install_dir" + [System.Environment]::SetEnvironmentVariable("Path", $newPath, "User") + Write-Host "added $install_dir to PATH" + Write-Host "close your terminal for changes to take effect" + } +} diff --git a/content/index.smd b/content/index.smd index 00b1721..a508c90 100644 --- a/content/index.smd +++ b/content/index.smd @@ -36,28 +36,24 @@ Flow Control is under active development, but usually very stable. ## 📦 Installation +### Linux, MacOS and *BSD + Fetch and install the latest release to `/usr/local/bin` with the installation helper script: ``` curl -fsSL https://flow-control.dev/install | sh ``` -or on Windows - -``` -Invoke-RestMethod "https://flow-control.dev/install.ps1" | Invoke-Expression -``` - Install the latest nightly build: ``` curl -fsSL https://flow-control.dev/install | sh -s -- --nightly ``` -or on Windows +with debug symbols: ``` -Invoke-RestMethod "https://flow-control.dev/install-nightly.ps1" | Invoke-Expression +curl -fsSL https://flow-control.dev/install | sh -s -- --nightly --debug ``` See all avalable options for the installer script: @@ -74,6 +70,36 @@ sudo chmod +x /usr/local/bin/update-flow update-flow ``` +At the top of the installer are variables to pre-answer the installation questions. +Configure them to your liking. + + +### Windows + +For Windows the installer scripts are a little different. + +Fetch and install the latest release to `%AppData%/Roaming/flow/bin`: + +``` +Invoke-RestMethod "https://flow-control.dev/install.ps1" | Invoke-Expression +``` + +Install the latest nightly build: + +``` +Invoke-RestMethod "https://flow-control.dev/install-nightly.ps1" | Invoke-Expression +``` + +Install the latest nightly build with pdb debug symbol files: + +``` +Invoke-RestMethod "https://flow-control.dev/install-debug.ps1" | Invoke-Expression +``` + +The Windows installer will also install itself as `update-flow.ps1` so you can just +run `update-flow` in a terminal to update to the latest release or nightly. + + ### Prebuilt Binaries - Stable: [Releases](https://github.com/neurocyte/flow/releases/latest) - Nightly: [Nightly Builds](https://github.com/neurocyte/flow-nightly/releases/latest) diff --git a/zine.ziggy b/zine.ziggy index 566ea4e..4736356 100644 --- a/zine.ziggy +++ b/zine.ziggy @@ -8,6 +8,7 @@ Site { "install", "install.ps1", "install-nightly.ps1", + "install-debug.ps1", "public.gpg", "fonts/AcPlus_IBM_VGA_9x16.ttf", "fonts/Iosevka-Regular.woff2",