# HG changeset patch # User John Donoghue # Date 1390695849 18000 # Node ID 70b110956a4e0aee73c5462539302d5f2cc8f2aa # Parent 1414225a963dc7ad2160f0d46259ef304aad54df nsis-installer: Use custom page for shortcuts and install for all users. * binary-dist-rules.mk: copy installer-files/README.html to dist folder. * installer-files/README.html: New file. * makeinst-script.sh: Added custom page for Install for all users and Create shortcuts. Reassigned show readme checkbox for showing README.html at end of install. Run octave-gui as the Run program. diff -r 1414225a963d -r 70b110956a4e binary-dist-rules.mk --- a/binary-dist-rules.mk Fri Jan 24 13:51:28 2014 -0500 +++ b/binary-dist-rules.mk Sat Jan 25 19:24:09 2014 -0500 @@ -73,6 +73,8 @@ echo " notepad++..." cd $(TOP_DIR) \ && tar -c -h -f - notepad++ | ( cd $(OCTAVE_DIST_DIR) ; tar xpf - ) + echo " README.html..." + cp $(TOP_DIR)/installer-files/README.html $(OCTAVE_DIST_DIR)/ endef endif diff -r 1414225a963d -r 70b110956a4e installer-files/README.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/installer-files/README.html Sat Jan 25 19:24:09 2014 -0500 @@ -0,0 +1,45 @@ + + +GNU Octave + + + +

Welcome

+

+Thank you for installing GNU Octave! +

+

+Octave 3.8 is a major new release with many new features, including an +experimental graphical user interface. But because the GUI is not +quite as polished as we would like, we have decided to wait until the +4.0.x release series before making the GUI the default interface. +

+

+See the release notes or the "Experimental GUI Info" button in the GUI +for more information about the release and how you can help us with +GUI development and speed up the 4.0 release. +

+

Included Octave Forge Packages

+

+A number of Octave-forge packages have been included with this install Octave, +however they need to be installed in order to use them. +

+

+To install: +

+Packages must then be loaded in order to use them with the pkg load PACKAGENAME command. +

+

+Other packages are available from Octave-Forge +

+ + diff -r 1414225a963d -r 70b110956a4e makeinst-script.sh --- a/makeinst-script.sh Fri Jan 24 13:51:28 2014 -0500 +++ b/makeinst-script.sh Sat Jan 25 19:24:09 2014 -0500 @@ -36,7 +36,7 @@ !define DESCRIPTION "GNU Octave is a high-level programming language, primarily intended for numerical computations." !define INSTALLER_FILES "../installer-files" !define INSTALLER_NAME "octave-$OCTAVE_VERSION-installer.exe" -!define MAIN_APP_EXE "octave.exe" +!define MAIN_APP_EXE "octave-gui.exe" !define INSTALL_TYPE "SetShellVarContext current" !define PRODUCT_ROOT_KEY "HKLM" !define PRODUCT_KEY "Software\\Octave-$VERSION" @@ -69,6 +69,12 @@ ; MUI settings !include "MUI.nsh" +; custom dialogs +!include nsDialogs.nsh +; additional logic +!include LogicLib.nsh + + !define MUI_ABORTWARNING !define MUI_UNABORTWARNING !define MUI_HEADERIMAGE @@ -85,24 +91,15 @@ !define MUI_LICENSEPAGE_BUTTON "Next >" !insertmacro MUI_PAGE_LICENSE "\${INSTALLER_FILES}/gpl-3.0.txt" +Page custom octaveOptionsPage octaveOptionsLeave + !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckPrevInstall !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES -; set up checkbox to create desktop icon -Function finishpage_desktopshortcut - SetOutPath "%USERPROFILE%" - CreateShortCut "\$desktop\\Octave-$VERSION (Command Line).lnk" "\$INSTDIR\\bin\\octave-cli.exe" "" "\$INSTDIR\\$ICON" 0 - CreateShortCut "\$desktop\\Octave-$VERSION (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0 -FunctionEnd - -!define MUI_FINISHPAGE_SHOWREADME "" -!define MUI_FINISHPAGE_SHOWREADME_CHECKED -!define MUI_FINISHPAGE_SHOWREADME_TEXT "Create Desktop Shortcut" -!define MUI_FINISHPAGE_SHOWREADME_FUNCTION finishpage_desktopshortcut - !define MUI_FINISHPAGE_RUN "\$INSTDIR\\bin\\\${MAIN_APP_EXE}" +!define MUI_FINISHPAGE_SHOWREADME "\$INSTDIR\\README.html" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM @@ -117,6 +114,40 @@ RequestExecutionLevel admin +###################################################################### +; custom options page functions + +Var InstallAllUsers +Var InstallAllUsersCtrl +Var InstallShortcuts +Var InstallShortcutsCtrl +Function octaveOptionsPage + nsDialogs::Create 1018 + Pop \$0 + + \${If} \$0 == error + Abort + \${EndIf} + + \${NSD_CreateCheckBox} 0 0 100% 12u "Install for all users" + Pop \$InstallAllUsersCtrl + \${NSD_SetState} \$InstallAllUsersCtrl \${BST_CHECKED} + + \${NSD_CreateCheckBox} 0 20 100% 12u "Create desktop shortcuts" + Pop \$InstallShortcutsCtrl + \${NSD_SetState} \$InstallShortcutsCtrl \${BST_CHECKED} + + !insertmacro MUI_HEADER_TEXT "Install Options" "Choose options for installing" + nsDialogs::Show +FunctionEnd + +Function octaveOptionsLeave + \${NSD_GetState} \$InstallAllUsersCtrl \$InstallAllUsers + \${NSD_GetState} \$InstallShortcutsCtrl \$InstallShortcuts +FunctionEnd + +###################################################################### + Function .onInit Call DetectWinVer Call CheckCurrVersion @@ -127,6 +158,18 @@ ; file section Section "MainFiles" + ; set context based on whether installing for user or all + \${If} \$InstallAllUsers == \${BST_CHECKED} + SetShellVarContext all + \${Else} + SetShellVarContext current + \${Endif} + + ; include the README + SetOutPath "\$INSTDIR" + File "$OCTAVE_SOURCE/README.html" + + ; distro files EOF # insert the files @@ -156,6 +199,9 @@ WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "UninstallString" "\$INSTDIR\\uninstall.exe" WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "NoModify" 1 WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "NoRepair" 1 + \${If} \$InstallAllUsers == \${BST_CHECKED} + WriteRegDWORD HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers" 1 + \${EndIf} WriteUninstaller "uninstall.exe" SectionEnd @@ -181,10 +227,23 @@ fi cat >> $OUTFILE << EOF + + \${If} \$InstallShortcuts == \${BST_CHECKED} + SetOutPath "%USERPROFILE%" + CreateShortCut "\$desktop\\Octave-$VERSION (Command Line).lnk" "\$INSTDIR\\bin\\octave-cli.exe" "" "\$INSTDIR\\$ICON" 0 + CreateShortCut "\$desktop\\Octave-$VERSION (Experimental GUI).lnk" "\$INSTDIR\\bin\\octave-gui.exe" "" "\$INSTDIR\\$ICON" 0 + \${Endif} + SectionEnd Section "Uninstall" + ReadRegDWORD \$0 HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" "AllUsers" + IfErrors not_all_users + + SetShellVarContext all + +not_all_users: DeleteRegKey HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Octave-$VERSION" DeleteRegKey HKLM "Software\\Octave-$VERSION"