--- /dev/null
+; 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
--- /dev/null
+<?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
$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
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