From e7a52207c91a86d37c56f5747de31cb1138cb0d0 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Fri, 23 Mar 2018 10:50:22 +0000 Subject: [PATCH] fix #819 @1.5 --- fluidbook/compile/html-silent.nsi | 78 +++++++++++++++++++ fluidbook/compile/html.nsi | 46 ++++++----- inc/ws/Controlleur/class.ws.url.php | 25 +++--- inc/ws/Util/packager/_common.php | 1 + inc/ws/Util/packager/class.ws.packager.php | 2 + .../class.ws.packager.win.inst.html.php | 4 +- ...class.ws.packager.win.inst.silent.html.php | 11 +++ 7 files changed, 126 insertions(+), 41 deletions(-) create mode 100644 fluidbook/compile/html-silent.nsi create mode 100644 inc/ws/Util/packager/class.ws.packager.win.inst.silent.html.php diff --git a/fluidbook/compile/html-silent.nsi b/fluidbook/compile/html-silent.nsi new file mode 100644 index 000000000..6f3810fb0 --- /dev/null +++ b/fluidbook/compile/html-silent.nsi @@ -0,0 +1,78 @@ +; Fluidbook +;-------------------------------- + +!define FLUIDBOOKNAME "$name" +!define REG_UNINSTALL "Software\Microsoft\Windows\CurrentVersion\Uninstall\$fname" + +; The name of the installer +Name "${FLUIDBOOKNAME}" + +; The file to write +OutFile "$output" + +; The default installation directory +InstallDir $LOCALAPPDATA\$fname + +; Request application privileges for Windows Vista +RequestExecutionLevel user + +; Style +XPStyle on + +Icon "$favicon" + +; not released +;TargetMinimalOS 5.0 + +; Langues +LoadLanguageFile "$nsisdir/Contrib/Language files/$lang.nlf" + +; Pages + +Page directory +Page instfiles + +; Compression +SetCompress off + +;-------------------------------- + +Function .onInit + SetSilent silent +FunctionEnd + +; The stuff to install +Section "" ;No components page, name is not important + ; Set output path to the installation directory. + SetOutPath $INSTDIR + + ; Put file there + SetOverwrite ifnewer + File /a /r "$fdir\*" + + ; Create shortcut + CreateShortCut "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\package.nw\icon.ico" + CreateShortCut "$DESKTOP\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\package.nw\icon.ico" + + WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayName" "${FLUIDBOOKNAME}" + WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\package.nw\icon.ico$\"" + WriteRegStr HKCU "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\"" + WriteRegDWord HKCU "${REG_UNINSTALL}" "NoModify" 1 + WriteRegDWord HKCU "${REG_UNINSTALL}" "NoRepair" 1 + WriteRegStr HKCU "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + + WriteUninstaller "$INSTDIR\Uninstall.exe" + + ExecShell "" "$INSTDIR\$fname.exe" +SectionEnd + +Section "Uninstall" + DeleteRegKey HKCU "${REG_UNINSTALL}" + Delete "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" + Delete "$DESKTOP\${FLUIDBOOKNAME}.lnk" + Delete "$INSTDIR\Uninstall.exe" + RMDIR /r /REBOOTOK $INSTDIR + SetRebootFlag false +SectionEnd + + diff --git a/fluidbook/compile/html.nsi b/fluidbook/compile/html.nsi index 834179162..95790fca9 100644 --- a/fluidbook/compile/html.nsi +++ b/fluidbook/compile/html.nsi @@ -35,40 +35,38 @@ Page instfiles ; Compression SetCompress off -;-------------------------------- - ; The stuff to install Section "" ;No components page, name is not important + ; Set output path to the installation directory. + SetOutPath $INSTDIR - ; Set output path to the installation directory. - SetOutPath $INSTDIR - - ; Put file there - File /r "$fdir\*" + ; Put file there + SetOverwrite ifnewer + File /a /r "$fdir\*" - ; Create shortcut - CreateShortCut "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\$nwplatform\package.nw\icon.ico" - CreateShortCut "$DESKTOP\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\$nwplatform\package.nw\icon.ico" + ; Create shortcut + CreateShortCut "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\package.nw\icon.ico" + CreateShortCut "$DESKTOP\${FLUIDBOOKNAME}.lnk" "$INSTDIR\$fname.exe" "" "$INSTDIR\package.nw\icon.ico" - WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayName" "${FLUIDBOOKNAME}" - WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\$nwplatform\package.nw\icon.ico$\"" - WriteRegStr HKCU "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\"" - WriteRegDWord HKCU "${REG_UNINSTALL}" "NoModify" 1 - WriteRegDWord HKCU "${REG_UNINSTALL}" "NoRepair" 1 - WriteRegStr HKCU "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" + WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayName" "${FLUIDBOOKNAME}" + WriteRegStr HKCU "${REG_UNINSTALL}" "DisplayIcon" "$\"$INSTDIR\package.nw\icon.ico$\"" + WriteRegStr HKCU "${REG_UNINSTALL}" "InstallLocation" "$\"$INSTDIR$\"" + WriteRegDWord HKCU "${REG_UNINSTALL}" "NoModify" 1 + WriteRegDWord HKCU "${REG_UNINSTALL}" "NoRepair" 1 + WriteRegStr HKCU "${REG_UNINSTALL}" "UninstallString" "$\"$INSTDIR\Uninstall.exe$\"" - WriteUninstaller "$INSTDIR\Uninstall.exe" + WriteUninstaller "$INSTDIR\Uninstall.exe" - ExecShell "" "$INSTDIR\$fname.exe" + ExecShell "" "$INSTDIR\$fname.exe" SectionEnd Section "Uninstall" -DeleteRegKey HKCU "${REG_UNINSTALL}" -Delete "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" -Delete "$DESKTOP\${FLUIDBOOKNAME}.lnk" -Delete "$INSTDIR\Uninstall.exe" -RMDIR /r /REBOOTOK $INSTDIR -SetRebootFlag false + DeleteRegKey HKCU "${REG_UNINSTALL}" + Delete "$SMPROGRAMS\${FLUIDBOOKNAME}.lnk" + Delete "$DESKTOP\${FLUIDBOOKNAME}.lnk" + Delete "$INSTDIR\Uninstall.exe" + RMDIR /r /REBOOTOK $INSTDIR + SetRebootFlag false SectionEnd diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index 862c3c82d..2d50158b7 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -495,22 +495,15 @@ class wsUrl { $versions['v1'] = array('title' => __('Version online') . ' - V1', 'icon' => cubeMedia::silk('page_white_world.png')); $versions['v2'] = array('title' => __('Version online') . ' - V2', 'icon' => cubeMedia::silk('page_white_world.png')); } - $versions['win-exe'] = array('title' => __('Version offline') . ' - ' . __('Executable Windows'), 'icon' => cubeMedia::silk('application_view_tile.png')); - if ($chooseVersion) { - $versions['win-exe-html'] = array('title' => __('Version offline') . ' - ' . __('Executable Windows') . ' (HTML5)', 'icon' => cubeMedia::silk('application_view_tile.png')); - } - $versions['win-ins'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows'), 'icon' => cubeMedia::silk('application_view_tile.png')); - if ($chooseVersion) { - $versions['win-ins-html'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows') . ' (HTML5)', 'icon' => cubeMedia::silk('application_view_tile.png')); - } - $versions['mac-exe'] = array('title' => __('Version offline') . ' - ' . __('Exécutable Mac OS X'), 'icon' => cubeMedia::image(IMG . '/macos.png')); - if ($chooseVersion) { - $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'), 'icon' => cubeMedia::silk('cd.png')); - if ($chooseVersion) { - $versions['win-cd-html'] = array('title' => __('Version offline') . ' - ' . __('CD-ROM') . ' / ' . __('Clé USB') . ' (HTML)', 'icon' => cubeMedia::silk('cd.png')); - } + $versions['win-exe'] = array('title' => __('Version offline') . ' - ' . __('Executable Windows') . ' (Flash)', 'icon' => cubeMedia::silk('application_view_tile.png')); + $versions['win-inss-html'] = array('title' => __('Version offline') . ' - ' . __('Executable Windows') . ' (HTML5)', 'icon' => cubeMedia::silk('application_view_tile.png')); + $versions['win-ins'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows') . ' (Flash)', 'icon' => cubeMedia::silk('application_view_tile.png')); + $versions['win-ins-html'] = array('title' => __('Version offline') . ' - ' . __('Installeur Auto-executable Windows') . ' (HTML5)', 'icon' => cubeMedia::silk('application_view_tile.png')); + $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-html'] = array('title' => __('Version offline') . ' - ' . __('HTML') . ' (' . __('Non adaptée à l\'installation sur un serveur web') . ')', 'icon' => cubeMedia::silk('cd.png')); if ($droits->admin) { $versions['phonegap'] = array('title' => __('Version offline') . ' - ' . __('Application mobile'), 'icon' => cubeMedia::image(IMG . '/phonegap.png')); diff --git a/inc/ws/Util/packager/_common.php b/inc/ws/Util/packager/_common.php index 36ff1b463..4884d04af 100644 --- a/inc/ws/Util/packager/_common.php +++ b/inc/ws/Util/packager/_common.php @@ -10,6 +10,7 @@ $__autoload['wsPackagerMacEXE'] = dirname(__FILE__) . '/class.ws.packager.mac.ex $__autoload['wsPackagerWinEXEHTML'] = dirname(__FILE__) . '/class.ws.packager.win.exe.html.php'; $__autoload['wsPackagerWinINSTHTML'] = dirname(__FILE__) . '/class.ws.packager.win.inst.html.php'; +$__autoload['wsPackagerWinINSTSilentHTML'] = dirname(__FILE__) . '/class.ws.packager.win.inst.silent.html.php'; $__autoload['wsPackagerWinCDHTML'] = dirname(__FILE__) . '/class.ws.packager.win.cd.html.php'; $__autoload['wsPackagerMacEXEHTML'] = dirname(__FILE__) . '/class.ws.packager.mac.exe.html.php'; diff --git a/inc/ws/Util/packager/class.ws.packager.php b/inc/ws/Util/packager/class.ws.packager.php index a650591a5..50a589f41 100644 --- a/inc/ws/Util/packager/class.ws.packager.php +++ b/inc/ws/Util/packager/class.ws.packager.php @@ -43,6 +43,8 @@ class wsPackager { $packager = new wsPackagerMacEXEHTML($book_id); } else if ($version == 'win-ins-html') { $packager = new wsPackagerWinINSTHTML($book_id); + } else if ($version == 'win-inss-html') { + $packager = new wsPackagerWinINSTSilentHTML($book_id); } else if ($version == 'win-cd-html') { $packager = new wsPackagerWinCDHTML($book_id); } diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.html.php b/inc/ws/Util/packager/class.ws.packager.win.inst.html.php index 6204072df..813d99e3e 100644 --- a/inc/ws/Util/packager/class.ws.packager.win.inst.html.php +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.html.php @@ -3,6 +3,7 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML { protected $nsi; + protected $nsifile='html'; public function __construct($book_id) { parent::__construct($book_id); @@ -35,7 +36,7 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML { $fname = $this->exeName; $title = $this->appName; - $nsi = file_get_contents(WS_COMPILE_ASSETS . '/html.nsi'); + $nsi = file_get_contents(WS_COMPILE_ASSETS . '/'.$this->nsifile.'.nsi'); $nsi = str_replace('$name', utf8_decode($title), $nsi); $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi); $nsi = str_replace('$fname', $fname, $nsi); @@ -62,6 +63,7 @@ class wsPackagerWinINSTHTML extends wsPackagerWinEXEHTML { $makensis = new CubeIT_CommandLine('makensis'); $makensis->setArg(null, $tmp); $makensis->execute(); + $makensis->debug(); return $this->getURLBase('exe'); } diff --git a/inc/ws/Util/packager/class.ws.packager.win.inst.silent.html.php b/inc/ws/Util/packager/class.ws.packager.win.inst.silent.html.php new file mode 100644 index 000000000..9f41a8005 --- /dev/null +++ b/inc/ws/Util/packager/class.ws.packager.win.inst.silent.html.php @@ -0,0 +1,11 @@ +version = 'win-inss-html'; + } +} \ No newline at end of file -- 2.39.5