Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,55 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ── Job 2d: Windows x64 portable zip ──────────────────────────────────────
windows-x64:
name: Windows (x64)
needs: source-tarball
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DHAWKEYE_VERSION=${{ needs.source-tarball.outputs.version }}

- name: Build
run: cmake --build build --config Release

- name: Stage release
shell: pwsh
run: |
$version = "${{ needs.source-tarball.outputs.version }}"
$stage = "hawkeye-$version-windows-x64"
New-Item -ItemType Directory -Path $stage | Out-Null
Copy-Item "build\Release\hawkeye.exe" $stage
Copy-Item -Recurse "build\Release\models" $stage
Copy-Item -Recurse "build\Release\shaders" $stage
Copy-Item -Recurse "build\Release\fonts" $stage
Copy-Item -Recurse "build\Release\textures" $stage
Copy-Item -Recurse "build\Release\themes" $stage
Copy-Item "LICENSE" $stage
Copy-Item "README.md" $stage
Compress-Archive -Path $stage -DestinationPath "$stage.zip"

- name: Smoke test
shell: pwsh
run: |
$exe = "build\Release\hawkeye.exe"
if (-not (Test-Path $exe)) { throw "hawkeye.exe not produced" }
& $exe --help
if ($LASTEXITCODE -ne 0) { throw "hawkeye --help exited $LASTEXITCODE" }

