\r
class wsPackagerMacEXEHTML extends wsPackagerWinEXEHTML {\r
protected $nwplatform = 'osx64';\r
- protected $nwversion='0.29.0';\r
+ protected $nwversion = '0.29.0';\r
\r
public function __construct($book_id) {\r
parent::__construct($book_id);\r
$p = $this->getFinalPackageDir() . '/' . $item;\r
`rm -rf "$p"`;\r
}\r
- $res = $this->zip(null);\r
+ if ($zip) {\r
+ $res = $this->zip(null);\r
+ } else {\r
+ $res = $this->getFinalPackageDir();\r
+ }\r
$this->postPackage();\r
return $res;\r
}\r
\r
+ public function getFinalPackageDir() {\r
+ return parent::getFinalPackageDir() . $this->nwplatform . '/';\r
+ }\r
+\r
protected function preparePackage() {\r
$this->initTempDir();\r
$this->copyFluidbookFiles();\r
mkdir($this->buildPath, 0777, true);\r
}\r
\r
-// $cl = new CubeIT_CommandLine('/usr/local/web2exe/web2exe-linux');\r
-// $cl->setPath(CONVERTER_PATH);\r
-// $cl->setEnv('TMPDIR', '/home/extranetfiles/tmp');\r
-// $cl->setLongArgumentSeparator(' ');\r
-// $cl->setArg('export-to', $this->nwplatform);\r
-// $cl->setArg('uncompressed-folder');\r
-// $cl->setArg('title', $this->appName);\r
-// $cl->setArg('output-dir', $this->buildPath);\r
-// $cl->setArg('nw-version', $this->nwversion);\r
-// $cl->setArg('main', 'index.html');\r
-// $cl->setArg('name', $this->exeName);\r
-// $cl->setArg('mac-icon', $this->vdir . 'icon.icns');\r
-// $cl->setArg('exe-icon', $this->vdir . 'icon.ico');\r
-// $cl->setArg('icon', $this->vdir . 'icon.png');\r
-// $cl->setArg('width', 1024);\r
-// $cl->setArg('height', 768);\r
-// $cl->setArg('app-name', $this->exeName);\r
-// $cl->setArg('version', '1.0.' . time());\r
-// $cl->setArg('id', 'com.fluidbook.' . $this->book_id);\r
-// $cl->setArg('verbose');\r
-// $cl->setArg(null, $this->vdir);\r
-// $cl->execute();\r
-\r
$cl = new CubeIT_CommandLine('/data/extranet/node_modules/nw-builder/bin/nwbuild');\r
$cl->setPath(CONVERTER_PATH);\r
$cl->setArg('p', $this->nwplatform);\r
\r
protected function preparePackage() {\r
parent::preparePackage();\r
-\r
- $this->copyOtherFiles(array(\r
- 'fluidbook.ico' => 'data/' . $this->nwplatform . '/fluidbook.ico',\r
- 'autorun.inf',\r
- 'Fluidbook.app.zip'));\r
$this->replaceAutorun();\r
+\r
+ // Package mac app\r
+ $mac = wsPackager::package($this->book_id, 'mac-exe-html', false) . '/' . $this->exeName . '.app';\r
+ $dest = $this->getFinalPackageDir();\r
+ `cp -r $mac $dest`;\r
}\r
\r
public function replaceAutorun() {\r
$inf = file_get_contents($this->vdir . 'autorun.inf');\r
- $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName . '.exe');\r
+ $toReplace = array('title' => $this->book->parametres->title, 'exe' => $this->exeName . '.exe', 'nwplatform' => $this->nwplatform);\r
$inf = $this->replaceContents($inf, $toReplace);\r
file_put_contents($this->vdir . 'autorun.inf', utf8_decode($inf));\r
+ $this->copy($this->vdir . 'autorun.inf', $this->getFinalPackageDir() . '/autorun.inf');\r
}\r
\r
+\r
protected function postPackage() {\r
\r
}\r