Skip to content

Commit 1e4cfaa

Browse files
improve install instructions
1 parent f6af6ff commit 1e4cfaa

File tree

7 files changed

+88
-17
lines changed

7 files changed

+88
-17
lines changed

README.md

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,94 @@ PICO-8 powered games launcher for the [PeX Console](https://pex-labs.com/)
4646

4747
## Getting started
4848

49-
**PicoLauncher** requires an installed version of PICO-8 (if you don't have it, you can buy it [here](https://www.lexaloffle.com/pico-8.php?#getpico8)). You can either use a pre-compiled version from the latest [release]() or build this project from source.
49+
**PicoLauncher** requires an installed version of PICO-8 (if you don't have it, you can buy it [here](https://www.lexaloffle.com/pico-8.php?#getpico8)). You can either use a pre-compiled version from the [latest release](https://github.com/pex-labs/picolauncher/releases/latest) or build this project from source.
5050

51-
### Pre-compiled
51+
### Linux
5252

53-
Download the pre-compiled release for your platform and unzip it. You will then find executables for all supported platforms. The `drive/` directory will be where the PICO-8 data files will be stored. For now, you can only run **PicoLauncher** from the same directory as the executables.
53+
<details>
54+
<summary>click to expand</summary>
55+
<div>
56+
Download the latest pre-compiled binary titled `picolauncher-linux-x86_64.zip`. The unzip and navigate to the directory
57+
```sh
58+
unzip picolauncher-linux-x86_64.zip
59+
cd picolauncher-linux-x86_64/
60+
```
5461

55-
On windows, if your PICO-8 binary doesn't reside at the default location of `C:\Program Files (x86)\PICO-8\pico8.exe`, you need to set the environment variable `PICO8_BINARY` before launching.
62+
Next, ensure that `pico8` is included in your path. In your `.bashrc` or equivalent, add the line
5663
```sh
57-
set PICO8_BINARY=<path to pico8>
58-
picolauncher.exe
64+
export PATH="$PATH:<path to pico8 directory>"
65+
```
66+
For example
67+
```sh
68+
export PATH="$PATH:~/Downloads/pico-8/"
5969
```
6070

61-
On linux, if PICO-8 is not in your PATH, you need to set the environment variable as well.
71+
You can now run **PicoLauncher**:
6272
```sh
63-
PICO8_BINARY=<path to pico8>
6473
./picolauncher
6574
```
6675

76+
It is also possible to explicitly pass a binary to use to launch pico8 by setting the `PICO8_BINARY` environment variable:
77+
```sh
78+
PICO8_BINARY=<path to pico8 binary> ./picolauncher
79+
```
80+
For example
81+
```sh
82+
PICO8_BINARY=~/Downloads/pico-8/pico8 ./picolauncher
83+
```
84+
</div>
85+
</details>
86+
87+
### Raspberry Pi
88+
89+
<details>
90+
<summary>click to expand</summary>
91+
<div>
92+
First double check if you are running 64-bit or 32-bit Raspberry Pi OS.
93+
```sh
94+
uname -m
95+
```
96+
If the output of the above command is `aarch64`, you are 64-bit, and if the output is `armv7` or something similar, you are 32-bit.
97+
98+
In the case that you are 64-bit, you should download the latest pre-compiled binary titled `picolauncher-linux-aarch64.zip`. Otherwise, download `picolauncher-linux-armv7.zip`. Similar to the above instructions, unzip and enter the directory
99+
```sh
100+
unzip picolauncher-linux-aarch64.zip
101+
cd picolauncher-linux-aarch64/
102+
```
103+
104+
Once again, add the pico8 directory to your PATH environment variables in your `.bashrc` or equivalent:
105+
```sh
106+
export PATH="$PATH:<path to pico8 directory>"
107+
```
108+
109+
When launching **PicoLauncher** and supplying the binary explicitly, if you are on 64-bit Raspberry Pi, ensure that you are using the `pico8_64` binary.
110+
</div>
111+
</details>
112+
113+
114+
### Windows
115+
116+
<details>
117+
<summary>click to expand</summary>
118+
<div>
119+
Download the `picolauncher-windows.zip` zip file from the latest releases and unzip it. If your pico8 binary doesn't reside at the default location of `C:\Program Files (x86)\PICO-8\pico8.exe`, you need to set the environment variable `PICO8_BINARY` before launching.
120+
```sh
121+
set PICO8_BINARY=<path to pico8>
122+
picolauncher.exe
123+
```
124+
125+
You can also do this graphically. First search up 'Environment Variables' in your start menu.
126+
<img src="media/windows_install/step1.png" width=50%">
127+
Then in the 'System Properties' page, click the button titled 'Environment Variables...'
128+
<img src="media/windows_install/step2.png" width=50%">
129+
Locate the variable titled 'Path' and click the 'Edit' button.
130+
<img src="media/windows_install/step3.png" width=50%">
131+
Add a new path and set the value to the directory where you have installed pico8. If you used the windows installer for pico8, this should be set to `C:\Program Files (x86)\PICO-8\pico8.exe`
132+
<img src="media/windows_install/step4.png" width=50%">
133+
134+
</div>
135+
</details>
136+
67137
### Build from source
68138

69139
To build from source, you need to have a [rust toolchain](https://www.rust-lang.org/tools/install) installed. To build **PicoLauncher** for all platforms, there is a provided build script at `dev/scripts/build-linux-x86_64.sh`, `dev/scripts/build-windows.sh`, etc. The built files are present in the `build/build-<platform>` directory, as well as zipped up in `build-<platform>.zip`. This is the same build that is distributed in the pre-compiled release.

media/windows_install/step1.png

256 KB
Loading

media/windows_install/step2.png

133 KB
Loading

media/windows_install/step3.png

242 KB
Loading

media/windows_install/step4.png

106 KB
Loading

src/hal/windows.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ pub fn open_in_pipe() -> anyhow::Result<File> {
103103
}
104104
}
105105

106+
// search start menu for pico8.exe
107+
pub fn locate_pico8_binary() {
108+
// TODO traverse start menu directory, find pico8.exe
109+
// TODO resolve .lnk file to get actual location of pico8 binary
110+
}
111+
106112
/*
107113
pub fn open_out_pipe() -> anyhow::Result<File> {
108114
let mut file = OpenOptions::new()

src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@ mod consts;
22
mod hal;
33
mod p8util;
44

5-
use std::process::Stdio;
65
use std::thread; // TODO maybe switch to async
76
use std::{
87
collections::HashMap,
98
fs::{read_dir, read_to_string, File, OpenOptions},
109
io::{BufRead, BufReader, Read, Write},
1110
path::{Path, PathBuf},
12-
process::{Child, Command},
11+
process::{Child, Command, Stdio},
1312
ptr,
1413
time::Duration,
1514
};
16-
use log::{debug, error, warn, info};
1715

1816
use anyhow::anyhow;
1917
use consts::*;
2018
use hal::*;
19+
use log::{debug, error, info, warn};
2120
use notify::event::CreateKind;
2221
use notify_debouncer_full::{new_debouncer, notify::*, DebounceEventResult};
2322
use p8util::*;
@@ -76,7 +75,7 @@ fn screenshot_watcher() {
7675

7776
info!("screenshot watcher registered");
7877

79-
loop {}
78+
loop {} // TODO this might consume a lot of cpu?
8079
}
8180

8281
/// Attempts to spawn pico8 binary by trying multiple potential binary names depending on the
@@ -106,11 +105,8 @@ pub fn launch_pico8_binary(bin_names: Vec<String>) -> anyhow::Result<Child> {
106105
}
107106

108107
fn main() {
109-
110108
// set up logger
111-
env_logger::builder()
112-
.format_timestamp(None)
113-
.init();
109+
env_logger::builder().format_timestamp(None).init();
114110

115111
// set up screenshot watcher process
116112
let screenshot_handle = thread::spawn(|| {
@@ -264,7 +260,6 @@ fn main() {
264260
},
265261
"sys" => {
266262
// Get system information like operating system, etc
267-
268263
},
269264
_ => {
270265
warn!("unhandled command");

0 commit comments

Comments
 (0)