From 1bf65ab2cbf66809e1bd4c4adc86c45b017f4379 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 6 Mar 2018 17:48:36 +0000 Subject: [PATCH] wip #819 @1:10 --- inc/ws/Controlleur/class.ws.ajax.php | 6 ++++- .../class.ws.packager.mac.exe.html.php | 25 +++++++++++++++++++ inc/ws/Util/packager/class.ws.packager.php | 1 + .../class.ws.packager.win.exe.html.php | 5 ++-- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 inc/ws/Util/packager/class.ws.packager.mac.exe.html.php diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index 50f3d0e45..bb9ba2e7f 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -969,7 +969,11 @@ class wsAjax extends cubeAjax { 'win-html' => 'zip', 'mac-exe' => 'zip', 'win-cd' => 'zip', - 'phonegap' => 'zip'); + 'phonegap' => 'zip', + 'mac-exe-html' => 'zip', + 'win-exe-html' => 'zip', + 'win-inst-html' => 'zip', + 'win-cd-html' => 'zip'); $defaultVersion = isset($_POST['version']) ? $_POST['version'] : 'online'; $version = '' . __('Version') . '' . form::combo('version', wsUrl::getFluidbookVersions(true), $defaultVersion) . ''; 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 new file mode 100644 index 000000000..e1e0edef5 --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.mac.exe.html.php @@ -0,0 +1,25 @@ +version = 'mac-exe-inst'; + $this->book->parametres->alwaysHTML5 = true; + + $this->exeName = cubeText::str2URL(mb_substr($this->book->parametres->title, 0, 30)); + } + + public function makePackage($zip) { + $this->preparePackage(); + $toDelete = ['chromedriver', 'credits.html', 'minidump_stackwalk', 'nwjc', 'payload']; + foreach ($toDelete as $item) { + $p = $this->getFinalPackageDir() . '/' . $item; + `rm -rf "$p"`; + } + $res = $this->zip(null); + $this->postPackage(); + return $res; + } +} diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index dfbddbd07..d7634ea48 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -179,6 +179,7 @@ class wsPackager { $zip = new cubeCommandLine('zip'); $zip->cd($this->getFinalPackageDir()); $zip->setArg(null, $zipfile); + $zip->setArg('symlinks'); $zip->setArg('0'); $zip->setArg('r'); $zip->setArg('u'); 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 200e543d2..abe424dba 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,6 +5,7 @@ class wsPackagerWinEXEHTML extends wsPackager { protected $exeName; protected $appName; protected $buildPath; + protected $nwplatform = 'win32'; public function __construct($book_id) { parent::__construct($book_id, null, true, true); @@ -36,7 +37,7 @@ class wsPackagerWinEXEHTML extends wsPackager { $cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild'); $cl->setPath(CONVERTER_PATH); - $cl->setArg('p', 'win32'); + $cl->setArg('p', $this->nwplatform); $cl->setArg('o', $this->buildPath); $cl->setArg(null, $this->vdir); $cl->execute(); @@ -58,7 +59,7 @@ class wsPackagerWinEXEHTML extends wsPackager { } public function getFinalPackageDir() { - return $this->buildPath . '/' . $this->exeName . '/win32'; + return $this->buildPath . '/' . $this->exeName . '/' . $this->nwplatform; } protected function compile() { -- 2.39.5