If you are trying to set up a Windows computer to build Substrate, do the following:
-
Download and install "Build Tools for Visual Studio:"
- You can get it at this link: https://docs.microsoft.com/en-us/visualstudio/install/create-an-offline-installation-of-visual-studio
- Run the installation file:
vs_buildtools.exe
- Ensure the "Windows 10 SDK" component is included when installing the Visual C++ Build Tools
- Restart your computer
-
Install Rust:
-
Detailed instructions are provided by the Rust Book
-
Download from: https://www.rust-lang.org/tools/install
-
Button name:
DOWNLOAD RUSTUP-INIT.EXE (64-BIT)
-
Run the installation file:
rustup-init.exe
Note that it should not prompt you to install
vs_buildtools
since you did it in step 1 -
Choose "Default Installation."
-
To get started, you need Cargo's bin directory (
%USERPROFILE%\.cargo\bin
) in your PATH environment variable. Future applications will automatically have the correct environment, but you may need to restart your current shell
-
-
-
Run these commands in Command Prompt (
CMD
) to set up your Wasm Build Environment:rustup update nightly rustup update stable rustup target add wasm32-unknown-unknown --toolchain nightly
-
Install LLVM: https://github.com/llvm/llvm-project/releases
- Run the installation file:
LLVM-14.0.6-win64.exe
ornewer
- Run the installation file:
-
Install OpenSSL with
vcpkg
:mkdir C:\Tools cd C:\Tools git clone https://github.com/Microsoft/vcpkg.git cd vcpkg .\bootstrap-vcpkg.bat .\vcpkg.exe install openssl:x64-windows-static
-
Add OpenSSL to your System Variables using PowerShell:
$env:OPENSSL_DIR = 'C:\Tools\vcpkg\installed\x64-windows-static' $env:OPENSSL_STATIC = 'Yes' [System.Environment]::SetEnvironmentVariable('OPENSSL_DIR', $env:OPENSSL_DIR, [System.EnvironmentVariableTarget]::User) [System.Environment]::SetEnvironmentVariable('OPENSSL_STATIC', $env:OPENSSL_STATIC, [System.EnvironmentVariableTarget]::User)
-
Finally, install
cmake
: https://cmake.org/download/- Run the installation file:
cmake-3.23.2-windows-x86_64.msi
ornewer
- Run the installation file:
You can now jump back to Get the Source to learn how to download and compile Substrate!
-
Install npm dependencies:
npm install
-
Build
npm run tauri build