windows installer - vbs vs bat startup script

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

windows installer - vbs vs bat startup script

nrjank
Administrator
working through a user issue on startup trouble that is tied to an (as yet unsolved) inability to execute vbs scripts[1][2], a comment was made "why do you need VBS for something as simple as setting path and environment variables and starting a program? A simple batch script will do it and is guaranteed to work. If you would like to avoid a black CMD window see this post [3]"

I came across bug #41074 [4] that i think resulted in shifting from a .bat to .vbs file and seems to identify (1) no terminal window hanging around while the gui is up, (2) starting cli version in a way that still let you produce qt graphics, (3) producing the first time welcome dialog if needed.  i seem to recall there being something else but it escapes me, I don't know if it made any other setup steps easier.

thanks to the history of windoze security issues, using a vbs may be problematic for some users, with the usual result of "octave doesn't start". Were there other reasons for shifting to the .vbs that I'm missing above? Is there a workaround for someone who just can't run a vbs file for some reason?  I hate to suggest reverting to the 'include .bat as a backup' model, but is that the only method that would work for them?

Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD
> Message: 2
> Date: Tue, 25 Aug 2020 11:53:01 -0400
> From: Nicholas Jankowski <[hidden email]>
> To: octave maintainers mailing list <[hidden email]>
> Subject: windows installer - vbs vs bat startup script
> Message-ID:
> <CABNpfR-A-
> [hidden email]>
> Content-Type: text/plain; charset="utf-8"
>
> working through a user issue on startup trouble that is tied to an (as yet
> unsolved) inability to execute vbs scripts[1][2], a comment was made "why
> do you need VBS for something as simple as setting path and environment
> variables and starting a program? A simple batch script will do it and is
> guaranteed to work. If you would like to avoid a black CMD window see this
> post [3]"
>
> I came across bug #41074 [4] that i think resulted in shifting from a .bat
> to .vbs file and seems to identify (1) no terminal window hanging around
> while the gui is up, (2) starting cli version in a way that still let you
> produce qt graphics, (3) producing the first time welcome dialog if
> needed.  i seem to recall there being something else but it escapes me, I
> don't know if it made any other setup steps easier.
>
> thanks to the history of windoze security issues, using a vbs may be
> problematic for some users, with the usual result of "octave doesn't
> start". Were there other reasons for shifting to the .vbs that I'm missing
> above? Is there a workaround for someone who just can't run a vbs file for
> some reason?  I hate to suggest reverting to the 'include .bat as a backup'
> model, but is that the only method that would work for them?
>
> [1]
> https://octave.discourse.group/t/octave-cli-and-gui-does-not-open-from-
> desktop-shortcut-after-installation-on-ms-windows-10/112
> [2]
> https://superuser.com/questions/1579906/vbs-script-execution-blocked-on-
> windows-10
> [3]
> https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-
> hidden-way
> [4] https://savannah.gnu.org/bugs/?41074
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <https://lists.gnu.org/archive/html/octave-
> maintainers/attachments/20200825/b8e34f84/attachment.html>
>

So which solution on [3] did you mean for hidden batch file ?

From memory I think the only reason for shifting to the .vbs was because it was the only solution that appeared to not flash a cmd console on startup, or hide the octave first use dialog

The vbs file was only ever intended on running from the windows shortcuts or from clicking on the file - not for running in scripts where the .bat file should be used. The bat file is also the one that is run when octave is called in pkg installs etc

The .bat file is installed by default just appears in the bin folder rather than at top level so is available if needed.

But if there is a solution that doesn’t require the .vbs that works then we can change it



Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

nrjank
Administrator

So which solution on [3] did you mean for hidden batch file ?


Which did he mean? i don't know.  the top suggestion still involved using a vbs. most others use a 3rd party tool.
 
From memory I think the only reason for shifting to the .vbs was because it was the only solution that appeared to not flash a cmd console on startup, or hide the octave first use dialog

The vbs file was only ever intended on running from the windows shortcuts or from clicking on the file - not for running in scripts where the .bat file should be used. The bat file is also the one that is run when octave is called in pkg installs etc


Ok, I thought it was gone actually.  It's hard to tell how many people the vbs issue is a problem for. it's supposed to 'just work' on all versions of windows. but it seems it's a problem for some people based on security profiles.

