From bae679a3e2097690e91cbe10ffee6b3972f42629 Mon Sep 17 00:00:00 2001 From: nothingismagick Date: Tue, 31 Dec 2019 18:59:52 +0100 Subject: [PATCH] Created 04. MS Windows Setup (markdown) --- 04.-MS-Windows-Setup.md | 78 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 04.-MS-Windows-Setup.md diff --git a/04.-MS-Windows-Setup.md b/04.-MS-Windows-Setup.md new file mode 100644 index 0000000..dd6a052 --- /dev/null +++ b/04.-MS-Windows-Setup.md @@ -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]() \ No newline at end of file