Skip to content

Commit

Permalink
Fix "Close REAPER" confirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed May 14, 2024
1 parent 2f5666a commit 6da0d0b
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
dest: 'ReaBoot-macos-x86_64.zip'
- platform: 'windows-latest'
args: '--bundles msi,nsis'
src: 'target/release/reaboot.exe'
src: 'target/release/ReaBoot.exe'
dest: 'ReaBoot-windows-x64.exe'
- platform: 'ubuntu-22.04' # for Tauri v1 you could replace this with ubuntu-20.04.
args: '--bundles deb'
src: 'target/release/bundle/deb/reaboot_*_amd64.deb'
src: 'target/release/bundle/deb/ReaBoot_*_amd64.deb'
dest: 'ReaBoot-linux-x86_64.deb'

runs-on: ${{ matrix.settings.platform }}
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
if: matrix.settings.platform == 'windows-latest'
shell: bash
run: |
mv target/release/bundle/msi/reaboot_*_x64_en-US.msi "./release-assets/ReaBoot-windows-x64-setup.msi"
mv target/release/bundle/nsis/reaboot_*_x64-setup.exe "./release-assets/ReaBoot-windows-x64-setup.exe"
mv target/release/bundle/msi/ReaBoot_*_x64_en-US.msi "./release-assets/ReaBoot-windows-x64-setup.msi"
mv target/release/bundle/nsis/ReaBoot_*_x64-setup.exe "./release-assets/ReaBoot-windows-x64-setup.exe"
- name: Check if release exists
id: check_release
Expand Down
30 changes: 26 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,29 @@

ReaBoot is a convenient all-in-one online installer for REAPER, ReaPack and arbitrary packages.

## Development
User docs are available at https://reaboot.com.

More dev docs coming soon. User docs are available at https://reaboot.com.
## Development of GUI installer

See Tauri v1 docs for details.

### Start frontend and backend

I always start frontend and backend separately because I use different IDEs.

Frontend:

```sh
cd gui
npm run dev
```

Backend:

```sh
cd gui
cargo run --bin reaboot-gui
```

### Regenerate TypeScript and JsonSchema type definitions

Expand All @@ -28,9 +48,11 @@ Do this after changing `commons/src/reaboot-logo.svg`:
2. Commit and push
3. `git tag vX.Y.Z`
4. `git push origin vX.Y.Z`
5. Wait for release draft to be built via GitHub Actions (https://github.com/helgoboss/reaboot/actions)
5. Wait for release draft to be built via GitHub
Actions (https://github.com/helgoboss/reaboot/actions)
6. Publish release draft `https://github.com/helgoboss/reaboot/releases`
7. Adjust `LATEST_REABOOT_VERSION` in `website` project (so that ReaBoot website refers to latest downloads)
7. Adjust `LATEST_REABOOT_VERSION` in `website` project (so that ReaBoot website refers to latest
downloads)

### Publish website changes

Expand Down
34 changes: 23 additions & 11 deletions core/src/installer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,28 +168,30 @@ impl<L: InstallerListener> Installer<L> {
let (successful_downloads, download_errors) =
weed_out_download_errors(package_download_results);
// Prepare and simulate installation
let mut num_simulation_failures = 0;
let mut num_tries = 0;
let (package_installation_plans, temp_install_failures) = loop {
let enough_tries = num_tries >= 2;
let simulation_future = self.prepare_and_simulate_installation(
&downloaded_indexes,
successful_downloads.clone(),
&package_status_quo.installed_packages_to_be_replaced,
&first_plan.installed_packages_to_be_removed,
);
match simulation_future.await {
Ok(tuple) => break tuple,
Ok((plans, failures)) => {
if failures.is_empty() || enough_tries {
break (plans, failures);
} else {
num_tries += 1;
self.prompt_user_to_exit_reaper(&mut interactions).await;
}
}
Err(error) => {
num_simulation_failures += 1;
if num_simulation_failures > 1 {
if enough_tries {
return Err(error.into());
}
let confirmation_request = ConfirmationRequest {
message: "It looks like REAPER is currently running. If it is, please close it before pressing \"Continue\"!".to_string(),
yes_label: "Continue".to_string(),
no_label: None,
};
self.listener.confirm(confirmation_request);
let _ = interactions.recv().await;
num_tries += 1;
self.prompt_user_to_exit_reaper(&mut interactions).await;
}
}
};
Expand Down Expand Up @@ -249,6 +251,16 @@ impl<L: InstallerListener> Installer<L> {
Ok(outcome)
}

async fn prompt_user_to_exit_reaper(&self, interactions: &mut Receiver<bool>) {
let confirmation_request = ConfirmationRequest {
message: "It looks like REAPER is currently running. If it is, please close it before pressing \"Continue\"!".to_string(),
yes_label: "Continue".to_string(),
no_label: None,
};
self.listener.confirm(confirmation_request);
let _ = interactions.recv().await;
}

fn clean_up(self) {
// If the user didn't provide a custom temp parent dir, it's "REAPER_RESOURCE_DIR/ReaBoot".
// This directory is going to be empty if the user or installer didn't decide to keep it.
Expand Down

0 comments on commit 6da0d0b

Please sign in to comment.