if it's still there maybe pointing to the bat directly it is enough of a workaround for them.  Is it just a matter of redirecting the shortcut? would anything else be missing?
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD

 

 

From: Nicholas Jankowski [mailto:[hidden email]]
Sent: Tuesday, August 25, 2020 3:38 PM
To: JohnD
Cc: octave-maintainers; Nicholas Jankowski
Subject: Re: windows installer - vbs vs bat startup script

 


So which solution on [3] did you mean for hidden batch file ?

 

Which did he mean? i don't know.  the top suggestion still involved using a vbs. most others use a 3rd party tool.

 

From memory I think the only reason for shifting to the .vbs was because it was the only solution that appeared to not flash a cmd console on startup, or hide the octave first use dialog

The vbs file was only ever intended on running from the windows shortcuts or from clicking on the file - not for running in scripts where the .bat file should be used. The bat file is also the one that is run when octave is called in pkg installs etc

 

Ok, I thought it was gone actually.  It's hard to tell how many people the vbs issue is a problem for. it's supposed to 'just work' on all versions of windows. but it seems it's a problem for some people based on security profiles.

 

if it's still there maybe pointing to the bat directly it is enough of a workaround for them.  Is it just a matter of redirecting the shortcut? would anything else be missing?

 

 

It should be a matter of just removing the wscript part of the shortcut and changing the command to the .bat file

 

If I get a chance I’ll relook at alternative options for launch it. Unless one else gets to it first

 

Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

nrjank
Administrator

It should be a matter of just removing the wscript part of the shortcut and changing the command to the .bat file

 

If I get a chance I’ll relook at alternative options for launch it. Unless one else gets to it first


ok. I'll share that so it at least pops up as an option for anyone searching.  

turns out over on the discourse post that the issue with this user was a 'lingering' mcafee and avast antivirus on his machine.  he thought he had the built in windows defender as the only av running, and that wasn't the case.  'deleted' (uninstalled? not clear) mcaffee and suddenly vbs's run again. 

so, yeah, this was def user machine side error.  but googling on here has turned up a few help list and stackoverflow posts about people unable to run the vbs file for one reason or another (that shouldn't be able to happen, but it's windows...)
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

PhilipNienhuis
In reply to this post by JohnD
JohnD wrote
>> Message: 2
>> Date: Tue, 25 Aug 2020 11:53:01 -0400
>> From: Nicholas Jankowski &lt;

> jankowskin@

> &gt;
>> To: octave maintainers mailing list &lt;

> maintainers@

> &gt;
>> Subject: windows installer - vbs vs bat startup script
>> Message-ID:
>>
> <CABNpfR-A-
>>
>  

> GJdExxbuA0yCtWhnvaKzWpEU0wP006j9D4PrimO7A@.gmail

>>
>> Content-Type: text/plain; charset="utf-8"
>>
>> working through a user issue on startup trouble that is tied to an (as
>> yet
>> unsolved) inability to execute vbs scripts[1][2], a comment was made "why
>> do you need VBS for something as simple as setting path and environment
>> variables and starting a program? A simple batch script will do it and is
>> guaranteed to work. If you would like to avoid a black CMD window see
>> this
>> post [3]"
>>
>> I came across bug #41074 [4] that i think resulted in shifting from a
>> .bat
>> to .vbs file and seems to identify (1) no terminal window hanging around
>> while the gui is up, (2) starting cli version in a way that still let you
>> produce qt graphics, (3) producing the first time welcome dialog if
>> needed.  i seem to recall there being something else but it escapes me, I
>> don't know if it made any other setup steps easier.
>>
>> thanks to the history of windoze security issues, using a vbs may be
>> problematic for some users, with the usual result of "octave doesn't
>> start". Were there other reasons for shifting to the .vbs that I'm
>> missing
>> above? Is there a workaround for someone who just can't run a vbs file
>> for
>> some reason?  I hate to suggest reverting to the 'include .bat as a
>> backup'
>> model, but is that the only method that would work for them?
>>
>> [1]
>> https://octave.discourse.group/t/octave-cli-and-gui-does-not-open-from-
>> desktop-shortcut-after-installation-on-ms-windows-10/112
>> [2]
>> https://superuser.com/questions/1579906/vbs-script-execution-blocked-on-
>> windows-10
>> [3]
>> https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-
>> hidden-way
>> [4] https://savannah.gnu.org/bugs/?41074
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: &lt;https://lists.gnu.org/archive/html/octave-
> &gt; maintainers/attachments/20200825/b8e34f84/attachment.html>
>>
>
> So which solution on [3] did you mean for hidden batch file ?
>
> From memory I think the only reason for shifting to the .vbs was because
> it was the only solution that appeared to not flash a cmd console on
> startup, or hide the octave first use dialog

