mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-03-30 09:51:12 +02:00
Created 04. MS Windows Setup (markdown)
78
04.-MS-Windows-Setup.md
Normal file
78
04.-MS-Windows-Setup.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# MS Windows Setup
|
||||
This setup is only needed for development. Consumers of Tauri apps will not have to do any of this.
|
||||
|
||||
## Dependencies
|
||||
Tauri is a polyglot system, and as such requires a good deal of tooling.
|
||||
|
||||
### System dependencies:
|
||||
|
||||
First you should [download](https://aka.ms/buildtools) and install Visual Studio MSBuild Tools and C++ build tools.
|
||||
|
||||
> This is a big download (over 1GB) and takes the most time, so go grab a :coffee:
|
||||
|
||||
Chocolatey is a great package manager for Windows. Follow these [these official instructions](https://chocolatey.org/install), or just do this:
|
||||
|
||||
Then download and install [nvm-windows](https://github.com/coreybutler/nvm-windows/releases)
|
||||
Then install Chocolatey
|
||||
|
||||
```powershell
|
||||
# BE SURE YOU ARE IN AN ADMINISTRATIVE PowerShell!
|
||||
nvm install 12
|
||||
nvm use 12
|
||||
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
|
||||
choco install yarn
|
||||
```
|
||||
|
||||
|
||||
### Node runtime and package manager
|
||||
We recommend using NVM to manage your node runtime. It allows you to easily switch versions and update.
|
||||
```
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
|
||||
```
|
||||
> We have audited this bash script, and it does what it says it is supposed to do. Nevertheless, before blindly curl-bashing a script, it is always wise to look at it first. Here is the file as a mere [download link](https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh)
|
||||
|
||||
Once nvm is installed (you may have to use another terminal), then install Node 12LTS and the latest NPM:
|
||||
```
|
||||
nvm install 12LTS
|
||||
```
|
||||
If you have any problems with NVM, please consult their [project readme](https://github.com/nvm-sh/nvm).
|
||||
|
||||
Now that `npm` is installed, if you like you may additionally install `yarn` - the preferred package manager of the Tauri team.
|
||||
|
||||
```
|
||||
npm install --global yarn
|
||||
```
|
||||
|
||||
|
||||
### Rustc and Cargo package manager
|
||||
If you are running Windows 64-bit, download and run [rustup‑init.exe](https://win.rustup.rs/x86_64) and then follow the onscreen instructions.
|
||||
|
||||
If you are running Windows 32-bit, download and run [rustup‑init.exe](https://win.rustup.rs/i686) and then follow the onscreen instructions.
|
||||
|
||||
```
|
||||
$ rustup update stable
|
||||
$ rustup override set 1.40.0
|
||||
```
|
||||
|
||||
### Enable loopback
|
||||
Microsoft disables the loopback interface - you need to whitelist it if you intend to use the dev-server:
|
||||
|
||||
Open an administrative console and enter:
|
||||
```
|
||||
CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.Win32WebViewHost_cw5n1h2txyewy"
|
||||
```
|
||||
|
||||
### Devtools
|
||||
https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide
|
||||
|
||||
## Tauri bundler
|
||||
After you have installed Rust and the build toolchain, it is wise to open a new shell before continuing.
|
||||
|
||||
Setup the bundler:
|
||||
|
||||
```
|
||||
$ cargo install tauri-cli --force
|
||||
```
|
||||
|
||||
# Next Step:
|
||||
[Tauri Integration]()
|
||||
Reference in New Issue
Block a user