2020-06-09 01:00:01 +03:00
|
|
|
# $env:path should contain a path to editbin.exe and signtool.exe
|
2020-05-28 04:43:02 +03:00
|
|
|
|
2020-05-22 02:10:02 +03:00
|
|
|
mkdir build_scripts\win_build
|
2020-06-24 06:47:06 +03:00
|
|
|
Set-Location -Path ".\build_scripts\win_build" -PassThru
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-06-17 09:24:58 +03:00
|
|
|
Write-Output "curl miniupnpc, setproctitle"
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-06-24 06:47:06 +03:00
|
|
|
Invoke-WebRequest -Uri "https://download.chia.net/simple/miniupnpc/miniupnpc-2.1-cp37-cp37m-win_amd64.whl" -OutFile "miniupnpc-2.1-cp37-cp37m-win_amd64.whl"
|
|
|
|
Invoke-WebRequest -Uri "https://download.chia.net/simple/setproctitle/setproctitle-1.1.10-cp37-cp37m-win_amd64.whl" -OutFile "setproctitle-1.1.10-cp37-cp37m-win_amd64.whl"
|
2020-06-17 09:24:58 +03:00
|
|
|
Write-Output "Using win_amd64 python 3.7 wheel from https://github.com/miniupnp/miniupnp/pull/475 (2.2.0-RC1)"
|
2020-06-24 06:47:06 +03:00
|
|
|
Set-Location -Path - -PassThru
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Create venv - python3.7 or 3.8 is required in PATH"
|
|
|
|
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-06-07 02:18:43 +03:00
|
|
|
pip install wheel pep517
|
2020-09-10 01:34:19 +03:00
|
|
|
pip install pywin32
|
|
|
|
pip install pyinstaller==3.6
|
2020-06-07 02:18:43 +03:00
|
|
|
pip install setuptools_scm
|
|
|
|
|
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Get CHIA_INSTALLER_VERSION"
|
|
|
|
# The environment variable CHIA_INSTALLER_VERSION needs to be defined
|
|
|
|
$env:CHIA_INSTALLER_VERSION = python .\build_scripts\installer-version.py -win
|
|
|
|
|
|
|
|
if (-not (Test-Path env:CHIA_INSTALLER_VERSION)) {
|
|
|
|
$env:CHIA_INSTALLER_VERSION = '0.0.0'
|
|
|
|
Write-Output "WARNING: No environment variable CHIA_INSTALLER_VERSION set. Using 0.0.0"
|
|
|
|
}
|
|
|
|
Write-Output "Chia Version is: $env:CHIA_INSTALLER_VERSION"
|
|
|
|
Write-Output " ---"
|
|
|
|
|
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Build chia-blockchain wheels"
|
|
|
|
Write-Output " ---"
|
|
|
|
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
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Install chia-blockchain wheels into venv with pip"
|
|
|
|
Write-Output " ---"
|
2020-05-28 02:35:28 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output "pip install miniupnpc"
|
2020-06-24 06:47:06 +03:00
|
|
|
Set-Location -Path ".\build_scripts" -PassThru
|
2020-05-28 02:48:19 +03:00
|
|
|
pip install --no-index --find-links=.\win_build\ miniupnpc
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output "pip install setproctitle"
|
2020-05-28 02:48:19 +03:00
|
|
|
pip install --no-index --find-links=.\win_build\ setproctitle
|
2020-06-07 02:18:43 +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-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Use pyinstaller to create chia .exe's"
|
|
|
|
Write-Output " ---"
|
2020-06-24 06:47:06 +03:00
|
|
|
pyinstaller --log-level INFO daemon_windows.spec
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-06-24 06:47:06 +03:00
|
|
|
Write-Output "Copy chia executables to electron-react\"
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-06-24 06:47:06 +03:00
|
|
|
Copy-Item "dist\daemon" -Destination "..\electron-react\" -Recurse
|
|
|
|
Set-Location -Path "..\electron-react" -PassThru
|
2020-05-22 02:10:02 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Prepare Electron packager"
|
|
|
|
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
|
|
|
|
2020-06-07 02:18:43 +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-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-07-06 11:11:51 +03:00
|
|
|
Write-Output "Increase the stack for chia command for (chia plots create) chiapos limitations"
|
2020-06-07 02:18:43 +03:00
|
|
|
# editbin.exe needs to be in the path
|
2020-07-06 11:11:51 +03:00
|
|
|
editbin.exe /STACK:8000000 daemon\chia.exe
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
|
|
|
|
$packageVersion = "$env:CHIA_INSTALLER_VERSION"
|
|
|
|
$packageName = "Chia-$packageVersion"
|
|
|
|
|
|
|
|
Write-Output "packageName is $packageName"
|
|
|
|
|
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "electron-packager"
|
2020-06-24 06:47:06 +03:00
|
|
|
electron-packager . Chia --asar.unpack="**\daemon\**" --overwrite --icon=.\src\assets\img\chia.ico --app-version=$packageVersion
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-05-28 04:43:02 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "node winstaller.js"
|
2020-05-22 02:10:02 +03:00
|
|
|
node winstaller.js
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
2020-05-23 23:41:19 +03:00
|
|
|
|
2020-06-16 04:28:24 +03:00
|
|
|
If ($env:HAS_SECRET) {
|
2020-06-13 04:18:20 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Add timestamp and verify signature"
|
|
|
|
Write-Output " ---"
|
|
|
|
signtool.exe timestamp /v /t http://timestamp.comodoca.com/ .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe
|
|
|
|
signtool.exe verify /v /pa .\release-builds\windows-installer\ChiaSetup-$packageVersion.exe
|
|
|
|
} Else {
|
|
|
|
Write-Output "Skipping timestamp and verify signatures - no authorization to install certificates"
|
|
|
|
}
|
2020-06-09 01:00:01 +03:00
|
|
|
|
2020-06-07 02:18:43 +03:00
|
|
|
Write-Output " ---"
|
|
|
|
Write-Output "Windows Installer complete"
|
|
|
|
Write-Output " ---"
|