Skip to content

Commit

Permalink
#7 Refuse to run if macOS version < 11
Browse files Browse the repository at this point in the history
  • Loading branch information
helgoboss committed Dec 3, 2024
1 parent b9279e0 commit 2af234f
Show file tree
Hide file tree
Showing 10 changed files with 273 additions and 8 deletions.
51 changes: 50 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ tauri-plugin-process = "2"
tauri-plugin-shell = "2"
tauri-plugin-clipboard-manager = "2.0.2"
tauri-plugin-dialog = "2"
tauri-plugin-os = "2.0.1"

[profile.release]
# Those are the settings recommended on https://tauri.app/v1/guides/building/app-size/.
Expand Down
1 change: 1 addition & 0 deletions gui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@tauri-apps/api": "^2",
"@tauri-apps/plugin-clipboard-manager": "^2.0.0",
"@tauri-apps/plugin-dialog": "^2.0.1",
"@tauri-apps/plugin-os": "^2.0.0",
"@tauri-apps/plugin-process": "^2.0.0",
"@tauri-apps/plugin-shell": "^2.0.1",
"reaboot-commons": "^0.0.0",
Expand Down
9 changes: 5 additions & 4 deletions gui/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ reaboot-core.workspace = true
reaboot-reapack.workspace = true
# GUI framework
tauri = { workspace = true, features = ["devtools"] }
tauri-plugin-process.workspace = true
tauri-plugin-shell.workspace = true
tauri-plugin-clipboard-manager.workspace = true
tauri-plugin-dialog.workspace = true
tauri-plugin-os.workspace = true
# For (de)serializing commands and events
serde = { workspace = true, features = ["derive"] }
# For (de)serializing commands and events
Expand All @@ -34,10 +39,6 @@ ts-rs.workspace = true
markdown.workspace = true
# For getting a correctly removed temporary REAPER download directory
tempdir.workspace = true
tauri-plugin-process.workspace = true
tauri-plugin-shell.workspace = true
tauri-plugin-clipboard-manager.workspace = true
tauri-plugin-dialog.workspace = true

