wails/website/docs/gettingstarted/installation.mdx
Lea Anthony c84506a8a8 docs: Comprehensive documentation redesign and v3-alpha updates
This commit represents a complete redesign of the Wails v3 documentation structure
and includes all recent v3-alpha updates.

## Major Changes

### Documentation Restructure
- Migrated from /learn to organized /features, /guides, /reference structure
- Created new Quick Start section with installation and first app guides
- Added comprehensive Concepts section explaining architecture and lifecycle
- Reorganized Contributing section with detailed guides for different contribution types
- Added complete API Reference with separate pages for each major component

### New Documentation
- Custom URL Protocols guide with NSIS automatic registration
- Windows Packaging guide with NSIS, MSI, and MSIX options
- Typed Events system with TypeScript binding generation
- Complete menu documentation (Application, Context, System Tray)
- Comprehensive dialog documentation (File, Message, Custom)
- Window management guides (Basics, Events, Frameless, Multiple Windows)
- Bindings documentation (Services, Methods, Models, Best Practices)
- New tutorials: Todo app and Notes app (vanilla JS)

### v3-alpha API Updates
- Typed Events: RegisterEvent[T] with strict mode and binding generation
- Custom Protocols: NSIS macros for automatic Windows protocol registration
- System Tray: Windows Show/Hide now fully functional with tooltip limits
- Window Hidden: Fixed white flash on Windows when creating hidden windows
- Notifications: Corrected import path to pkg/services/notifications
- Frontend Runtime: Events.Emit now returns Promise<boolean> for cancellation

### Documentation Improvements
- Updated all code examples to use @wailsio/runtime imports
- Added platform-specific event tables and examples
- Created comprehensive event reference with use cases
- Added security best practices and validation patterns
- Improved code examples with real-world use cases
- Added troubleshooting sections and common patterns

### Files
- Created: 60+ new documentation pages
- Deleted: Old /learn structure (13 files)
- Modified: 15 existing files for v3-alpha compatibility
- Added: Tutorial assets and showcase images
2025-11-23 20:57:25 +11:00

95 lines
3.8 KiB
Text

---
sidebar_position: 1
---
# Installation
## Supported Platforms
- Windows 10/11 AMD64/ARM64
- MacOS 10.13+ AMD64
- MacOS 11.0+ ARM64
- Linux AMD64/ARM64
## Dependencies
Wails has a number of common dependencies that are required before installation:
- Go 1.20+
- NPM (Node 15+)
### Go
Download Go from the [Go Downloads Page](https://go.dev/dl/).
Ensure that you follow the official [Go installation instructions](https://go.dev/doc/install). You will also need to ensure that your `PATH` environment variable also includes the path to your `~/go/bin` directory. Restart your terminal and do the following checks:
- Check Go is installed correctly: `go version`
- Check "~/go/bin" is in your PATH variable: `echo $PATH | grep go/bin`
### NPM
Download NPM from the [Node Downloads Page](https://nodejs.org/en/download/). It is best to use the latest release as that is what we generally test against.
Run `npm --version` to verify.
## Platform Specific Dependencies
You will also need to install platform specific dependencies:
```mdx-code-block
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
<Tabs
defaultValue="Windows"
values={[
{ label: "Windows", value: "Windows" },
{ label: "MacOS", value: "MacOS" },
{ label: "Linux", value: "Linux" },
]}
>
<TabItem value="MacOS">
Wails requires that the xcode command line tools are installed. This can be
done by running <code>xcode-select --install</code>.
</TabItem>
<TabItem value="Windows">
Wails requires that the <a href="https://developer.microsoft.com/en-us/microsoft-edge/webview2/">WebView2</a> runtime is installed. Some Windows installations will already have this installed. You can check using the <code>wails doctor</code> command.
<br/><br/>
<strong>Performance Tip:</strong> For Windows 11 users, consider using <a href="https://learn.microsoft.com/en-us/windows/dev-drive/">Dev Drive</a> to store your projects. Dev Drives are optimized for developer workloads and can significantly improve build times and disk access speeds by up to 30% compared to regular NTFS drives.
</TabItem>
<TabItem value={"Linux"}>
Linux requires the standard <code>gcc</code> build tools plus <code>libgtk3</code> and <code>libwebkit</code>. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run <code>wails doctor</code> after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please consult the <a href={"/docs/guides/linux-distro-support"}>Add Linux Distro</a> guide.
</TabItem>
</Tabs>
```
## Optional Dependencies
- [UPX](https://upx.github.io/) for compressing your applications.
- [NSIS](https://wails.io/docs/guides/windows-installer/) for generating Windows installers.
## Installing Wails
Run `go install github.com/wailsapp/wails/v2/cmd/wails@latest` to install the Wails CLI.
Note: If you get an error similar to this:
```shell
....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found
```
please check you have Go 1.18+ installed:
```shell
go version
```
## System Check
Running `wails doctor` will check if you have the correct dependencies installed. If not, it will advise on what is missing and help on how to rectify any problems.
## The `wails` command appears to be missing?
If your system is reporting that the `wails` command is missing, make sure you have followed the Go installation guide
correctly. Normally, it means that the `go/bin` directory in your User's home directory is not in the `PATH` environment
variable. You will also normally need to close and reopen any open command prompts so that changes to the environment
made by the installer are reflected at the command prompt.