# HG changeset patch # User John Donoghue # Date 1442404287 14400 # Node ID 8803dfa40236eea8428fc61b7016f132cf6c271b # Parent c8c394328c547916bdb85a819237138f1ea22046 nsis installer: set directory to userprofile on startof octave from installer (Bug #45899) * installer-files/octave-firsttime.vbs: new file * binary-dist-rules.mk: copy octave-firsttime.vbs to disy folder * dist-files.mk: add installer-files/octave-firsttime.vbs * makeinst-script.sh: install and then run octave-firsttime.vbs if the run checkbox is selected at end of install. diff -r c8c394328c54 -r 8803dfa40236 binary-dist-rules.mk --- a/binary-dist-rules.mk Sun Sep 13 08:43:21 2015 -0400 +++ b/binary-dist-rules.mk Wed Sep 16 07:51:27 2015 -0400 @@ -77,6 +77,7 @@ echo " octave.bat..." cp $(TOP_DIR)/installer-files/octave.bat $(OCTAVE_DIST_DIR)/ cp $(TOP_DIR)/installer-files/octave.vbs $(OCTAVE_DIST_DIR)/ + cp $(TOP_DIR)/installer-files/octave-firsttime.vbs $(OCTAVE_DIST_DIR)/ echo " updating libtool references..." find '$(OCTAVE_DIST_DIR)/' -type f -name "*.la" \ -exec $(SED) -i 's|$(HOST_PREFIX)|/usr|g;s|$(BUILD_TOOLS_PREFIX)|/usr|g' {} \; ; diff -r c8c394328c54 -r 8803dfa40236 dist-files.mk --- a/dist-files.mk Sun Sep 13 08:43:21 2015 -0400 +++ b/dist-files.mk Wed Sep 16 07:51:27 2015 -0400 @@ -865,6 +865,7 @@ octave.bat \ octave.bmp \ octave.vbs \ + octave-firsttime.vbs \ octave-hdr.bmp \ octave-logo.ico \ README.html diff -r c8c394328c54 -r 8803dfa40236 installer-files/octave-firsttime.vbs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/installer-files/octave-firsttime.vbs Wed Sep 16 07:51:27 2015 -0400 @@ -0,0 +1,30 @@ +' script to run octave in gui/command mode + +Set wshShell = CreateObject( "WScript.Shell" ) + +' get the directory that script resides in +Set fso = CreateObject("Scripting.FileSystemObject") +OctavePath = fso.GetParentFolderName(WScript.ScriptFullName) +Set fso = Nothing + +' set up path to ensure octave bin comes first +Set wshSystemEnv = wshShell.Environment( "PROCESS" ) +wshSystemEnv("PATH") = OctavePath & "\bin;" & wshSystemEnv("PATH") + +' set terminal type +wshSystemEnv("TERM") = "cygwin" + +' set Qt plugin directory +wshSystemEnv("QT_PLUGIN_PATH") = OctavePath & "\plugins" + +' set directory to users +startpath = wshShell.ExpandEnvironmentStrings("%UserProfile%") +wshShell.CurrentDirectory = startpath + +wshShell.Run chr(34) & OctavePath & "\bin\octave-gui.exe" & Chr(34), 0 + +' free our objects +Set wshShell = Nothing +Set wshSystemEnv = Nothing +Set wshArgs = Nothing + diff -r c8c394328c54 -r 8803dfa40236 makeinst-script.sh --- a/makeinst-script.sh Sun Sep 13 08:43:21 2015 -0400 +++ b/makeinst-script.sh Wed Sep 16 07:51:27 2015 -0400 @@ -44,7 +44,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.vbs" +!define MAIN_APP_EXE "octave-firsttime.vbs" !define INSTALL_TYPE "SetShellVarContext current" !define PRODUCT_ROOT_KEY "HKLM" !define PRODUCT_KEY "Software\\Octave-$VERSION" @@ -223,6 +223,7 @@ SetOutPath "\$INSTDIR" File "$OCTAVE_SOURCE/octave.bat" File "$OCTAVE_SOURCE/octave.vbs" + File "$OCTAVE_SOURCE/octave-firsttime.vbs" ; distro files EOF