- name: Upload zip to release
shell: pwsh
run: |
$version = "${{ needs.source-tarball.outputs.version }}"
gh release upload ${{ github.ref_name }} "hawkeye-$version-windows-x64.zip"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# ── Job 3: Update Homebrew tap ─────────────────────────────────────────────
update-tap:
name: Update Homebrew tap
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ Download the `.deb` from the [latest release](https://github.com/PX4/Hawkeye/rel
sudo dpkg -i hawkeye-*.deb
```

### Windows and source builds
### Windows

Download `hawkeye-<version>-windows-x64.zip` from the [latest release](https://github.com/PX4/Hawkeye/releases/latest), extract it anywhere, and run `hawkeye.exe`.

On first launch, Windows SmartScreen may warn that the binary is from an unknown publisher — click "More info" → "Run anyway". The ZIP is unsigned; we're working on winget distribution to remove this warning.

### Source builds

See [Building from source](https://px4.github.io/Hawkeye/developer/build) in the developer docs.

Expand Down
4 changes: 2 additions & 2 deletions docs/developer/build.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Building from source

You only need to build from source if you want to modify Hawkeye, run pre-release code, or target a platform without a package (currently Windows).
For everyday use, the Homebrew formula or `.deb` package described in [Installation](../installation.md) is the faster path.
You only need to build from source if you want to modify Hawkeye or run pre-release code.
For everyday use, the Homebrew formula, `.deb` package, or Windows ZIP described in [Installation](../installation.md) is the faster path.

::: info
Clone with `--recursive`.
Expand Down
14 changes: 11 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Installation

Hawkeye ships as a Homebrew formula on macOS and a `.deb` package on Debian/Ubuntu.
For Windows, or if you want the latest development build, see [Building from source](./developer/build.md).
Hawkeye ships as a Homebrew formula on macOS, a `.deb` package on Debian/Ubuntu, and a portable ZIP on Windows.
If you want the latest development build, see [Building from source](./developer/build.md).

## macOS (Homebrew)

Expand Down Expand Up @@ -29,7 +29,15 @@ ARM64 builds (Raspberry Pi, Jetson, cloud ARM instances) are published in the sa

## Windows

No prebuilt Windows package yet. Follow [Building from source](./developer/build.md) for the full procedure (Visual Studio 2022 + CMake + Git).
Download `hawkeye-<version>-windows-x64.zip` from the [Hawkeye releases page](https://github.com/PX4/Hawkeye/releases/latest), extract it anywhere (e.g. `C:\Tools\hawkeye`), and double-click `hawkeye.exe`.

The ZIP is self-contained — no Visual Studio or runtime installer required. User data (screenshots, markers) is written to `%APPDATA%\hawkeye`.

::: info First-launch warning
Windows SmartScreen may warn that `hawkeye.exe` is from an unknown publisher. Click "More info" → "Run anyway". The binary is unsigned; signing and winget distribution are on the roadmap.
:::

To launch from any terminal, add the extracted folder to your `PATH`.

## Verifying the install

Expand Down
25 changes: 22 additions & 3 deletions src/asset_path.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#ifdef _WIN32
#include <direct.h>
#include <windows.h>
#define mkdir_p(path) _mkdir(path)
#else
#include <unistd.h>
Expand Down Expand Up @@ -65,7 +66,13 @@ void asset_path_init(void) {
snprintf(s_user_data, sizeof(s_user_data),
"%s/Library/Application Support/hawkeye", home);
}
#elif !defined(_WIN32)
#elif defined(_WIN32)
const char *appdata = getenv("APPDATA");
if (appdata && appdata[0]) {
snprintf(s_user_data, sizeof(s_user_data),
"%s\\hawkeye", appdata);
}
#else
// Linux: XDG_DATA_HOME or ~/.local/share
const char *xdg = getenv("XDG_DATA_HOME");
if (xdg && xdg[0]) {
Expand All @@ -80,8 +87,20 @@ void asset_path_init(void) {
}
#endif

// Compile-time install prefix (set by CMake)
#ifdef HAWKEYE_INSTALL_DATADIR
#ifdef _WIN32
// On Windows we ship a portable ZIP: assets live next to hawkeye.exe,
// so resolve the install dir from the running executable rather than a
// compile-time CMake path (which encodes a Unix-style /usr layout).
char exe_path[MAX_PATH];
DWORD len = GetModuleFileNameA(NULL, exe_path, sizeof(exe_path));
if (len > 0 && len < sizeof(exe_path)) {
char *last_sep = strrchr(exe_path, '\\');
if (last_sep) {
*last_sep = '\0';
snprintf(s_install_data, sizeof(s_install_data), "%s", exe_path);
}
}
#elif defined(HAWKEYE_INSTALL_DATADIR)
snprintf(s_install_data, sizeof(s_install_data),
"%s", HAWKEYE_INSTALL_DATADIR);
#endif
Expand Down
15 changes: 9 additions & 6 deletions src/asset_path.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ void asset_path_init(void);

// Resolve an asset subpath (e.g. "models/px4_quadrotor.obj") to a full path.
// Writes into caller-provided buffer. Search order:
// macOS: ~/Library/Application Support/hawkeye/<subpath>
// Linux: $XDG_DATA_HOME/hawkeye/<subpath>
// Then: HAWKEYE_INSTALL_DATADIR/<subpath> (compile-time install prefix)
// Then: ./<subpath> (dev/build fallback)
// macOS: ~/Library/Application Support/hawkeye/<subpath>
// Linux: $XDG_DATA_HOME/hawkeye/<subpath>
// Windows: %APPDATA%\hawkeye\<subpath>
// Then: HAWKEYE_INSTALL_DATADIR/<subpath> (Unix install prefix)
// or <exe_dir>/<subpath> (Windows portable layout)
// Then: ./<subpath> (dev/build fallback)
void asset_path(const char *subpath, char *out, size_t out_size);

// Get a writable path for an asset (for generated files like terrain texture).
// Always returns the user data directory path, creating directories as needed.
// macOS: ~/Library/Application Support/hawkeye/<subpath>
// Linux: $XDG_DATA_HOME/hawkeye/<subpath>
// macOS: ~/Library/Application Support/hawkeye/<subpath>
// Linux: $XDG_DATA_HOME/hawkeye/<subpath>
// Windows: %APPDATA%\hawkeye\<subpath>
void asset_write_path(const char *subpath, char *out, size_t out_size);

#endif
Loading