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
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
[Docs Health](https://github.com/Brain-Modulation-Lab/DBSAnnotator/actions/workflows/docs-health.yml)
[Release Drafter](https://github.com/Brain-Modulation-Lab/DBSAnnotator/actions/workflows/release-drafter.yml)

A desktop application for annotating Deep Brain Stimulation (DBS) clinical programming sessions. Built for clinicians and researchers working with DBS systems (Medtronic Percept and others).
A desktop application for annotating Deep Brain Stimulation (DBS) programming sessions. Built for clinicians and researchers working with DBS systems.

**Version:** derived from `dbs_annotator.__version__`
**Publisher:** Wyss Center for Bio and Neuroengineering (contact: [lucia.poma@wysscenter.ch](mailto:lucia.poma@wysscenter.ch))

## For End Users

Releases ship as **Briefcase-generated** artifacts (for example ZIP/MSI on Windows and DMG on macOS). Follow the instructions for the artifact you downloaded.
You can find installation files for Windows (.msi), MacOS (.dmg) and Linux (.deb) under the [GitHub Releases](https://github.com/Brain-Modulation-Lab/DBSAnnotator/releases).
However, note that the files are unsigned, so that a warning might pop up during installation. To proceed with installation, you must accept the risk and continue.
In some cases, for example where your organization has strict settings, this might not be possible. In this case, try the install via PowerShell below.

### Windows — install from GitHub (PowerShell)
### Windows — install via PowerShell

Unsigned **MSI** can trigger **SmartScreen**; the release **portable `.zip`** (same app as the MSI) avoids the MSI path. When that `.zip` is attached to a release, you can install per-user under `%LOCALAPPDATA%\WyssGeneva\DBSAnnotator\app` and get a Start Menu shortcut with one line (from PowerShell; for a branch other than `main`, replace `main` in the URL):

**Note:** `iex` only passes its own parameters — script switches (for example ``-VersionTag v0.4.0a2``) are not the same call. For parameters, use a local copy of `scripts/install.ps1` or: ``& ([scriptblock]::Create((iwr -UseBasicParsing -UserAgent "DBSAnnotator-Install/1" -Uri "https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.ps1").Content)) -VersionTag v0.4.0a2``.
In an **open PowerShell** window:

```powershell
iex (iwr -UseBasicParsing -UserAgent "DBSAnnotator-Install/1" -Uri "https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.ps1").Content
irm https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.ps1 | iex
```

**No Start Menu shortcut:** set ``$env:DBS_ANNOTATOR_NO_START_MENU = "1"`` before the line above, or run with ``-NoStartMenuShortcut`` when using a script block / local `install.ps1`.
From **cmd.exe** (or if execution policy blocks scripts):

The script picks the **newest** release that includes a `DBSAnnotator-*.zip` file (prereleases included). If your release has no `.zip` yet, tag again after [CD](.github/workflows/release.yml) has uploaded it, or use `-VersionTag vX.Y.Z` once that asset exists.
```bat
powershell -ExecutionPolicy Bypass -NoProfile -Command "irm https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.ps1 | iex"
```

### macOS / Linux — shell install (curl / wget)

When the release includes **raw** `.tar.gz` bundles (from CD) or a `.deb` / `.dmg`, you can install from the repo script (uses [GitHub Releases](https://github.com/Brain-Modulation-Lab/DBSAnnotator/releases); override repo with `DBS_ANNOTATOR_INSTALL_REPO` if needed):

```sh
curl -LsSf https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.sh | sh
Expand All @@ -39,11 +39,6 @@ curl -LsSf https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/m
wget -qO- https://raw.githubusercontent.com/Brain-Modulation-Lab/DBSAnnotator/main/scripts/install.sh | sh
```

Pin a tag: `DBS_ANNOTATOR_VERSION=v0.4.0a1 sh` or `./install.sh v0.4.0a1`. Preview only: `sh install.sh --dry-run`.

- **Linux x86_64:** prefers `dbs-annotator_*_linux_x86_64-raw.tar.gz` (installs under `~/.local/lib/dbs-annotator` and symlinks `~/.local/bin/dbs-annotator`); otherwise `sudo dpkg -i` on the `.deb`.
- **macOS (arm64 CI build):** prefers `DBSAnnotator-*-macos-arm64-raw.tar.gz` into `/Applications` or `~/Applications`; otherwise copies from the `.dmg`.

## What It Does

The application guides you through a DBS programming session in three steps:
Expand Down
10 changes: 5 additions & 5 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ Steps
b. Double-click to launch — no further steps needed.

4. **GitHub release with portable** ``.zip`` **(``DBSAnnotator-*.zip``):** to install
without using the unsigned MSI, run ``scripts/install.ps1`` (see the README
``iex`` one-liner). Script parameters (for example ``-VersionTag``) need a local
file or ``& ([scriptblock]::Create((iwr …).Content)) …``. It unpacks under
without using the unsigned MSI, use the README one-liner
(``irm https://…/install.ps1 | iex``) or a saved copy of ``scripts/install.ps1``
(use parameters such as ``-VersionTag`` only when you run a local file or a
script block; see the README). It unpacks under
``%LOCALAPPDATA%\\WyssGeneva\\DBSAnnotator\\app`` and adds a Start Menu
shortcut unless you set ``DBS_ANNOTATOR_NO_START_MENU`` or pass
``-NoStartMenuShortcut``.
shortcut.

.. note::
The first launch may take 5–10 seconds while Windows extracts bundled
Expand Down
1 change: 1 addition & 0 deletions newsfragments/78.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Simplify `install.ps1` and update README.
35 changes: 13 additions & 22 deletions scripts/install.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#Requires -Version 5.1
# Fetches DBSAnnotator-*.zip from GitHub Releases; installs to %LOCALAPPDATA%\WyssGeneva\DBSAnnotator\app.
# Optional: DBS_ANNOTATOR_NO_START_MENU=1 (truthy: 1, true, yes). Repo: DBS_ANNOTATOR_INSTALL_REPO.
# DBSAnnotator-*.zip from GitHub Releases → %LOCALAPPDATA%\WyssGeneva\DBSAnnotator\app + Start Menu shortcut. Override repo: DBS_ANNOTATOR_INSTALL_REPO.
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")]
param(
[string] $GitHubRepository = $(
if ($env:DBS_ANNOTATOR_INSTALL_REPO) { $env:DBS_ANNOTATOR_INSTALL_REPO } else { "Brain-Modulation-Lab/DBSAnnotator" }
),
[string] $VersionTag = "",
[string] $InstallRoot = "",
[switch] $NoStartMenuShortcut
[string] $InstallRoot = ""
)

Set-StrictMode -Version 3.0
Expand All @@ -21,14 +19,9 @@ function Install-DbsAnnotatorApp {
if ($env:DBS_ANNOTATOR_INSTALL_REPO) { $env:DBS_ANNOTATOR_INSTALL_REPO } else { "Brain-Modulation-Lab/DBSAnnotator" }
),
[string] $VersionTag = "",
[string] $InstallRoot = "",
[switch] $NoStartMenuShortcut
[string] $InstallRoot = ""
)

if ($env:DBS_ANNOTATOR_NO_START_MENU -match '^(1|true|yes)$') {
$NoStartMenuShortcut = $true
}

if ([string]::IsNullOrWhiteSpace($InstallRoot)) {
$InstallRoot = Join-Path $env:LOCALAPPDATA "WyssGeneva\DBSAnnotator\app"
}
Expand Down Expand Up @@ -92,7 +85,7 @@ set -VersionTag to a tag that has the .zip, or add the .zip to the release manua
Write-Host "Asset: $($asset.name) ($([math]::Round($asset.size / 1MB, 1)) MB)"
Write-Host "Install: $InstallRoot"
if ($WhatIfPreference) {
Write-Host "What if: would download, extract, copy files, add Start Menu shortcut (unless -NoStartMenuShortcut)."
Write-Host "What if: would download, extract, copy files, add Start Menu shortcut."
return
}
if (-not $PSCmdlet.ShouldProcess($InstallRoot, "Install DBSAnnotator (overwrite if present)")) {
Expand Down Expand Up @@ -129,17 +122,15 @@ set -VersionTag to a tag that has the .zip, or add the .zip to the release manua
}
$exe = Get-ChildItem -LiteralPath $InstallRoot -Recurse -Filter "DBSAnnotator.exe" -ErrorAction SilentlyContinue | Select-Object -First 1
if (-not $exe) { throw "DBSAnnotator.exe not found under $InstallRoot after install." }
if (-not $NoStartMenuShortcut) {
if ($PSCmdlet.ShouldProcess("Start Menu programs", "Create DBSAnnotator shortcut")) {
$programs = [Environment]::GetFolderPath("Programs")
if (-not (Test-Path $programs)) { New-Item -ItemType Directory -Path $programs -Force | Out-Null }
$wsh = New-Object -ComObject WScript.Shell
$lnk = $wsh.CreateShortcut((Join-Path $programs "DBSAnnotator.lnk"))
$lnk.TargetPath = $exe.FullName
$lnk.WorkingDirectory = $exe.DirectoryName
$lnk.IconLocation = $exe.FullName
$lnk.Save() | Out-Null
}
if ($PSCmdlet.ShouldProcess("Start Menu programs", "Create DBSAnnotator shortcut")) {
$programs = [Environment]::GetFolderPath("Programs")
if (-not (Test-Path $programs)) { New-Item -ItemType Directory -Path $programs -Force | Out-Null }
$wsh = New-Object -ComObject WScript.Shell
$lnk = $wsh.CreateShortcut((Join-Path $programs "DBSAnnotator.lnk"))
$lnk.TargetPath = $exe.FullName
$lnk.WorkingDirectory = $exe.DirectoryName
$lnk.IconLocation = $exe.FullName
$lnk.Save() | Out-Null
}
Write-Host "Done. Run: $($exe.FullName)"
} finally {
Expand Down
Loading