Skip to content

Commit 25051cf

Browse files
Merge pull request #1344 from Cyrix126/fix-build-windows-doc
fix windows build doc
2 parents 62750d2 + fccbaeb commit 25051cf

1 file changed

Lines changed: 54 additions & 11 deletions

File tree

docs/building.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,21 @@ cd scripts/windows
149149
./deps.sh
150150
```
151151

152-
install go in WSL [https://go.dev/doc/install](https://go.dev/doc/install) (follow linux instructions) and ensure you have `x86_64-w64-mingw32-gcc`
152+
Upgrade the version of cmake >= 3.31.6, the default version of ubuntu 24.04 (3.28.1) will be too low to build libepiccash.
153+
You can use pip to install a specific version
154+
```
155+
sudo apt remove cmake
156+
pip install cmake==3.31.6
157+
```
158+
159+
install go in WSL [https://go.dev/doc/install](https://go.dev/doc/install) (follow linux instructions) and ensure you have `mingw-w64` package installed to get the `x86_64-w64-mingw32-gcc` compiler.
160+
153161
go version should be at least 1.24
154162

155-
and use `scripts/build_app.sh` to build plugins:
163+
and use `scripts/build_app.sh` to build plugins: (see the [Build script section](#build-script-build_appsh) to understand the arguments)
156164
```
157165
cd ..
158-
./build_app.sh -a stack_wallet -p windows -v 2.1.0 -b 210
166+
./build_app.sh -a stack_wallet -p windows -v 2.4.4 -b 301
159167
```
160168

161169
### Running
@@ -255,17 +263,33 @@ flutter run macos
255263
## Windows host
256264

257265
### Visual Studio
258-
Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++", "Linux development with C++", and "Visual C++ build tools" workloads. You may also need the Windows 10, 11, and/or Universal SDK workloads depending on your Windows version.
266+
Visual Studio 2022 is required for Windows development with the Flutter SDK. Download it at https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history and install the "Desktop development with C++", "Linux development with C++", and "Visual C++ build tools" workloads. You may also need the Windows 10, 11, and/or Universal SDK workloads depending on your Windows version.
259267

260268
### Build plugins in WSL2
261269
Set up Ubuntu 24.04 in WSL2. Follow the entire Linux host section in the WSL2 Ubuntu 24.04 host to get set up to build. The Android Studio section may be skipped in WSL (it's only needed on the Windows host).
262270

263271
Install the following libraries:
264272
```
265-
sudo apt-get install libgtk2.0-dev
273+
sudo apt-get install libgtk2.0-dev nasm mingw-w64
274+
```
275+
276+
The WSL2 host may optionally be navigated to the `stack_wallet` repository on the Windows host in order to build the plugins in-place and skip the next section in which you copy the `dll`s from WSL2 to Windows.
277+
278+
In this case, you need to enable "metadata" in your wsl setup to be able to modify files on your Windows filesystem.
279+
Add this content to your /etc/wsl.conf in WSL.
280+
```
281+
[automount]
282+
options = "metadata"
283+
```
284+
Then restart the wsl from Windows
266285
```
286+
wsl --shutdown
287+
wsl
288+
```
289+
290+
https://stackoverflow.com/questions/46610256/chmod-wsl-bash-doesnt-work/50856772#50856772
267291

268-
The WSL2 host may optionally be navigated to the `stack_wallet` repository on the Windows host in order to build the plugins in-place and skip the next section in which you copy the `dll`s from WSL2 to Windows. Then build windows `dll` libraries by running the following script on the WSL2 Ubuntu 24.04 host:
292+
Then build windows `dll` libraries by running the following script on the WSL2 Ubuntu 24.04 host:
269293

270294
- `stack_wallet/scripts/windows/build_all.sh`
271295

@@ -296,11 +320,27 @@ Enable Developer Mode for symlink support,
296320
start ms-settings:developers
297321
```
298322

299-
You may need to install NuGet and CppWinRT / C++/WinRT SDKs version `2.0.210806.1`:
323+
Or enable it automatically from powershell:
324+
```
325+
PS C:\WINDOWS\system32> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
326+
```
327+
328+
329+
Install NuGet:
330+
```
331+
winget install 9WZDNCRDMDM3 --accept-package-agreements # NuGet, can also use Microsoft.NuGet
332+
```
333+
334+
Then restart your terminal and add a source to nuget:
300335
```
301-
winget install 9WZDNCRDMDM3 # NuGet, can also use Microsoft.NuGet
302-
winget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1
336+
nuget sources add -Name "nuget.org" -Source "https://api.nuget.org/v3/index.json"
303337
```
338+
339+
Install and CppWinRT / C++/WinRT SDKs version `2.0.210806.1` with the help of nuget:
340+
```
341+
nuget install Microsoft.Windows.CppWinRT --Version 2.0.210806.1
342+
```
343+
304344
or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWinRT/2.0.210806.1) and [manually install it](https://github.com/Baseflow/flutter-permission-handler/issues/1025#issuecomment-1518576722) by placing it in `flutter/bin` with [nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) and installing by running `nuget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1` in the root `stack_wallet` folder.
305345
<!-- TODO: script this NuGet and WinCppRT installation -->
306346

@@ -309,16 +349,18 @@ or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWi
309349
Certain test wallet parameter and API key template files must be created in order to run Stack Wallet on Windows. These can be created by script using PowerShell on the Windows host as in
310350
```
311351
cd scripts
312-
./prebuild.ps1
352+
powershell -ExecutionPolicy Bypass -File prebuild.ps1
313353
cd .. // When finished go back to the root directory.
314354
```
355+
356+
315357
or manually by creating the files referenced in that script with the specified content.
316358

317359
### Build frostdart
318360

319361
In PowerShell on the Windows host, navigate to the `stack_wallet` folder:
320362
```
321-
cd crypto_plugins/frostdart
363+
cd crypto_plugins/frostdart/scripts/windows
322364
./build_all.bat
323365
cd .. // When finished go back to the root directory.
324366
```
@@ -328,6 +370,7 @@ cd .. // When finished go back to the root directory.
328370
Run the following commands:
329371
```
330372
flutter pub get
373+
dart run coinlib:build_windows
331374
flutter run -d windows
332375
```
333376

0 commit comments

Comments
 (0)