From 19a4ca76ca51b67a648522c9a41493d310d268d9 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Thu, 8 Mar 2018 16:02:09 +0000 Subject: [PATCH] wip #819 @0:50 --- fluidbook/compile/html.inf | 5 +++ .../class.ws.packager.mac.exe.html.php | 35 ++++++------------- .../class.ws.packager.win.cd.html.php | 14 ++++---- 3 files changed, 23 insertions(+), 31 deletions(-) create mode 100644 fluidbook/compile/html.inf diff --git a/fluidbook/compile/html.inf b/fluidbook/compile/html.inf new file mode 100644 index 000000000..70170bce6 --- /dev/null +++ b/fluidbook/compile/html.inf @@ -0,0 +1,5 @@ +[autorun] +label=$title +icon=$nwplatform\package.nw\icon.ico +open=$exe +action=$title \ No newline at end of file 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 b94eb073e..c2be4bca2 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,7 +2,7 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { protected $nwplatform = 'osx64'; - protected $nwversion='0.29.0'; + protected $nwversion = '0.29.0'; public function __construct($book_id) { parent::__construct($book_id); @@ -19,11 +19,19 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { $p = $this->getFinalPackageDir() . '/' . $item; `rm -rf "$p"`; } - $res = $this->zip(null); + if ($zip) { + $res = $this->zip(null); + } else { + $res = $this->getFinalPackageDir(); + } $this->postPackage(); return $res; } + public function getFinalPackageDir() { + return parent::getFinalPackageDir() . $this->nwplatform . '/'; + } + protected function preparePackage() { $this->initTempDir(); $this->copyFluidbookFiles(); @@ -34,29 +42,6 @@ class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML { 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); diff --git a/inc/ws/Util/packager/class.ws.packager.win.cd.html.php b/inc/ws/Util/packager/class.ws.packager.win.cd.html.php index c761b5556..d1b37205f 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.cd.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.cd.html.php @@ -10,21 +10,23 @@ class wsPackagerWinCDHTML extends wsPackagerWinEXEHTML { protected function preparePackage() { parent::preparePackage(); - - $this->copyOtherFiles(array( - 'fluidbook.ico' => 'data/' . $this->nwplatform . '/fluidbook.ico', - 'autorun.inf', - 'Fluidbook.app.zip')); $this->replaceAutorun(); + + // Package mac app + $mac = wsPackager::package($this->book_id, 'mac-exe-html', false) . '/' . $this->exeName . '.app'; + $dest = $this->getFinalPackageDir(); + `cp -r $mac $dest`; } public function replaceAutorun() { $inf = file_get_contents($this->vdir . 'autorun.inf'); - $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName . '.exe'); + $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName . '.exe', 'nwplatform' => $this->nwplatform); $inf = $this->replaceContents($inf, $toReplace); file_put_contents($this->vdir . 'autorun.inf', utf8_decode($inf)); + $this->copy($this->vdir . 'autorun.inf', $this->getFinalPackageDir() . '/autorun.inf'); } + protected function postPackage() { } -- 2.39.5