]> _ Git - cubeextranet.git/commitdiff
wip #819 @0:20
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 8 Mar 2018 15:09:41 +0000 (15:09 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Thu, 8 Mar 2018 15:09:41 +0000 (15:09 +0000)
fluidbook/compile/html.nsi [new file with mode: 0644]
inc/ws/Util/packager/class.ws.packager.win.cd.html.php [new file with mode: 0644]
inc/ws/Util/packager/class.ws.packager.win.inst.html.php

diff --git a/fluidbook/compile/html.nsi b/fluidbook/compile/html.nsi
new file mode 100644 (file)
index 0000000..8341791
--- /dev/null
@@ -0,0 +1,74 @@
+; Fluidbook\r
+;--------------------------------\r
+\r
+!define FLUIDBOOKNAME "$name"\r
+!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\$fname"\r
+\r
+; The name of the installer\r
+Name "${FLUIDBOOKNAME}"\r
+\r
+; The file to write\r
+OutFile "$output"\r
+\r
+; The default installation directory\r
+InstallDir $LOCALAPPDATA\$fname\r
+\r
+; Request application privileges for Windows Vista\r
+RequestExecutionLevel user\r
+\r
+; Style\r
+XPStyle on\r
+\r
+Icon "$favicon"\r
+\r
+; not released\r
+;TargetMinimalOS 5.0\r
+\r
+; Langues\r
+LoadLanguageFile "$nsisdir/Contrib/Language files/$lang.nlf"\r
+\r
+; Pages\r
+\r
+Page directory\r
+Page instfiles\r
+\r
+; Compression\r
+SetCompress off\r
+\r
+;--------------------------------\r
+\r
+; The stuff to install\r
+Section "" ;No components page, name is not important\r
+\r
+  ; Set output path to the installation directory.\r
+  SetOutPath $INSTDIR\r
+\r
+  ; Put file there\r
+  File /r "$fdir\*"\r
+\r
+  ; Create shortcut\r
+  CreateShortCut "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\$nwplatform\package.nw\icon.ico"\r
+  CreateShortCut "$DESKTOP\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\$nwplatform\package.nw\icon.ico"\r
+\r
+  WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayName" "${FLUIDBOOKNAME}"\r
+  WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\$nwplatform\package.nw\icon.ico$\""\r
+  WriteRegStr HKCU "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\""\r
+  WriteRegDWord HKCU "${REG_UNINSTALL}" "NoModify" 1\r
+  WriteRegDWord HKCU "${REG_UNINSTALL}" "NoRepair" 1\r
+  WriteRegStr HKCU "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\""\r
+\r
+  WriteUninstaller "$INSTDIR\Uninstall.exe"\r
+\r
+  ExecShell "" "$INSTDIR\$fname.exe"\r
+SectionEnd\r
+\r
+Section "Uninstall"\r
+DeleteRegKey HKCU "${REG_UNINSTALL}"\r
+Delete "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk"\r
+Delete "$DESKTOP\${FLUIDBOOKNAME}.lnk"\r
+Delete "$INSTDIR\Uninstall.exe"\r
+RMDIR /r /REBOOTOK $INSTDIR\r
+SetRebootFlag false\r
+SectionEnd\r
+\r
+\r
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
new file mode 100644 (file)
index 0000000..c761b55
--- /dev/null
@@ -0,0 +1,32 @@
+<?php\r
+\r
+class wsPackagerWinCDHTML extends wsPackagerWinEXEHTML {\r
+\r
+       public function __construct($book_id) {\r
+               parent::__construct($book_id);\r
+               $this->book->parametres->alwaysHTML5 = true;\r
+               $this->version = 'win-cd-html';\r
+       }\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
+\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
+               $inf = $this->replaceContents($inf, $toReplace);\r
+               file_put_contents($this->vdir . 'autorun.inf', utf8_decode($inf));\r
+       }\r
+\r
+       protected function postPackage() {\r
+\r
+       }\r
+\r
+}\r
index 0318b771f44a86a089ab585b313c5a437c25e063..6204072df577f740aa803776f40f52a8164658cb 100644 (file)
@@ -35,13 +35,14 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML {
                $fname = $this->exeName;\r
                $title = $this->appName;\r
 \r
-               $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi');\r
+               $nsi = file_get_contents(WS_COMPILE_ASSETS . '/html.nsi');\r
                $nsi = str_replace('$name', utf8_decode($title), $nsi);\r
                $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi);\r
                $nsi = str_replace('$fname', $fname, $nsi);\r
                $nsi = str_replace('$fdir', $winvdir, $nsi);\r
                $nsi = str_replace('$titre', utf8_decode($title), $nsi);\r
                $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi);\r
+               $nsi = str_replace('$nwplatform', $this->nwplatform, $nsi);\r
                $nsi = str_replace('$nsisdir', '/usr/share/nsis', $nsi);\r
                $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi);\r
                $favicon = $this->vdir . 'data/favicon.ico';\r
@@ -56,7 +57,7 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML {
        public function makePackage($zip) {\r
                $this->preparePackage();\r
 \r
-               $tmp = cubeFiles::tempnam();\r
+               $tmp = cubeFiles::tempnam() . '.nsi';\r
                file_put_contents($tmp, $this->nsi);\r
                $makensis = new CubeIT_CommandLine('makensis');\r
                $makensis->setArg(null, $tmp);\r