diff --git a/release/arch/windows/build.bat b/release/arch/windows/build.bat index d7a4f051025325bfa6f6842b58193b8d4a84875c..2308fac2e144f2740614150e9b67042c35deba8f 100644 --- a/release/arch/windows/build.bat +++ b/release/arch/windows/build.bat @@ -1,12 +1,22 @@ +set DUNITER_BRANCH=1.3.x +set VER_UI=%DUNITER_BRANCH% +set VER_BMA=%DUNITER_BRANCH% +set VER_CRAWLER=%DUNITER_BRANCH% +set VER_PROVER=%DUNITER_BRANCH% +set VER_KEYPAIR=%DUNITER_BRANCH% + set ADDON_VERSION=48 set NW_VERSION=0.17.6 +set NODEJS_VERSION=6.11.0 + set NW_RELEASE=v0.17.6 set NW=nwjs-%NW_RELEASE%-win-x64 set NW_GZ=%NW%.zip -echo %NW% -echo %NW_GZ% -echo %NW_RELEASE% + +set NODE_RELEASE=v%NODEJS_VERSION% +set NODE=node-v%NODEJS_VERSION%-win-x64 +set NODE_ZIP=node-v%NODEJS_VERSION%-win-x64.zip node -v REM NPM @@ -15,6 +25,13 @@ REM InnoSetup set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH% cd C:\Users\vagrant + +if not exist %NODE_ZIP% ( + echo "Telechargement de %NODE_ZIP%..." + powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://nodejs.org/dist/%NODE_RELEASE%/%NODE_ZIP%\", \"%NODE_ZIP%\")" + call 7z x %NODE_ZIP% +) + echo "Suppression des anciennes sources..." rd /s /q duniter rd /s /q duniter_release @@ -27,15 +44,28 @@ for /f "delims=" %%a in ('git rev-list --tags --max-count=1') do @set DUNITER_RE for /f "delims=" %%a in ('git describe --tags %DUNITER_REV%') do @set DUNITER_TAG=%%a echo %DUNITER_TAG% -git checkout %DUNITER_TAG% +git checkout dev +call npm cache clean call npm install --production REM call npm test +echo "Retrait des modules 'dev'..." +call npm prune --production +echo "Ajout du module 1/5..." +call npm install duniter-bma@%VER_BMA% --save --production +echo "Ajout du module 2/5..." +call npm install duniter-crawler@%VER_CRAWLER% --save --production +echo "Ajout du module 3/5..." +call npm install duniter-keypair@%VER_KEYPAIR% --save --production +echo "Ajout du module 4/5..." +call npm install duniter-prover@%VER_PROVER% --save --production +echo "Ajout du module 5/5..." +call npm install duniter-ui@%VER_UI% --save --production -echo ">> VM: installing peerDependencies installer..." -call npm i --save-dev @team-griffin/install-self-peers -echo ">> VM: installing peerDependencies..." -call ./node_modules/.bin/install-self-peers --npm -- --production +REM echo ">> VM: installing peerDependencies installer..." +REM call npm i --save-dev @team-griffin/install-self-peers +REM echo ">> VM: installing peerDependencies..." +REM call ./node_modules/.bin/install-self-peers --npm -- --production set SRC=%cd% echo %SRC% @@ -62,16 +92,18 @@ copy %cd%\lib\binding\node-webkit-%NW_RELEASE%-win32-x64\node_sqlite3.node %cd%\ cd ../heapdump call nw-gyp --target=%NW_VERSION% --msvs_version=2015 configure call nw-gyp --target=%NW_VERSION% --msvs_version=2015 build -cd ../.. -call npm install duniter-ui@%VER_UI% --save --production -rd /s /q %cd%\node_modules\duniter-ui\node_modules -cd .. +cd ../../.. mkdir duniter_release +mkdir duniter_release\nodejs call 7z x %NW_GZ% -move %NW% %cd%\duniter_release\nw -mkdir %cd%\duniter_release\sources -xcopy %SRC%\gui\* %cd%\duniter_release\nw\ /s /e -xcopy %SRC%\* %cd%\duniter_release\sources\ /s /e -iscc %cd%\duniter_release\sources\release\arch\windows\duniter.iss /DROOT_PATH=%cd%\duniter_release +xcopy %NW%\* %cd%\duniter_release\ /s /e /Y +xcopy %SRC%\gui\* %cd%\duniter_release\ /s /e /Y +xcopy %SRC%\* %cd%\duniter_release\ /s /e /Y +xcopy %NODE%\* %cd%\duniter_release\nodejs\ /s /e /Y +cd duniter_release +powershell -Command "(Get-Content package.json) | foreach-object {$_ -replace '\"main\": \"index.js\",','\"main\": \"index.html\",' } | Set-Content package.json2" +move /y package.json2 package.json +cd .. +iscc C:\vagrant\duniter.iss /DROOT_PATH=%cd%\duniter_release move %cd%\duniter_release\Duniter.exe C:\vagrant\duniter-desktop-%DUNITER_TAG%-windows-x64.exe echo "Build done: binary available at duniter-desktop-%DUNITER_TAG%-windows-x64.exe" diff --git a/release/arch/windows/duniter.iss b/release/arch/windows/duniter.iss index f300d28139cd30e1c5f6c7409d3ae14bb15dcca5..60e180a2a69a9ee53972945a144055fcd54ca2e0 100644 --- a/release/arch/windows/duniter.iss +++ b/release/arch/windows/duniter.iss @@ -8,7 +8,7 @@ #endif #define MyAppSrc ROOT_PATH -#define MyAppExe ROOT_PATH + "\nw\" + MyAppExeName +#define MyAppExe ROOT_PATH + "\" + MyAppExeName #pragma message MyAppSrc #if !FileExists(MyAppExe) @@ -32,7 +32,7 @@ OutputDir={#ROOT_PATH} OutputBaseFilename={#MyAppName} Compression=lzma SolidCompression=yes -UninstallDisplayIcon={app}\nw\{#MyAppExeName} +UninstallDisplayIcon={app}\{#MyAppExeName} ArchitecturesInstallIn64BitMode=x64 [Languages] @@ -43,23 +43,22 @@ Name: "french"; MessagesFile: "compiler:Languages\French.isl" Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] -Source: "{#MyAppSrc}\nw\*"; DestDir: "{app}\nw\"; Flags: ignoreversion recursesubdirs -Source: "{#MyAppSrc}\sources\*"; DestDir: "{app}\sources\"; Flags: ignoreversion recursesubdirs +Source: "{#MyAppSrc}\*"; DestDir: "{app}\"; Flags: ignoreversion recursesubdirs [Icons] -Name: "{group}\{#MyAppName}"; IconFilename: "{app}\nw\duniter.ico"; Filename: "{app}\nw\{#MyAppExeName}" +Name: "{group}\{#MyAppName}"; IconFilename: "{app}\duniter.ico"; Filename: "{app}\{#MyAppExeName}" Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" -Name: "{commondesktop}\{#MyAppName}"; IconFilename: "{app}\nw\duniter.ico"; Filename: "{app}\nw\{#MyAppExeName}"; Tasks: desktopicon +Name: "{commondesktop}\{#MyAppName}"; IconFilename: "{app}\duniter.ico"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon [Run] -Filename: "{app}\nw\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{E01B0960-74D2-8ACD-734E-8B3CB033B07F} -LicenseFile="{#MyAppSrc}\sources\LICENSE" +LicenseFile="{#MyAppSrc}\LICENSE" [Code]