2020-06-05 07:45:30 +03:00
|
|
|
# The environment variable CHIA_VERSION needs to be defined
|
|
|
|
# $env:path should contain a path to editbin.exe
|
|
|
|
|
|
|
|
if (-not (Test-Path env:CHIA_VERSION)) { $env:CHIA_VERSION = '0.0.0' }
|
|
|
|
Write-Output "Chia Version is: $env:CHIA_VERSION";
|
|
|
|
|
2020-05-22 02:10:02 +03:00
|
|
|
cd ..
|
2020-05-28 04:43:02 +03:00
|
|
|
|
2020-05-22 02:10:02 +03:00
|
|
|
mkdir build_scripts\win_build
|
|
|
|
cd build_scripts\win_build
|
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "curl miniupnpc, setprotitle";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
curl -OL --show-error --fail https://download.chia.net/simple/miniupnpc/miniupnpc-2.1-cp37-cp37m-win_amd64.whl
|
|
|
|
curl -OL --show-error --fail https://download.chia.net/simple/setproctitle/setproctitle-1.1.10-cp37-cp37m-win_amd64.whl
|
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Install pip/python prerequisites";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
cd ..\..
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install pep517 wheel
|
2020-05-23 23:41:19 +03:00
|
|
|
|
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Build chia-blockchain wheels";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
pip wheel --use-pep517 --only-binary cbor2 --extra-index-url https://download.chia.net/simple/ -f . --wheel-dir=.\build_scripts\win_build .
|
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
2020-05-24 02:20:58 +03:00
|
|
|
Write-Output "Create venv - python3.7 or 3.8 is required in PATH";
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
python -m venv venv
|
|
|
|
. .\venv\Scripts\Activate.ps1
|
|
|
|
python -m pip install --upgrade pip
|
2020-05-27 11:10:48 +03:00
|
|
|
pip install wheel
|
|
|
|
pip install pywin32 pyinstaller
|
2020-05-23 23:41:19 +03:00
|
|
|
|
|
|
|
Write-Output " ---";
|
2020-05-31 12:09:53 +03:00
|
|
|
Write-Output "Install chia-blockchain wheels into venv with pip";
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
2020-05-28 02:35:28 +03:00
|
|
|
|
|
|
|
Write-Output "pip install miniupnpc";
|
2020-05-22 02:10:02 +03:00
|
|
|
cd build_scripts
|
2020-05-28 02:48:19 +03:00
|
|
|
pip install --no-index --find-links=.\win_build\ miniupnpc
|
|
|
|
Write-Output "pip install setproctitle";
|
|
|
|
pip install --no-index --find-links=.\win_build\ setproctitle
|
2020-05-28 02:35:28 +03:00
|
|
|
Write-Output "pip install chia-blockchain";
|
2020-05-27 11:10:48 +03:00
|
|
|
pip install --no-index --find-links=.\win_build\ chia-blockchain
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Use pyinstaller to create chia .exe's";
|
|
|
|
Write-Output " ---";
|
2020-06-05 07:45:30 +03:00
|
|
|
pyinstaller --log-level INFO daemon_windows.spec
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Copy chia executables to electron-react/";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
cp -r dist/daemon ../electron-react/
|
|
|
|
cd ../electron-react
|
|
|
|
|
2020-05-23 23:41:19 +03:00
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Prepare Electron package";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
npm install --save-dev electron-winstaller
|
|
|
|
npm install -g electron-packager
|
|
|
|
npm install
|
2020-05-23 23:41:19 +03:00
|
|
|
|
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Electron package Windows Installer";
|
|
|
|
Write-Output " ---";
|
2020-05-22 02:10:02 +03:00
|
|
|
npm run build
|
2020-05-28 04:43:02 +03:00
|
|
|
|
2020-06-05 07:45:30 +03:00
|
|
|
Write-Output " ---";
|
2020-05-28 04:43:02 +03:00
|
|
|
Write-Output "Increase the stack for chiapos";
|
2020-06-05 07:45:30 +03:00
|
|
|
# editbin.exe needs to be in your path
|
|
|
|
Start-Process "editbin.exe" -ArgumentList "/STACK:8000000 daemon/create_plots.exe" -Wait
|
|
|
|
Write-Output " ---";
|
2020-05-28 04:43:02 +03:00
|
|
|
|
2020-06-05 07:45:30 +03:00
|
|
|
$packageName = "Chia-$env:CHIA_VERSION"
|
|
|
|
electron-packager . $packageName --asar.unpack="**/daemon/**" --overwrite --icon=./src/assets/img/chia.ico
|
2020-05-22 02:10:02 +03:00
|
|
|
node winstaller.js
|
2020-05-23 23:41:19 +03:00
|
|
|
|
|
|
|
Write-Output " ---";
|
|
|
|
Write-Output "Windows Installer complete";
|
|
|
|
Write-Output " ---";
|