Skip to content

Commit 88f2be8

Browse files
authored
Merge pull request 0LNetworkCommunity#143 from codilion/windows-installation
simplify the Windows binary installation guide
2 parents 08d85fa + 75add8b commit 88f2be8

1 file changed

Lines changed: 80 additions & 25 deletions

File tree

docs/getting-started/install-open-libra-cli/install-open-libra-cli-binaries.md

Lines changed: 80 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -158,52 +158,107 @@ The pre-built binaries require Ubuntu 24.04. For older versions:
158158
:::
159159

160160
</TabItem>
161+
162+
163+
161164
<TabItem value="windows" label="Windows">
162165

163-
### Native Windows
166+
> **Assumption:** You have downloaded **`libra-windows-x64.exe`** into **`C:\Users\<you>\Downloads`**.
167+
168+
### TL;DR — One‑liner
169+
170+
You can set up `libra` in one step. Paste the following commands into the `PowerShell` application, press Enter, and wait for the version output to confirm success:
171+
172+
```powershell
173+
mkdir "$HOME\bin" -ErrorAction SilentlyContinue; `
174+
Move-Item "$HOME\Downloads\libra-windows-x64.exe" "$HOME\bin\libra.exe" -Force; `
175+
setx PATH "$($Env:PATH);$HOME\bin"; `
176+
$Env:PATH += ";$HOME\bin"; `
177+
libra version
178+
```
179+
What it does:
180+
- **Create `$HOME\bin`** if it does not exist.
181+
- **Move and rename** the downloaded file to `$HOME\bin\libra.exe`.
182+
- **Update your `PATH`** permanently so Windows can find `libra` in any new session.
183+
- **Refresh `PATH`** for the current window so you can use `libra` immediately.
184+
- **Verify** by printing the installed version.
164185

165-
1. **Create directory for binary**:
186+
You should see output like:
187+
188+
```
189+
LIBRA VERSION 8.0.7
190+
build timestamp: 2025-06-04T...
191+
```
192+
193+
<br/>
194+
195+
### Step‑by‑Step guide
196+
197+
1. **Create a personal `bin` folder**
198+
This folder will hold your local executables and allow you to run them from anywhere.
166199
```powershell
167-
mkdir %HOMEPATH%\bin
200+
mkdir "$HOME\bin"
168201
```
169202

170-
2. **Copy and rename**:
203+
2. **Move and rename the binary**
204+
Place the downloaded file into your new folder and give it a simple name.
171205
```powershell
172-
copy "Downloads\libra-windows-x64.exe" %HOMEPATH%\bin\libra.exe
206+
Move-Item "$HOME\Downloads\libra-windows-x64.exe" "$HOME\bin\libra.exe"
173207
```
174208

175-
3. **Add to PATH**:
176-
- Open System Properties → Advanced → Environment Variables
177-
- Add `%HOMEPATH%\bin` to your PATH variable
178-
- Or via command line:
209+
3. **Add the folder to your `PATH` (permanent)**
210+
This makes `libra` available in any future PowerShell window.
179211
```powershell
180-
setx PATH "%PATH%;%HOMEPATH%\bin"
212+
setx PATH "$($Env:PATH);$HOME\bin"
181213
```
214+
:::caution
215+
This updates the system registry but does not change the `PATH` in the current session.
216+
:::
182217

183-
4. **Verify installation**:
218+
4. **Apply the new `PATH` to this session**
219+
So you don’t need to close and reopen PowerShell.
184220
```powershell
185-
libra version
221+
$Env:PATH += ";$HOME\bin"
186222
```
187223

188-
### Windows Subsystem for Linux (WSL2)
224+
5. **Verify the installation**
225+
Run the version command to confirm that `libra` is installed correctly.
226+
```powershell
227+
libra version # or: libra --help
228+
```
189229

190-
:::tip WSL2 Users
191-
For WSL2, use the Linux binary:
192-
1. Download the Linux binary (not Windows)
193-
2. Follow the Linux installation steps above
194-
:::
230+
If everything is configured, you’ll see `libra` print its version information.
231+
232+
---
233+
234+
---
235+
236+
## Windows Subsystem for Linux (WSL2)
237+
238+
:::tip WSL2 users
239+
In WSL2, install as if on Linux:
240+
241+
1. Download the **Linux** version into your WSL distro.
242+
2. Follow the Linux installation steps provided in this guide.
243+
:::
195244

196245
</TabItem>
246+
247+
197248
</Tabs>
198249

199250
## Troubleshooting
200251

201252
### Common Issues
202253

203-
| Problem | Solution |
204-
|---------|----------|
205-
| "command not found" | Ensure the binary location is in your PATH |
206-
| "Permission denied" | Make the file executable: `chmod +x libra` |
207-
| "cannot execute binary file" | Wrong architecture - check your system architecture |
208-
| OpenSSL errors | Install OpenSSL for your platform |
209-
| "bad CPU type" (macOS) | Download the correct architecture (x64 vs arm64) |
254+
| Symptom | Likely Cause | Resolution |
255+
|---------------------------------------------|------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------|
256+
| `"command not found"` | Binary location is not in your `PATH` | Ensure the binary location is in your `PATH` |
257+
| `"Permission denied"` | File is not marked as executable | Run `chmod +x libra` to make the file executable |
258+
| `"cannot execute binary file"` | Downloaded binary does not match your system architecture | Check your system architecture and download the correct binary |
259+
| `OpenSSL errors` | OpenSSL is missing or not properly installed | Install or update OpenSSL for your platform |
260+
| `"bad CPU type"` (macOS) | Binary was built for the wrong CPU architecture | Download the correct architecture (x64 vs. arm64) |
261+
| `libra : The term 'libra' is not recognized…` | Current PowerShell session has not picked up the updated `PATH` | Open a new PowerShell window, or run step 4 to refresh `PATH` in the current session |
262+
| Path appears as `C:\Users\win\Downloads\%HOMEPATH%\bin` | `%HOMEPATH%` was used instead of `$HOME` or `%USERPROFILE%` (lacks drive letter) | Re-run steps 1–3 using `$HOME` (PowerShell) or `%USERPROFILE%` (cmd) |
263+
| Need to type `.\libra.exe` instead of `libra` | Windows does not execute files from the current directory by default | Ensure `$HOME\bin` is in your `PATH`; then running `libra` will work without `.\` |
264+

0 commit comments

Comments
 (0)