[features]
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!!
Expand Down
2 changes: 1 addition & 1 deletion gui/src-tauri/gen/schemas/acl-manifests.json

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions gui/src-tauri/gen/schemas/desktop-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,91 @@
"type": "string",
"const": "log:deny-log"
},
{
"description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n",
"type": "string",
"const": "os:default"
},
{
"description": "Enables the arch command without any pre-configured scope.",
"type": "string",
"const": "os:allow-arch"
},
{
"description": "Enables the exe_extension command without any pre-configured scope.",
"type": "string",
"const": "os:allow-exe-extension"
},
{
"description": "Enables the family command without any pre-configured scope.",
"type": "string",
"const": "os:allow-family"
},
{
"description": "Enables the hostname command without any pre-configured scope.",
"type": "string",
"const": "os:allow-hostname"
},
{
"description": "Enables the locale command without any pre-configured scope.",
"type": "string",
"const": "os:allow-locale"
},
{
"description": "Enables the os_type command without any pre-configured scope.",
"type": "string",
"const": "os:allow-os-type"
},
{
"description": "Enables the platform command without any pre-configured scope.",
"type": "string",
"const": "os:allow-platform"
},
{
"description": "Enables the version command without any pre-configured scope.",
"type": "string",
"const": "os:allow-version"
},
{
"description": "Denies the arch command without any pre-configured scope.",
"type": "string",
"const": "os:deny-arch"
},
{
"description": "Denies the exe_extension command without any pre-configured scope.",
"type": "string",
"const": "os:deny-exe-extension"
},
{
"description": "Denies the family command without any pre-configured scope.",
"type": "string",
"const": "os:deny-family"
},
{
"description": "Denies the hostname command without any pre-configured scope.",
"type": "string",
"const": "os:deny-hostname"
},
{
"description": "Denies the locale command without any pre-configured scope.",
"type": "string",
"const": "os:deny-locale"
},
{
"description": "Denies the os_type command without any pre-configured scope.",
"type": "string",
"const": "os:deny-os-type"
},
{
"description": "Denies the platform command without any pre-configured scope.",
"type": "string",
"const": "os:deny-platform"
},
{
"description": "Denies the version command without any pre-configured scope.",
"type": "string",
"const": "os:deny-version"
},
{
"description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n",
"type": "string",
Expand Down
85 changes: 85 additions & 0 deletions gui/src-tauri/gen/schemas/macOS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,91 @@
"type": "string",
"const": "log:deny-log"
},
{
"description": "This permission set configures which\noperating system information are available\nto gather from the frontend.\n\n#### Granted Permissions\n\nAll information except the host name are available.\n\n",
"type": "string",
"const": "os:default"
},
{
"description": "Enables the arch command without any pre-configured scope.",
"type": "string",
"const": "os:allow-arch"
},
{
"description": "Enables the exe_extension command without any pre-configured scope.",
"type": "string",
"const": "os:allow-exe-extension"
},
{
"description": "Enables the family command without any pre-configured scope.",
"type": "string",
"const": "os:allow-family"
},
{
"description": "Enables the hostname command without any pre-configured scope.",
"type": "string",
"const": "os:allow-hostname"
},
{
"description": "Enables the locale command without any pre-configured scope.",
"type": "string",
"const": "os:allow-locale"
},
{
"description": "Enables the os_type command without any pre-configured scope.",
"type": "string",
"const": "os:allow-os-type"
},
{
"description": "Enables the platform command without any pre-configured scope.",
"type": "string",
"const": "os:allow-platform"
},
{
"description": "Enables the version command without any pre-configured scope.",
"type": "string",
"const": "os:allow-version"
},
{
"description": "Denies the arch command without any pre-configured scope.",
"type": "string",
"const": "os:deny-arch"
},
{
"description": "Denies the exe_extension command without any pre-configured scope.",
"type": "string",
"const": "os:deny-exe-extension"
},
{
"description": "Denies the family command without any pre-configured scope.",
"type": "string",
"const": "os:deny-family"
},
{
"description": "Denies the hostname command without any pre-configured scope.",
"type": "string",
"const": "os:deny-hostname"
},
{
"description": "Denies the locale command without any pre-configured scope.",
"type": "string",
"const": "os:deny-locale"
},
{
"description": "Denies the os_type command without any pre-configured scope.",
"type": "string",
"const": "os:deny-os-type"
},
{
"description": "Denies the platform command without any pre-configured scope.",
"type": "string",
"const": "os:deny-platform"
},
{
"description": "Denies the version command without any pre-configured scope.",
"type": "string",
"const": "os:deny-version"
},
{
"description": "This permission set configures which\nprocess feeatures are by default exposed.\n\n#### Granted Permissions\n\nThis enables to quit via `allow-exit` and restart via `allow-restart`\nthe application.\n",
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions gui/src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ fn main() {
.plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_process::init())
.plugin(tauri_plugin_os::init())
.plugin(
tauri_plugin_log::Builder::default()
.level(LevelFilter::Info)
Expand Down
28 changes: 26 additions & 2 deletions gui/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
/* @refresh reload */
import { render } from "solid-js/web";
import {render} from "solid-js/web";

import "./styles.css";
import {App} from "./App";

render(() => <App />, document.getElementById("root") as HTMLElement);
import * as os from "@tauri-apps/plugin-os";
import * as process from "@tauri-apps/plugin-process";
import * as dialog from '@tauri-apps/plugin-dialog';

async function verifyOs() {
const minMacosVersion = "11";
const osType = os.type();
const osVersion = os.version();
if (osType === "macos" && osVersion < minMacosVersion) {
await dialog.message(
`Sorry, you can't run the installer on this machine. You have macOS ${osVersion} but the installer needs at least macOS ${minMacosVersion}.
No worries. You can always use ReaPack to install the desired REAPER packages! Just head back to the installation website and choose "Via ReaPack".`,
{
title: "Incompatible macOS version",
kind: "error",
okLabel: "Exit",
});
await process.exit(1);
}
}

await verifyOs();

render(() => <App/>, document.getElementById("root") as HTMLElement);
18 changes: 18 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2af234f

Please sign in to comment.