From 2d333cdc7e5a65ac5722b1274880903b40416ef7 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 8 Mar 2018 10:41:50 +0000 Subject: [PATCH] wip #819 @10 --- .../class.ws.packager.mac.exe.html.php | 45 +++++++++++++++++++ inc/ws/Util/packager/class.ws.packager.php | 1 - .../class.ws.packager.win.exe.html.php | 43 ++++++++++++++---- 3 files changed, 79 insertions(+), 10 deletions(-) diff --git a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php index e1e0edef5..b94eb073e 100644 --- a/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php @@ -2,6 +2,7 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { protected $nwplatform = 'osx64'; + protected $nwversion='0.29.0'; public function __construct($book_id) { parent::__construct($book_id); @@ -22,4 +23,48 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { $this->postPackage(); return $res; } + + protected function preparePackage() { + $this->initTempDir(); + $this->copyFluidbookFiles(); + $this->makeJSON(); + + $this->buildPath = WS_PACKAGER . '/nwbuild/' . $this->version . '/' . $this->book_id; + if (!file_exists($this->buildPath)) { + mkdir($this->buildPath, 0777, true); + } + +// $cl = new CubeIT_CommandLine('/usr/local/web2exe/web2exe-linux'); +// $cl->setPath(CONVERTER_PATH); +// $cl->setEnv('TMPDIR', '/home/extranetfiles/tmp'); +// $cl->setLongArgumentSeparator(' '); +// $cl->setArg('export-to', $this->nwplatform); +// $cl->setArg('uncompressed-folder'); +// $cl->setArg('title', $this->appName); +// $cl->setArg('output-dir', $this->buildPath); +// $cl->setArg('nw-version', $this->nwversion); +// $cl->setArg('main', 'index.html'); +// $cl->setArg('name', $this->exeName); +// $cl->setArg('mac-icon', $this->vdir . 'icon.icns'); +// $cl->setArg('exe-icon', $this->vdir . 'icon.ico'); +// $cl->setArg('icon', $this->vdir . 'icon.png'); +// $cl->setArg('width', 1024); +// $cl->setArg('height', 768); +// $cl->setArg('app-name', $this->exeName); +// $cl->setArg('version', '1.0.' . time()); +// $cl->setArg('id', 'com.fluidbook.' . $this->book_id); +// $cl->setArg('verbose'); +// $cl->setArg(null, $this->vdir); +// $cl->execute(); + + $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild'); + $cl->setPath(CONVERTER_PATH); + $cl->setArg('p', $this->nwplatform); + $cl->setArg('o', $this->buildPath); + $cl->setArg('winIco', $this->vdir . '/icon.ico'); + $cl->setArg('macIcns', $this->vdir . '/icon.icns'); + $cl->setArg(null, $this->vdir); + $cl->execute(); + $cl->debug(); + } } diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index d7634ea48..a650591a5 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -175,7 +175,6 @@ class wsPackager { $rename = true; } - $zip = new cubeCommandLine('zip'); $zip->cd($this->getFinalPackageDir()); $zip->setArg(null, $zipfile); diff --git a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php index 892cf2834..09cd6e676 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.exe.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.exe.html.php @@ -5,7 +5,8 @@ class wsPackagerWinEXEHTML extends wsPackager { protected $exeName; protected $appName; protected $buildPath; - protected $nwplatform = 'win32'; + protected $nwplatform = 'windows-x32'; + protected $nwversion = '0.29.0'; public function __construct($book_id) { parent::__construct($book_id, null, true, true); @@ -26,8 +27,6 @@ class wsPackagerWinEXEHTML extends wsPackager { protected function preparePackage() { parent::preparePackage(); $this->copyFluidbookFiles(); - //$this->copyOtherFiles(array('Fluidbook.exe' => $this->exeName)); - $this->makeJSON(); $this->buildPath = WS_PACKAGER . '/nwbuild/' . $this->version . '/' . $this->book_id; @@ -35,14 +34,40 @@ class wsPackagerWinEXEHTML extends wsPackager { mkdir($this->buildPath, 0777, true); } - $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild'); + $cl = new CubeIT_CommandLine('/usr/local/web2exe/web2exe-linux'); $cl->setPath(CONVERTER_PATH); - $cl->setArg('p', $this->nwplatform); - $cl->setArg('o', $this->buildPath); - $cl->setArg('winIco', $this->vdir . '/icon.ico'); - $cl->setArg('macIcns', $this->vdir . '/icon.icns'); + $cl->setEnv('TMPDIR', '/home/extranetfiles/tmp'); + $cl->setLongArgumentSeparator(' '); + $cl->setArg('export-to', $this->nwplatform); + + $cl->setArg('uncompressed-folder'); + $cl->setArg('title', $this->appName); + $cl->setArg('output-dir', $this->buildPath); + $cl->setArg('nw-version', $this->nwversion); + $cl->setArg('sdk-build'); + $cl->setArg('main', 'index.html'); + $cl->setArg('name', $this->exeName); + $cl->setArg('mac-icon', $this->vdir . 'icon.icns'); + $cl->setArg('exe-icon', $this->vdir . 'icon.ico'); + $cl->setArg('icon', $this->vdir . 'icon.png'); + $cl->setArg('width', 1024); + $cl->setArg('height', 768); + $cl->setArg('app-name', $this->exeName); + $cl->setArg('version', '1.0.' . time()); + $cl->setArg('id', 'com.fluidbook.' . $this->book_id); + $cl->setArg('verbose'); $cl->setArg(null, $this->vdir); $cl->execute(); + + // $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild'); + // $cl->setPath(CONVERTER_PATH); + // $cl->setArg('p', $this->nwplatform); + // $cl->setArg('o', $this->buildPath); + // $cl->setArg('winIco', $this->vdir . '/icon.ico'); + // $cl->setArg('macIcns', $this->vdir . '/icon.icns'); + // $cl->setArg(null, $this->vdir); + // $cl->execute(); + // $cl->debug(); } function makeJSON() { @@ -51,7 +76,7 @@ class wsPackagerWinEXEHTML extends wsPackager { 'window' => ['height' => 768, 'width' => 1024, 'title' => $this->appName, 'id' => 'main', 'icon' => 'icon.png', 'mac_icon' => 'icon.icns'] ]; $pngIcon = $this->vdir . '/icon.png'; - $winIcon = $this->vdir . '/icon.icon'; + $winIcon = $this->vdir . '/icon.ico'; if ($this->theme->parametres->favicon == '') { $png = WS_COMPILE_ASSETS . '/fluidbook.png'; $ico = WS_COMPILE_ASSETS . '/fluidbook.ico'; -- 2.39.5