### Install and Run Project Source: https://v2.tauri.app/learn/splashscreen Commands to navigate to the project directory, install dependencies, and start the development environment. ```bash # Make sure you're in the right directorycd splashscreen-lab# Install dependenciespnpm install# Build and run the apppnpm tauri dev ``` -------------------------------- ### Define install script Source: https://v2.tauri.app/distribute/aur Example .install script for managing icon caches and desktop databases. ```bash post_install() { gtk-update-icon-cache -q -t -f usr/share/icons/hicolor update-desktop-database -q} post_upgrade() { post_install} post_remove() { gtk-update-icon-cache -q -t -f usr/share/icons/hicolor update-desktop-database -q} ``` -------------------------------- ### Start Development Server Commands Source: https://v2.tauri.app/start/create-project Commands to navigate to the project directory, install dependencies, and launch the development server based on the chosen package manager. ```bash cd tauri-app npm install npm run tauri dev ``` ```bash cd tauri-app yarn install yarn tauri dev ``` ```bash cd tauri-app pnpm install pnpm tauri dev ``` ```bash cd tauri-app deno install deno task tauri dev ``` ```bash cd tauri-app bun install bun tauri dev ``` ```bash cd tauri-app cargo install tauri-cli --version "^2.0.0" --locked cargo tauri dev ``` -------------------------------- ### Install snapcraft Source: https://v2.tauri.app/distribute/snapcraft Install the snapcraft tool using the classic confinement mode. ```bash sudo snap install snapcraft --classic ``` -------------------------------- ### Define RPM lifecycle scripts Source: https://v2.tauri.app/distribute/rpm Example content for pre/post install and remove scripts. ```bash echo "-------------"echo "This is pre"echo "Install Value: $1"echo "Upgrade Value: $1"echo "Uninstall Value: $1"echo "-------------" ``` ```bash echo "-------------"echo "This is post"echo "Install Value: $1"echo "Upgrade Value: $1"echo "Uninstall Value: $1"echo "-------------" ``` ```bash echo "-------------"echo "This is preun"echo "Install Value: $1"echo "Upgrade Value: $1"echo "Uninstall Value: $1"echo "-------------" ``` ```bash echo "-------------"echo "This is postun"echo "Install Value: $1"echo "Upgrade Value: $1"echo "Uninstall Value: $1"echo "-------------" ``` -------------------------------- ### Tauri initialization prompt example Source: https://v2.tauri.app/start/create-project Example of the interactive prompts displayed during the tauri init process. ```text ✔ What is your app name? tauri-app ✔ What should the window title be? tauri-app ✔ Where are your web assets located? .. ✔ What is the url of your dev server? http://localhost:5173 ✔ What is your frontend dev command? pnpm run dev ✔ What is your frontend build command? pnpm run build ``` -------------------------------- ### Sidecar Configuration Example Source: https://v2.tauri.app/develop/sidecar Example configuration showing how to reference binaries by filename in the shell API. ```json { "bundle": { "externalBin": ["binaries/app", "my-sidecar", "../scripts/sidecar"] }} ``` -------------------------------- ### Install Rust via winget Source: https://v2.tauri.app/start/prerequisites Use this command in PowerShell to install Rust on Windows. ```powershell winget install --id Rustlang.Rustup ``` -------------------------------- ### Initialize Plugin with Setup Hook Source: https://v2.tauri.app/develop/plugins Use the setup hook to register mobile plugins, manage state, or run background tasks during plugin initialization. ```rust use tauri::{Manager, plugin::Builder};use std::{collections::HashMap, sync::Mutex, time::Duration}; struct DummyStore(Mutex>); Builder::new("") .setup(|app, api| { app.manage(DummyStore(Default::default())); let app_ = app.clone(); std::thread::spawn(move || { loop { app_.emit("tick", ()); std::thread::sleep(Duration::from_secs(1)); } }); Ok(()) }) ``` -------------------------------- ### Backend setup and state management Source: https://v2.tauri.app/learn/splashscreen Rust implementation for managing setup state and spawning asynchronous tasks in the Tauri backend. ```rust // Import functionalities we'll be usinguse std::sync::Mutex;use tauri::async_runtime::spawn;use tauri::{AppHandle, Manager, State};use tokio::time::{sleep, Duration}; // Create a struct we'll use to track the completion of// setup related tasksstruct SetupState { frontend_task: bool, backend_task: bool,} // Our main entrypoint in a version 2 mobile compatible app#[cfg_attr(mobile, tauri::mobile_entry_point)]pub fn run() { // Don't write code before Tauri starts, write it in the // setup hook instead! tauri::Builder::default() // Register a `State` to be managed by Tauri // We need write access to it so we wrap it in a `Mutex` .manage(Mutex::new(SetupState { frontend_task: false, backend_task: false, })) // Add a command we can use to check .invoke_handler(tauri::generate_handler![greet, set_complete]) // Use the setup hook to execute setup related tasks // Runs before the main loop, so no windows are yet created .setup(|app| { // Spawn setup as a non-blocking task so the windows can be // created and ran while it executes spawn(setup(app.handle().clone())); // The hook expects an Ok result Ok(()) }) // Run the app .run(tauri::generate_context!()) .expect("error while running tauri application");} #[tauri::command]fn greet(name: String) -> String { format!("Hello {name} from Rust!")} ``` -------------------------------- ### Define allow-mkdir permission Source: https://v2.tauri.app/security/permissions Example permission enabling the directory creation command. ```toml [[permission]]identifier = "allow-mkdir"description = "This enables the mkdir command."commands.allow = [ "mkdir"] ``` -------------------------------- ### Install @sveltejs/adapter-static Source: https://v2.tauri.app/start/frontend/sveltekit Install the static adapter as a development dependency using your preferred package manager. ```bash npm install --save-dev @sveltejs/adapter-static ``` ```bash yarn add -D @sveltejs/adapter-static ``` ```bash pnpm add -D @sveltejs/adapter-static ``` ```bash deno add -D npm:@sveltejs/adapter-static ``` -------------------------------- ### Install LLVM and LLD on Linux Source: https://v2.tauri.app/distribute/windows-installer Install the LLD linker and LLVM tools on Ubuntu. ```bash sudo apt install lld llvm ``` -------------------------------- ### Install Rust via rustup Source: https://v2.tauri.app/start/prerequisites Use this command on Linux or macOS to install the Rust toolchain. ```bash curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh ``` -------------------------------- ### Install snapd on Fedora Source: https://v2.tauri.app/distribute/snapcraft Install snapd and enable classic snap support on Fedora systems. ```bash sudo dnf install snapd # Enable classic snap support sudo ln -s /var/lib/snapd/snap /snap ``` -------------------------------- ### Install WebKitGTK Development Libraries Source: https://v2.tauri.app/distribute/debian Install the required WebKitGTK development headers for specific ARM architectures. ```bash sudo apt install libwebkit2gtk-4.1-dev:armhf ``` ```bash sudo apt install libwebkit2gtk-4.1-dev:arm64 ``` -------------------------------- ### Install artifact-signing-cli Source: https://v2.tauri.app/distribute/sign/windows Install the required CLI tool using Cargo. ```shell cargo install artifact-signing-cli ``` -------------------------------- ### Install Selenium dependencies Source: https://v2.tauri.app/develop/tests/webdriver/example/selenium Commands to install the necessary testing packages using npm or yarn. ```bash npm install mocha chai selenium-webdriver ``` ```bash yarn add mocha chai selenium-webdriver ``` -------------------------------- ### Example resource file content Source: https://v2.tauri.app/develop/resources Sample JSON content for a bundled language file. ```json { "hello": "Guten Tag!", "bye": "Auf Wiedersehen!" } ``` -------------------------------- ### Configure System-Wide Installation Mode Source: https://v2.tauri.app/distribute/windows-installer Set the installMode to perMachine to require Administrator privileges and install the application system-wide. ```json { "bundle": { "windows": { "nsis": { "installMode": "perMachine" } } }} ``` -------------------------------- ### Debug Installation Issues Source: https://v2.tauri.app/distribute/rpm Commands to install or upgrade packages with verbose output for troubleshooting. ```bash rpm -ivvh package_name.rpm ``` ```bash rpm -Uvvh package_name.rpm ``` -------------------------------- ### Install base snap Source: https://v2.tauri.app/distribute/snapcraft Install the core22 base snap required for many snap packages. ```bash sudo snap install core22 ``` -------------------------------- ### Configure WebView2 Installation Modes Source: https://v2.tauri.app/distribute/windows-installer Set the webviewInstallMode in tauri.conf.json to control how the WebView2 runtime is handled during installation. ```json { "bundle": { "windows": { "webviewInstallMode": { "type": "downloadBootstrapper" } } }} ``` ```json { "bundle": { "windows": { "webviewInstallMode": { "type": "embedBootstrapper" } } }} ``` ```json { "bundle": { "windows": { "webviewInstallMode": { "type": "offlineInstaller" } } }} ``` ```json { "bundle": { "windows": { "webviewInstallMode": { "type": "skip" } } }} ``` -------------------------------- ### Install snapd on Arch Linux Source: https://v2.tauri.app/distribute/snapcraft Build and install snapd from the AUR on Arch Linux systems. ```bash sudo pacman -S --needed git base-devel git clone https://aur.archlinux.org/snapd.git cd snapd makepkg -si sudo systemctl enable --now snapd.socket sudo systemctl start snapd.socket sudo systemctl enable --now snapd.apparmor.service ``` -------------------------------- ### Define a Capability JSON Source: https://v2.tauri.app/security/capabilities Example of a capability file defining permissions for the main window. ```json { "$schema": "../gen/schemas/desktop-schema.json", "identifier": "main-capability", "description": "Capability for the main window", "windows": ["main"], "permissions": [ "core:path:default", "core:event:default", "core:window:default", "core:app:default", "core:resources:default", "core:menu:default", "core:tray:default", "core:window:allow-set-title" ]} ``` -------------------------------- ### Enable Installer Language Selector Source: https://v2.tauri.app/distribute/windows-installer Set displayLanguageSelector to true to prompt the user to select a language before the installer runs. ```json { "bundle": { "windows": { "nsis": { "displayLanguageSelector": true } } }} ``` -------------------------------- ### Test the Snap package Source: https://v2.tauri.app/distribute/snapcraft Run the installed snap application for testing purposes. ```bash snap run your-app ``` -------------------------------- ### Use Global Shortcut Plugin in JavaScript Source: https://v2.tauri.app/start/migrate/from-tauri-1 Example of registering a global shortcut in JavaScript. ```javascript import { register } from '@tauri-apps/plugin-global-shortcut';await register('CommandOrControl+Shift+C', () => { console.log('Shortcut triggered');}); ``` -------------------------------- ### Use Global Shortcut Plugin in Rust Source: https://v2.tauri.app/start/migrate/from-tauri-1 Example of registering a global shortcut in Rust. ```rust use tauri_plugin_global_shortcut::GlobalShortcutExt; tauri::Builder::default() .plugin( tauri_plugin_global_shortcut::Builder::new().with_handler(|app, shortcut| { println!("Shortcut triggered: {:?}", shortcut); }) .build(), ) .setup(|app| { // register a global shortcut // on macOS, the Cmd key is used // on Windows and Linux, the Ctrl key is used app.global_shortcut().register("CmdOrCtrl+Y")?; Ok(()) }) ``` -------------------------------- ### Verify Signing Output Source: https://v2.tauri.app/distribute/sign/windows Example console output confirming successful application signing. ```text info: signing appinfo: running signtool "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64\\signtool.exe"info: "Done Adding Additional Store\r\nSuccessfully signed: APPLICATION FILE PATH HERE ``` -------------------------------- ### Add the Tauri CLI to your project Source: https://v2.tauri.app/start/frontend/qwik Install the Tauri CLI as a development dependency. ```bash npm install -D @tauri-apps/cli@latest ``` ```bash yarn add -D @tauri-apps/cli@latest ``` ```bash pnpm add -D @tauri-apps/cli@latest ``` ```bash deno add -D npm:@tauri-apps/cli@latest ``` -------------------------------- ### Example sources.list configuration Source: https://v2.tauri.app/distribute/rpm A sample configuration for /etc/apt/sources.list showing how to restrict architectures for main repositories. ```text # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted ## Major bug fix updates produced after the final release of the## distribution.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe# deb-src http://archive.ubuntu.com/ubuntu/ jammy universedeb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe ``` -------------------------------- ### Silent Install Parameters Source: https://v2.tauri.app/distribute/microsoft-store Example of the silent install flag for the NSIS installer. ```bash MyApp_x64-setup.exe /S ``` -------------------------------- ### Use Dialog Plugin in Rust Source: https://v2.tauri.app/start/migrate/from-tauri-1 Example of using the dialog plugin in Rust setup. ```rust use tauri_plugin_dialog::DialogExt;tauri::Builder::default() .plugin(tauri_plugin_dialog::init()) .setup(|app| { app.dialog().file().pick_file(|file_path| { // do something with the optional file path here // the file path is `None` if the user closed the dialog }); app.dialog().message("Tauri is Awesome!").show(); Ok(()) }) ``` -------------------------------- ### Create a new Qwik app Source: https://v2.tauri.app/start/frontend/qwik Initialize a new Qwik project using the preferred package manager. ```bash npm create qwik@latestcd ``` ```bash yarn create qwik@latestcd ``` ```bash pnpm create qwik@latestcd ``` ```bash deno run -A npm:create-qwik@latestcd ``` -------------------------------- ### Define WiX Localization XML Source: https://v2.tauri.app/distribute/windows-installer Example of a WXL file structure for defining localized strings used in the installer. ```xml Launch MyApplicationName A newer version of MyApplicationName is already installed. Add the install location of the MyApplicationName executable to the PATH system environment variable. This allows the MyApplicationName executable to be called from any location. Installs MyApplicationName. ``` -------------------------------- ### Install Homebrew Source: https://v2.tauri.app/start/prerequisites Install the Homebrew package manager on macOS. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install the static adapter Source: https://v2.tauri.app/start/frontend/qwik Add the static adapter to your Qwik project to enable static site generation, which is required for Tauri. ```bash npm run qwik add static ``` ```bash yarn qwik add static ``` ```bash pnpm qwik add static ``` ```bash deno task qwik add static ``` -------------------------------- ### Install Cocoapods Source: https://v2.tauri.app/start/prerequisites Install the Cocoapods dependency manager using Homebrew. ```bash brew install cocoapods ``` -------------------------------- ### Verify Node.js installation Source: https://v2.tauri.app/start/prerequisites Check the installed versions of Node.js and npm. ```bash node -v# v20.10.0npm -v# 10.2.3 ``` -------------------------------- ### Install LLVM on macOS Source: https://v2.tauri.app/distribute/windows-installer Install LLVM via Homebrew on macOS. ```bash brew install llvm ``` -------------------------------- ### Start Tauri Development Server Source: https://v2.tauri.app/start/frontend/qwik Commands to launch the Tauri development environment for a Qwik project. ```bash npm run tauri dev ``` ```bash yarn tauri dev ``` ```bash pnpm tauri dev ``` ```bash deno task tauri dev ``` -------------------------------- ### Install NSIS on macOS Source: https://v2.tauri.app/distribute/windows-installer Use Homebrew to install NSIS on macOS. ```bash brew install nsis ``` -------------------------------- ### Install tauri-driver Source: https://v2.tauri.app/develop/tests/webdriver/manual-setup Installs or updates the tauri-driver binary via Cargo. ```bash cargo install tauri-driver --locked ``` -------------------------------- ### Use File System Plugin in JavaScript Source: https://v2.tauri.app/start/migrate/from-tauri-1 Example of creating a directory using the file system plugin. ```javascript import { mkdir, BaseDirectory } from '@tauri-apps/plugin-fs';await mkdir('db', { baseDir: BaseDirectory.AppLocalData }); ``` -------------------------------- ### Install NSIS on Linux Source: https://v2.tauri.app/distribute/windows-installer Commands to install NSIS on Ubuntu and Fedora distributions. ```bash sudo apt install nsis ``` ```bash sudo dnf in mingw64-nsis wget https://github.com/tauri-apps/binary-releases/releases/download/nsis-3/nsis-3.zip unzip nsis-3.zip sudo cp nsis-3.08/Stubs/* /usr/share/nsis/Stubs/ sudo cp -r nsis-3.08/Plugins/** /usr/share/nsis/Plugins/ ``` -------------------------------- ### Execute backend setup task Source: https://v2.tauri.app/learn/splashscreen An asynchronous function to perform heavy backend initialization and signal completion via the set_complete command. ```rust // An async function that does some heavy setup taskasync fn setup(app: AppHandle) -> Result<(), ()> { // Fake performing some heavy action for 3 seconds println!("Performing really heavy backend setup task..."); sleep(Duration::from_secs(3)).await; println!("Backend setup task completed!"); // Set the backend task as being completed // Commands can be ran as regular functions as long as you take // care of the input arguments yourself set_complete( app.clone(), app.state::>(), "backend".to_string(), ) .await?; Ok(())} ``` -------------------------------- ### Install Architecture Linkers Source: https://v2.tauri.app/distribute/debian Install the appropriate GCC cross-compilers for the target architecture. ```bash sudo apt install gcc-arm-linux-gnueabihf ``` ```bash sudo apt install gcc-aarch64-linux-gnu ``` -------------------------------- ### Initialize a new Tauri project Source: https://v2.tauri.app/learn/security/using-plugin-permissions Command to scaffold a new Tauri application using the CLI. ```bash pnpm create tauri-app ``` -------------------------------- ### Initialize a Vite project Source: https://v2.tauri.app/start/create-project Commands to create a new directory and initialize a Vite application using various package managers. ```bash mkdir tauri-app cd tauri-app npm create vite@latest . ``` ```bash mkdir tauri-app cd tauri-app yarn create vite . ``` ```bash mkdir tauri-app cd tauri-app pnpm create vite . ``` ```bash mkdir tauri-app cd tauri-app deno run -A npm:create-vite . ``` ```bash mkdir tauri-app cd tauri-app bun create vite ``` -------------------------------- ### Run the development server Source: https://v2.tauri.app/start/create-project Start the Tauri development server to compile Rust code and launch the application window. ```bash npx tauri dev ``` ```bash yarn tauri dev ``` ```bash pnpm tauri dev ``` ```bash deno task tauri dev ``` ```bash bun tauri dev ``` ```bash cargo tauri dev ``` -------------------------------- ### Install cargo-xwin Source: https://v2.tauri.app/distribute/windows-installer Installs the cargo-xwin tool to handle Windows SDK requirements automatically. ```bash cargo install --locked cargo-xwin ``` -------------------------------- ### Build and Bundle for Microsoft Store Source: https://v2.tauri.app/distribute/microsoft-store Commands to build and bundle the application using the Microsoft Store configuration file. ```bash npm run tauri build -- --no-bundlenpm run tauri bundle -- --config src-tauri/tauri.microsoftstore.conf.json ``` ```bash yarn tauri build --no-bundleyarn tauri bundle --config src-tauri/tauri.microsoftstore.conf.json ``` ```bash pnpm tauri build --no-bundlepnpm tauri bundle --config src-tauri/tauri.microsoftstore.conf.json ``` ```bash deno task tauri build --no-bundledeno task tauri bundle --config src-tauri/tauri.microsoftstore.conf.json ``` ```bash bun tauri build --no-bundlebun tauri bundle --config src-tauri/tauri.microsoftstore.conf.json ``` ```bash cargo tauri build --no-bundlecargo tauri bundle --config src-tauri/tauri.microsoftstore.conf.json ``` -------------------------------- ### Initialize a new Tauri plugin project Source: https://v2.tauri.app/develop/plugins Use the Tauri CLI to bootstrap a new plugin project. The --no-api, --android, and --ios flags can be used to customize the generated project structure. ```bash npx @tauri-apps/cli plugin new [name] ``` -------------------------------- ### Install OpenSSL Development Headers Source: https://v2.tauri.app/distribute/debian Install OpenSSL development headers for cross-compilation targets. ```bash sudo apt install libssl-dev:armhf ``` ```bash sudo apt install libssl-dev:arm64 ``` -------------------------------- ### Configure APT Package Sources Source: https://v2.tauri.app/distribute/debian Add ARM architecture ports to the system's sources.list and restrict existing repositories to the host architecture. ```text deb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy main restricteddeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates main restricteddeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy universedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates universedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy multiversedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-updates multiversedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-backports main restricted universe multiversedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security main restricteddeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security universedeb [arch=armhf,arm64] http://ports.ubuntu.com/ubuntu-ports jammy-security multiverse ``` ```text # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to# newer versions of the distribution.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy main restricted# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted ## Major bug fix updates produced after the final release of the## distribution.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team. Also, please note that software in universe WILL NOT receive any## review or updates from the Ubuntu security team.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy universe# deb-src http://archive.ubuntu.com/ubuntu/ jammy universedeb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates universe# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu## team, and may not be under a free licence. Please satisfy yourself as to## your rights to use the software. Also, please note that software in## multiverse WILL NOT receive any review or updates from the Ubuntu## security team.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy multiverse# deb-src http://archive.ubuntu.com/ubuntu/ jammy multiversedeb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse ## N.B. software from this repository may not have been tested as## extensively as that contained in the main release, although it includes## newer versions of some applications which may provide useful features.## Also, please note that software in backports WILL NOT receive any review## or updates from the Ubuntu security team.deb [arch=amd64] http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse ``` -------------------------------- ### Install Linux Dependencies Source: https://v2.tauri.app/start/prerequisites Commands to install required system packages for various Linux distributions. ```bash sudo apt updatesudo apt install libwebkit2gtk-4.1-dev \ build-essential \ curl \ wget \ file \ libxdo-dev \ libssl-dev \ libayatana-appindicator3-dev \ librsvg2-dev ``` ```bash sudo pacman -Syusudo pacman -S --needed \ webkit2gtk-4.1 \ base-devel \ curl \ wget \ file \ openssl \ appmenu-gtk-module \ libappindicator-gtk3 \ librsvg \ xdotool ``` ```bash sudo dnf check-updatesudo dnf install webkit2gtk4.1-devel \ openssl-devel \ curl \ wget \ file \ libappindicator-gtk3-devel \ librsvg2-devel \ libxdo-develsudo dnf group install "c-development" ``` ```bash sudo emerge --ask \ net-libs/webkit-gtk:4.1 \ dev-libs/libayatana-appindicator \ net-misc/curl \ net-misc/wget \ sys-apps/file ``` ```bash sudo rpm-ostree install webkit2gtk4.1-devel \ openssl-devel \ curl \ wget \ file \ libappindicator-gtk3-devel \ librsvg2-devel \ libxdo-devel \ gcc \ gcc-c++ \ makesudo systemctl reboot ``` ```bash sudo zypper upsudo zypper in webkit2gtk3-devel \ libopenssl-devel \ curl \ wget \ file \ libappindicator3-1 \ librsvg-develsudo zypper in -t pattern devel_basis ``` ```bash sudo apk add \ build-base \ webkit2gtk-4.1-dev \ curl \ wget \ file \ openssl \ libayatana-appindicator-dev \ librsvg ``` -------------------------------- ### Build the Snap package Source: https://v2.tauri.app/distribute/snapcraft Execute this command in the terminal to build the snap package. ```bash sudo snapcraft ``` -------------------------------- ### Install Tauri CLI Source: https://v2.tauri.app/start/create-project Install the Tauri CLI as a development dependency or globally via cargo. ```bash npm install -D @tauri-apps/cli@latest ``` ```bash yarn add -D @tauri-apps/cli@latest ``` ```bash pnpm add -D @tauri-apps/cli@latest ``` ```bash deno add -D npm:@tauri-apps/cli@latest ``` ```bash bun add -D @tauri-apps/cli@latest ``` ```bash cargo install tauri-cli --version "^2.0.0" --locked ``` -------------------------------- ### Create a basic application menu in JavaScript Source: https://v2.tauri.app/learn/window-menu Initializes a new menu with specific items and sets it as the application menu. ```javascript import { Menu } from '@tauri-apps/api/menu'; const menu = await Menu.new({ items: [ { id: 'Open', text: 'open', action: () => { console.log('open pressed'); }, }, { id: 'Close', text: 'close', action: () => { console.log('close pressed'); }, }, ],}); await menu.setAsAppMenu(); ``` -------------------------------- ### Initialize Application State Source: https://v2.tauri.app/develop/state-management Use the manage method within the setup hook to register application state. ```rust use tauri::{Builder, Manager}; struct AppData { welcome_message: &'static str,} fn main() { Builder::default() .setup(|app| { app.manage(AppData { welcome_message: "Welcome to Tauri!", }); Ok(()) }) .run(tauri::generate_context!()) .unwrap();} ``` -------------------------------- ### Install snapd on Debian Source: https://v2.tauri.app/distribute/snapcraft Use the apt package manager to install snapd on Debian-based systems. ```bash sudo apt install snapd ``` -------------------------------- ### Implement Transparent Titlebar and Background Color Source: https://v2.tauri.app/learn/window-customization Use the setup hook to apply macOS-specific window styling and background colors. ```rust use tauri::{TitleBarStyle, WebviewUrl, WebviewWindowBuilder}; pub fn run() { tauri::Builder::default() .setup(|app| { let win_builder = WebviewWindowBuilder::new(app, "main", WebviewUrl::default()) .title("Transparent Titlebar Window") .inner_size(800.0, 600.0); // set transparent title bar only when building for macOS #[cfg(target_os = "macos")] let win_builder = win_builder.title_bar_style(TitleBarStyle::Transparent); let window = win_builder.build().unwrap(); // set background color only when building for macOS #[cfg(target_os = "macos")] { use objc2_app_kit::{NSColor, NSWindow}; let ns_window_ptr = window.ns_window().unwrap() as *mut NSWindow; let ns_window = unsafe { &*ns_window_ptr }; let bg_color = NSColor::colorWithRed_green_blue_alpha( 50.0 / 255.0, 158.0 / 255.0, 163.5 / 255.0, 1.0, ); ns_window.setBackgroundColor(Some(&bg_color)); } Ok(()) }) .run(tauri::generate_context!()) .expect("error while running tauri application");} ``` -------------------------------- ### Install msedgedriver-tool Source: https://v2.tauri.app/develop/tests/webdriver/manual-setup Installs the tool used to manage Microsoft Edge Driver versions on Windows. ```bash cargo install --git https://github.com/chippers/msedgedriver-tool& "$HOME/.cargo/bin/msedgedriver-tool.exe" ``` -------------------------------- ### Run Mobile Development Environment Source: https://v2.tauri.app/develop Commands to start the development server for mobile platforms using different package managers. ```npm npm run tauri [android|ios] dev ``` ```yarn yarn tauri [android|ios] dev ``` ```pnpm pnpm tauri [android|ios] dev ``` ```deno deno task tauri [android|ios] dev ``` ```bun bun tauri [android|ios] dev ``` ```cargo cargo tauri [android|ios] dev ``` -------------------------------- ### Create a Tauri Application Source: https://v2.tauri.app/learn/security/using-plugin-permissions Commands to initialize a new Tauri project using various package managers and shells. ```bash sh <(curl https://create.tauri.app/sh) ``` ```powershell irm https://create.tauri.app/ps | iex ``` ```fish sh (curl -sSL https://create.tauri.app/sh | psub) ``` ```npm npm create tauri-app@latest ``` ```yarn yarn create tauri-app ``` ```pnpm pnpm create tauri-app ``` ```deno deno run -A npm:create-tauri-app ``` ```bun bun create tauri-app ``` ```cargo cargo install create-tauri-app --locked cargo create-tauri-app ``` -------------------------------- ### Initialize Tauri Lab App Source: https://v2.tauri.app/learn/sidecar-nodejs Commands to scaffold a new Tauri project using various package managers. ```bash sh <(curl https://create.tauri.app/sh) ``` ```powershell irm https://create.tauri.app/ps | iex ``` ```fish sh (curl -sSL https://create.tauri.app/sh | psub) ``` ```npm npm create tauri-app@latest ``` ```yarn yarn create tauri-app ``` ```pnpm pnpm create tauri-app ``` ```deno deno run -A npm:create-tauri-app ``` ```bun bun create tauri-app ``` ```cargo cargo install create-tauri-app --lockedcargo create-tauri-app ``` -------------------------------- ### Initialize WebdriverIO Configuration Source: https://v2.tauri.app/develop/tests/webdriver/example/webdriverio Commands to run the interactive configuration wizard for WebdriverIO using npm or yarn. ```bash npx wdio config ``` ```bash yarn wdio config ``` -------------------------------- ### Configure Multi-Language WiX Installer Source: https://v2.tauri.app/distribute/windows-installer Provide an array of language codes to generate separate installers for each specified language. ```json { "bundle": { "windows": { "wix": { "language": ["en-US", "pt-BR", "fr-FR"] } } }} ```