FWIW if I start Matlab (r2014a) I also see a cmd window for a few seconds.
So on the plus side one could say that a .bat file adds some extra "Matlab
compatibility".

BTW in the Octave shortcuts wscript.exe is explicitly mentioned, but it is
sufficient to just put the full path to the octave.vbs file there.

Philip



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html

Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

nrjank
Administrator
BTW in the Octave shortcuts wscript.exe is explicitly mentioned, but it is
sufficient to just put the full path to the octave.vbs file there.

i would have to dig for which bug report, but i think they did that so that it wouldn't rely on any potential file association misconfiguration for vbs files. (e.g., one report had vbs files associated with an editor not wscript)
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD
In reply to this post by nrjank

 

 

From: Nicholas Jankowski [mailto:[hidden email]]
Sent: Tuesday, August 25, 2020 4:18 PM
To: JohnD
Cc: octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

It should be a matter of just removing the wscript part of the shortcut and changing the command to the .bat file

 

If I get a chance I’ll relook at alternative options for launch it. Unless one else gets to it first

 

ok. I'll share that so it at least pops up as an option for anyone searching.  

 

turns out over on the discourse post that the issue with this user was a 'lingering' mcafee and avast antivirus on his machine.  he thought he had the built in windows defender as the only av running, and that wasn't the case.  'deleted' (uninstalled? not clear) mcaffee and suddenly vbs's run again. 

 

so, yeah, this was def user machine side error.  but googling on here has turned up a few help list and stackoverflow posts about people unable to run the vbs file for one reason or another (that shouldn't be able to happen, but it's windows...)

 

 

I wonder if the issue is trying to run the .vbs script, or trying to run a program as hidden from another program ?

 

If it just the general act of running a .vbs script , we could just a small program using activex and call almost the same commands  from within it.

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

nrjank
Administrator

I wonder if the issue is trying to run the .vbs script, or trying to run a program as hidden from another program ?

 

If it just the general act of running a .vbs script , we could just a small program using activex and call almost the same commands  from within it. 


if the issue with vbs files is the various, potentially conflicting, non-standard security protocols,  is activex any better? I wasn't aware it was supported outside of a browser environment.
 
Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

John W. Eaton
Administrator
On 8/27/20 11:44 AM, Nicholas Jankowski wrote:

>     I wonder if the issue is trying to run the .vbs script, or trying to
>     run a program as hidden from another program ?____
>
>     __ __
>
>     If it just the general act of running a .vbs script , we could just
>     a small program using activex and call almost the same commands
>     from within it.
>
>
> if the issue with vbs files is the various, potentially conflicting,
> non-standard security protocols,  is activex any better? I wasn't aware
> it was supported outside of a browser environment.

Does it need to be a script or could the same job be done with a
separate .exe program file that sets up the environment appropriately
and then execs the real Octave binary?

jwe

Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD


> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe

It could be a separate program


Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD
In reply to this post by nrjank

 

 

From: Nicholas Jankowski [mailto:[hidden email]]
Sent: Thursday, August 27, 2020 11:44 AM
To: JohnD
Cc: octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

I wonder if the issue is trying to run the .vbs script, or trying to run a program as hidden from another program ?

 

If it just the general act of running a .vbs script , we could just a small program using activex and call almost the same commands  from within it. 

 

if the issue with vbs files is the various, potentially conflicting, non-standard security protocols,  is activex any better? I wasn't aware it was supported outside of a browser environment.

 

 

 

activeX/COM is available from almost anything windows.  

Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

nrjank
Administrator

activeX/COM is available from almost anything windows.  


ok. I'd still be concerned that if a user is having vbs execution issues, that activex scripting might have the same issues. 
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD

 

 

From: Nicholas Jankowski [mailto:[hidden email]]
Sent: Thursday, August 27, 2020 12:24 PM
To: JohnD
Cc: Nicholas Jankowski; octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

 

