From d0d362c0ebb0ca220b59f439e75f1f70dea16e98 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 22 Oct 2018 16:34:35 +0000 Subject: [PATCH] done #2004 @1 --- fluidbook/compile/autorun-html.inf | 5 ++++ inc/commons/class.common.tools.php | 1 - inc/ws/Controlleur/class.ws.url.php | 6 ++-- .../class.ws.packager.win.cd.html.php | 28 +++++++++++-------- 4 files changed, 25 insertions(+), 15 deletions(-) create mode 100644 fluidbook/compile/autorun-html.inf diff --git a/fluidbook/compile/autorun-html.inf b/fluidbook/compile/autorun-html.inf new file mode 100644 index 000000000..fef2d1d21 --- /dev/null +++ b/fluidbook/compile/autorun-html.inf @@ -0,0 +1,5 @@ +[autorun] +label=$title +icon=$exe +open=$exe +action=$title \ No newline at end of file diff --git a/inc/commons/class.common.tools.php b/inc/commons/class.common.tools.php index 126adb80c..ea3e48360 100644 --- a/inc/commons/class.common.tools.php +++ b/inc/commons/class.common.tools.php @@ -557,7 +557,6 @@ class commonTools public static function pngToIcns($file, $res) { if (!file_exists($file)) { - die('!!!!'); return; } $icns = array(128, 256, 512); diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 3d39dfabb..1bdb53731 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -310,8 +310,8 @@ class wsUrl $res .= ''; - $contents=$collection->contents; - $theme=$collection->theme; + $contents = $collection->contents; + $theme = $collection->theme; foreach ($langs as $l) { $e = explode('_', $l); @@ -552,7 +552,7 @@ class wsUrl $versions['mac-exe'] = array('title' => __('Version offline') . ' - ' . __('Exécutable Mac OS X') . ' (Flash)', 'icon' => cubeMedia::image(IMG . '/macos.png')); $versions['mac-exe-html'] = array('title' => __('Version offline') . ' - ' . __('Exécutable Mac OS X') . ' (HTML)', 'icon' => cubeMedia::image(IMG . '/macos.png')); $versions['win-cd'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB') . ' (Flash)', 'icon' => cubeMedia::silk('cd.png')); - //$versions['win-cd-html'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB') . ' (HTML)', 'icon' => cubeMedia::silk('cd.png')); + $versions['win-cd-html'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB') . ' (HTML)', 'icon' => cubeMedia::silk('cd.png')); $versions['win-html'] = array('title' => __('Version offline') . ' - ' . __('HTML') . ' (' . __('Non adaptée à l\'installation sur un serveur web') . ')', 'icon' => cubeMedia::silk('cd.png')); if ($droits->admin) { 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 d1b37205f..26b6d076b 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 @@ -1,33 +1,39 @@ book->parametres->alwaysHTML5 = true; $this->version = 'win-cd-html'; } - protected function preparePackage() { + protected function preparePackage() + { parent::preparePackage(); $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`; + $win = ROOT . wsPackager::package($this->book_id, 'win-inss-html', false, false); + + $dest = $this->getFinalPackageDir() . "/" . $this->exeName . '.exe'; + $cp = "cp $win $dest"; + `$cp`; } - public function replaceAutorun() { - $inf = file_get_contents($this->vdir . 'autorun.inf'); + public function replaceAutorun() + { + $inf = file_get_contents(WS_COMPILE_ASSETS . '/autorun-html.inf'); $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'); + file_put_contents($this->getFinalPackageDir() . '/autorun.inf', utf8_decode($inf)); } - protected function postPackage() { + protected function postPackage() + { } -- 2.39.5