In search for "basexgui.vbs"

Friday, 7 August 2020 · 3 messages · last reply 12 Aug 2020
AM
Andreas Mixich7 Aug 2020 02:18 #
Hi, I had a file "basexgui.vbs", which would start the BaseX GUI without opening a console, but upon last installation it got overwritten. I do not find it, neither here, in the list, nor with Google, overall. Does anybody have this? Thanks!
-- Minden jót, all the best, Alles Gute, Andreas Mixich
CG
Christian Grün10 Aug 2020 11:16 #
Hi Andreas, I guess this file was created by yourself; at least I haven’t heard of it before. It’s a bit annoying indeed that batch scripts will always open a console window (and for reasons of compatibility with older versions of Windows, they are still our preferred way to define start scripts). You can at least ensure that the window is automatically closed after the start if the java GUI process is started with "start javaw" or (depending on your configuration) with "run java". Another alternative is to create a link (.lnk) with a direct Java call (javaw -cp ...). Hope this helps, looking forward to the experiences of other users, Christian
AM
Andreas Mixich12 Aug 2020 22:30 #
Quoted text · Christian Grün · 5 lines
Am 10.08.2020 um 11:16 schrieb Christian Grün: > Hi Andreas, > > I guess this file was created by yourself; at least I haven’t heard of > it before.
Hmmm... could be. Anyway, I just did it, though it became a basexgui.js. It's modelled after basexgui.bat, with the difference, that it could accept additional, user provided, command line args. Not sure, whether that makes sense, but I added it, since it was free ;-) It needs to be installed into BaseX\bin\, along with the other launchers. It's Public Domain, CC0, or MIT. Feel free to incorporate it, distribute it, etc.
/* basexgui.js 0.1.0

  Simple starter for BaseX GUI. In contrary to the batch script
`basexgui.bat`
  this will not open a console window and (untested) accept additional
arguments.

  @usage     wscript.exe basexgui.js [arguments]
  @usage     cscript.exe basexgui.js [arguments]
  @author    Andreas Mixich
  @version   0.1.0
  @date      2020-08-12
  @requires  Windows Script Host (`cscript.exe` or `wscript.exe`)
  @license   Public Domain or CC0 or MIT
  @see       http://basex.org
  @see
https://mailman.uni-konstanz.de/pipermail/basex-talk/2020-August/015557.html
*/
var WshShell = WScript.CreateObject("WScript.Shell");
var fso = WScript.CreateObject("Scripting.FileSystemObject");

// Path to core and library classes
var MAIN = fso.getParentFolderName(WshShell.CurrentDirectory);

var WshSysEnv = WshShell.Environment("SYSTEM");
var CLASSPATH1 = WshSysEnv("CLASSPATH");

var WshUsrEnv = WshShell.Environment("USER");
var CLASSPATH2 = WshUsrEnv("CLASSPATH");

var CP = MAIN + "\\BaseX.jar;" + MAIN + "\\lib\\custom\\*;" + MAIN +
"\\lib\*;" + (CLASSPATH1 ? CLASSPATH1 + ";" : "") + (CLASSPATH2 ?
CLASSPATH2 + ";" : "");

// Options for virtual machine
var BASEX_JVM = "-Xmx1200m";

// Parse any additional commandline options provided by the user at
invocation
// and construct our final command line.
var objArgs = WScript.Arguments;
var USRARGS = "";

for (i = 0; i < objArgs.length; i++) {
  USRARGS += objArgs(i) + " ";
}

var CLINE = "javaw -cp \"" + CP + "\" " + BASEX_JVM + "
org.basex.BaseXGUI " + USRARGS;

// Run code
// WScript.Echo(CLINE);
var oExec = WshShell.Run(CLINE, 1, false);
-- Goody Bye, Minden jót, Mit freundlichen Grüßen, Andreas Mixich

⚡Generated with XQuery