activeX/COM is available from almost anything windows.  

 

ok. I'd still be concerned that if a user is having vbs execution issues, that activex scripting might have the same issues. 

 

 

yep – quite likely

 

I had started a test app yesterday to try running octave from it with also settings env vars but got to the point where it would start octave-gui.exe – either hidden (but then cant get to the GUI) or not hidden(at which point it flashed a couple of console screens on loading)

I ran out of time at that point for seeing alternative way of doing the start part that worked.

 

I guess need to wrk out what the vbs script is really doing when it calls wshShell.Run, as that seems to work

Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD
In reply to this post by John W. Eaton


> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe

Heres a launcher exe code that looks like will work. See comments in file for compiling.

It probally needs a little more work to ensure things don’t buffer run, and doesn’t do much error checking

It assumes its in the same directory as the octave executable and works out the paths from that.

Its pretty close to what is being done in the.vbs scrip, but in a different order for parts




octave-launch.c (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

Ian McCallion
On Friday, 28 August 2020, JohnD <[hidden email]> wrote:


> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe


Heres a launcher exe code that looks like will work. See comments in file for compiling.

It probally needs a little more work to ensure things don’t buffer run, and doesn’t do much error checking

It assumes its in the same directory as the octave executable and works out the paths from that.

Its pretty close to what is being done in the.vbs scrip, but in a different order for parts

Looks good John. If I may suggest octave-launcher.exe is always installed in the root folder for the release, independently of where the main exes get installed. This will avoid a potential cause of breakage between releases for user code that launches octave.

Cheers... Ian
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD

 

 

From: Ian McCallion [mailto:[hidden email]]
Sent: Friday, August 28, 2020 3:24 AM
To: JohnD
Cc: John W. Eaton; Nicholas Jankowski; octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

On Friday, 28 August 2020, JohnD <[hidden email]> wrote:



> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe


Heres a launcher exe code that looks like will work. See comments in file for compiling.

It probally needs a little more work to ensure things don’t buffer run, and doesn’t do much error checking

It assumes its in the same directory as the octave executable and works out the paths from that.

Its pretty close to what is being done in the.vbs scrip, but in a different order for parts

 

Looks good John. If I may suggest octave-launcher.exe is always installed in the root folder for the release, independently of where the main exes get installed. This will avoid a potential cause of breakage between releases for user code that launches octave.

 

Cheers... Ian

 

 

Ok modded to expect to be in the root of the install directory where octave.vbs currently would reside.

 


octave-launch.c (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

Ian McCallion
On Fri, 28 Aug 2020 at 13:33, JohnD <[hidden email]> wrote:

 

 

From: Ian McCallion [mailto:[hidden email]]
Sent: Friday, August 28, 2020 3:24 AM
To: JohnD
Cc: John W. Eaton; Nicholas Jankowski; octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

On Friday, 28 August 2020, JohnD <[hidden email]> wrote:



> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe


Heres a launcher exe code that looks like will work. See comments in file for compiling.

It probally needs a little more work to ensure things don’t buffer run, and doesn’t do much error checking

It assumes its in the same directory as the octave executable and works out the paths from that.

Its pretty close to what is being done in the.vbs scrip, but in a different order for parts

 

Looks good John. If I may suggest octave-launcher.exe is always installed in the root folder for the release, independently of where the main exes get installed. This will avoid a potential cause of breakage between releases for user code that launches octave.

 

Cheers... Ian

 

 

Ok modded to expect to be in the root of the install directory where octave.vbs currently would reside.



I confirm it works launching the GUI with no black window appearing.

When launching the CLI it works the same as the .vbs, i.e. it creates a new window even if the launch is invoked from an existing commandline window. The .bat file however runs Octave in the existing window, see the following:

rem this runs octave-cli in existing window 
   call octave.bat --no-gui

rem all the following lines run octave-cli in new window
   start octave.bat  --no-gui
   call octave.vbs --no-gui
   start octave.vbs --no-gui
   call octave-launcher --no-gui
   start octave-launch --no-gui

The ideal would be for 
   call octave-launcher --no-gui
to run octave-cli in existing window. I believe then that both .bat and .vbs could then be deprecated or immediately deleted.

Cheers... Ian
Reply | Threaded
Open this post in threaded view
|

RE: windows installer - vbs vs bat startup script

JohnD

 

 

From: Ian McCallion [mailto:[hidden email]]
Sent: Friday, August 28, 2020 3:23 PM
To: JohnD
Cc: John W. Eaton; Nicholas Jankowski; octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

On Fri, 28 Aug 2020 at 13:33, JohnD <[hidden email]> wrote:

 

 

From: Ian McCallion [mailto:[hidden email]]
Sent: Friday, August 28, 2020 3:24 AM
To: JohnD
Cc: John W. Eaton; Nicholas Jankowski; octave-maintainers
Subject: Re: windows installer - vbs vs bat startup script

 

On Friday, 28 August 2020, JohnD <[hidden email]> wrote:



> -----Original Message-----
> From: John W. Eaton [mailto:[hidden email]]
> Sent: Thursday, August 27, 2020 11:49 AM
> To: Nicholas Jankowski; JohnD
> Cc: octave-maintainers
> Subject: Re: windows installer - vbs vs bat startup script
>
> On 8/27/20 11:44 AM, Nicholas Jankowski wrote:
> >     I wonder if the issue is trying to run the .vbs script, or trying to
> >     run a program as hidden from another program ?____
> >
> >     __ __
> >
> >     If it just the general act of running a .vbs script , we could just
> >     a small program using activex and call almost the same commands
> >     from within it.
> >
> >
> > if the issue with vbs files is the various, potentially conflicting,
> > non-standard security protocols,  is activex any better? I wasn't aware
> > it was supported outside of a browser environment.
>
> Does it need to be a script or could the same job be done with a
> separate .exe program file that sets up the environment appropriately
> and then execs the real Octave binary?
>
> jwe


Heres a launcher exe code that looks like will work. See comments in file for compiling.

It probally needs a little more work to ensure things don’t buffer run, and doesn’t do much error checking

It assumes its in the same directory as the octave executable and works out the paths from that.

Its pretty close to what is being done in the.vbs scrip, but in a different order for parts

 

Looks good John. If I may suggest octave-launcher.exe is always installed in the root folder for the release, independently of where the main exes get installed. This will avoid a potential cause of breakage between releases for user code that launches octave.

 

Cheers... Ian

 

 

Ok modded to expect to be in the root of the install directory where octave.vbs currently would reside.

 

 

I confirm it works launching the GUI with no black window appearing.

 

When launching the CLI it works the same as the .vbs, i.e. it creates a new window even if the launch is invoked from an existing commandline window. The .bat file however runs Octave in the existing window, see the following:

 

rem this runs octave-cli in existing window 

   call octave.bat --no-gui

 

rem all the following lines run octave-cli in new window

   start octave.bat  --no-gui

   call octave.vbs --no-gui

   start octave.vbs --no-gui

   call octave-launcher --no-gui

   start octave-launch --no-gui

 

The ideal would be for 

   call octave-launcher --no-gui

to run octave-cli in existing window. I believe then that both .bat and .vbs could then be deprecated or immediately deleted.

 

Cheers... Ian

 

 

 

Its not that simple – octave sets env paths for the octave when running pkg install, which is set in windows from the .bat file so cant just be removed

 

‘start’ creates a new wndow befefault unless is told not to, so that is expected behavior for the start calls.

 

So the only one that could be changed to work differently would be octave-launcher --no-gui, if all ready running in a terminal

Reply | Threaded
Open this post in threaded view
|

Re: windows installer - vbs vs bat startup script

Ian McCallion
On Fri, 28 Aug 2020 at 20:32, JohnD <[hidden email]> wrote:

 

 I Wrote:


The ideal would be for 

   call octave-launcher --no-gui

to run octave-cli in existing window. I believe then that both .bat and .vbs could then be deprecated or immediately deleted.

 

Cheers... Ian

 

 

 

Its not that simple – octave sets env paths for the octave when running pkg install, which is set in windows from the .bat file so cant just be removed


OK I didn't know Octave.bat had another purpose. I use it successfully to launch the cli.
 

‘start’ creates a new wndow befefault unless is told not to, so that is expected behavior for the start calls.

 

So the only one that could be changed to work differently would be octave-launcher --no-gui, if all ready running in a terminal


That would be great from my perspective! 

Cheers... Ian