Skip to content

Commit

Permalink
Fix: Duniter was broken on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
c-geek committed May 31, 2016
1 parent b5937dc commit f94dfc1
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 58 deletions.
4 changes: 2 additions & 2 deletions .gitmodules
@@ -1,3 +1,3 @@
[submodule "ui"]
path = ui
[submodule "web-ui"]
path = web-ui
url = https://github.com/duniter/duniter-ui.git
2 changes: 1 addition & 1 deletion app/lib/directory.js
Expand Up @@ -6,7 +6,7 @@ var path = require('path');
var cfs = require('./cfs');
var Q = require('q');
var qfs = require('q-io/fs');
var sqlite3 = require("sqlite3").verbose();
var sqlite3 = require("sqlite3b").verbose();

const DEFAULT_DOMAIN = "duniter_default";
const DEFAULT_HOME = (process.platform == 'win32' ? process.env.USERPROFILE : process.env.HOME) + '/.config/duniter/';
Expand Down
2 changes: 1 addition & 1 deletion app/lib/streams/webmin.js
Expand Up @@ -13,7 +13,7 @@ module.exports = function(dbConf, overConf, interfaces, httpLogs) {

var webminCtrl = require('../../controllers/webmin.controller')(dbConf, overConf);

var fullPath = path.join(__dirname, '../../../ui/public');
var fullPath = path.join(__dirname, '../../../web-ui/public');

let httpLayer = network.createServersAndListen('Duniter web admin', interfaces, httpLogs, fullPath, (app, httpMethods) => {

Expand Down
106 changes: 53 additions & 53 deletions appveyor.yml
Expand Up @@ -20,59 +20,59 @@ test_script:
build: off

after_test:
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ui
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] git submodule update
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm install
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ..
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] rd /s /q %APPDATA%\..\Local\NuGet\Cache
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] choco install -y 7zip InnoSetup
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set PATH="C:\Program Files\7-Zip";"C:\Program Files (x86)\Inno Setup 5";%PATH%
# GUI Version
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set SRC=%cd%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] echo %SRC%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] copy misc\MSVSVersion.py %APPDATA%\npm\node_modules\nw-gyp\gyp\pylib\gyp\MSVSVersion.py
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set NW_VERSION=0.14.5
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set NW_RELEASE=v0.14.5
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] echo %NW_RELEASE%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd node_modules/wotb
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm install --build-from-source
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\wotb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\wotb.node /Y
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ../naclb
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm install --build-from-source
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\naclb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\naclb.node /Y
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ../scryptb
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm install --build-from-source
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\scryptb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\scryptb.node /Y
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ../sqlite3
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm install --build-from-source
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] mkdir %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] copy %cd%\lib\binding\node-webkit-%NW_RELEASE%-win32-x64\node_sqlite3.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\node_sqlite3.node /Y
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ../..
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] npm prune --production
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] cd ..
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] mkdir duniter_release
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set NW=nwjs-%NW_RELEASE%-win-x64
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] echo %NW%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] set NW_GZ=%NW%.zip
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] echo %NW_GZ%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] curl -fS -o %NW_GZ% https://s3.eu-central-1.amazonaws.com/duniter/binaries/%NW_GZ%
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] 7z x %NW_GZ% 1> null
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] move %NW% %cd%\duniter_release\nw
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] mkdir %cd%\duniter_release\sources
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] xcopy %SRC%\gui\* %cd%\duniter_release\nw\ /s /e
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] xcopy %SRC%\* %cd%\duniter_release\sources\ /s /e
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] rd /s /q %cd%\duniter_release\sources\ui\package\node_modules
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] rd /s /q %cd%\duniter_release\sources\ui\package\bower_components
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] iscc %cd%\duniter_release\sources\duniter.iss /DROOT_PATH=%cd%\duniter_release
- if [%APPVEYOR_REPO_TAG_NAME%] neq [] move %cd%\duniter_release\Duniter.exe %cd%\duniter\duniter-%APPVEYOR_REPO_TAG_NAME%-windows-x64.exe
- powershell .\\ci\\appveyor\\inno_setup.ps1
- rd /s /q %APPDATA%\..\Local\NuGet\Cache
- set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH%
- git submodule init
- git submodule update
- cd "web-ui"
- dir
- npm install
- cd ..
- set SRC=%cd%
- echo %SRC%
- copy misc\MSVSVersion.py %APPDATA%\npm\node_modules\nw-gyp\gyp\pylib\gyp\MSVSVersion.py
- set NW_VERSION=0.14.5
- set NW_RELEASE=v0.14.5
- echo %NW_RELEASE%
- cd node_modules/wotb
- npm install --build-from-source
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\wotb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\wotb.node /Y
- cd ../naclb
- npm install --build-from-source
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\naclb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\naclb.node /Y
- cd ../scryptb
- npm install --build-from-source
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\scryptb.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\scryptb.node /Y
- cd ../sqlite3b
- npm install --build-from-source
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 configure
- node-pre-gyp --runtime=node-webkit --target=%NW_VERSION% --msvs_version=2015 build
- copy %cd%\lib\binding\Release\node-webkit-%NW_RELEASE%-win32-x64\node_sqlite3.node %cd%\lib\binding\Release\node-v%ADDON_VERSION%-win32-x64\node_sqlite3.node /Y
- cd ../..
- npm prune --production
- cd ..
- mkdir duniter_release
- set NW=nwjs-%NW_RELEASE%-win-x64
- echo %NW%
- set NW_GZ=%NW%.zip
- echo %NW_GZ%
- curl -fS -o %NW_GZ% https://s3.eu-central-1.amazonaws.com/duniter/binaries/%NW_GZ%
- 7z x %NW_GZ% 1> null
- 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
- rd /s /q %cd%\duniter_release\sources\web-ui\node_modules
- rd /s /q %cd%\duniter_release\sources\web-ui\bower_components
- iscc %cd%\duniter_release\sources\duniter.iss /DROOT_PATH=%cd%\duniter_release
- move %cd%\duniter_release\Duniter.exe %cd%\duniter\duniter-%APPVEYOR_REPO_TAG_NAME%-windows-x64.exe

artifacts:
- path: duniter*.exe
Expand Down
6 changes: 6 additions & 0 deletions ci/appveyor/inno_setup.ps1
@@ -0,0 +1,6 @@
$exePath = "$env:USERPROFILE\innosetup-5.5.9-unicode.exe"
Write-Host "Downloading InnoSetup 5.5.9..."
(New-Object Net.WebClient).DownloadFile('http://files.jrsoftware.org/is/5/innosetup-5.5.9-unicode.exe', $exePath)
Write-Host "Installing..."
cmd /c start /wait $exePath /silent
Write-Host "Installed InnoSetup 5.5.9" -ForegroundColor Green
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -60,7 +60,7 @@
"request": "2.31.0",
"scryptb": "6.0.4",
"sha1": "1.1.0",
"sqlite3": "3.1.4",
"sqlite3b": "3.1.2",
"superagent": "1.4.0",
"tweetnacl": "0.14.1",
"underscore": "1.8.3",
Expand Down

0 comments on commit f94dfc1

Please sign in to comment.