changeset 6371:ae320ffbbbe0 release

* installer-files/octave-firsttime.vbs, installer-files/octave.vbs: forward input args when respawning cscript from a wscript run
author John Donoghue <john.donoghue@ieee.org>
date Mon, 22 Aug 2022 14:31:55 -0400
parents 6d085baf3a99
children 71ba75cc40bc 40ab6c28afc0
files installer-files/octave-firsttime.vbs installer-files/octave.vbs
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/installer-files/octave-firsttime.vbs	Sat Jul 30 15:42:25 2022 +0200
+++ b/installer-files/octave-firsttime.vbs	Mon Aug 22 14:31:55 2022 -0400
@@ -5,7 +5,12 @@
 ' If running with wscript.exe, "Exec" will flash a window for a split second.
 ' Relaunch with cscript.exe which doesn't show that window.
 If InStr(1, WScript.FullName, "wscript.exe", vbTextCompare) > 0 Then
-  WScript.Quit wshShell.Run("cscript.exe """ & WScript.ScriptFullName & """", 0, True)
+  AllArgs = ""
+  Set wshArgs = WScript.Arguments
+  For I = 0 to wshArgs.Count - 1
+    AllArgs = AllArgs & " " & chr(34) & wshArgs(I) & chr(34)
+  Next
+  WScript.Quit wshShell.Run("cscript.exe """ & WScript.ScriptFullName & """" & AllArgs, 0, True)
 End If
 
 
--- a/installer-files/octave.vbs	Sat Jul 30 15:42:25 2022 +0200
+++ b/installer-files/octave.vbs	Mon Aug 22 14:31:55 2022 -0400
@@ -5,7 +5,12 @@
 ' If running with wscript.exe, "Exec" will flash a window for a split second.
 ' Relaunch with cscript.exe which doesn't show that window.
 If InStr(1, WScript.FullName, "wscript.exe", vbTextCompare) > 0 Then
-  WScript.Quit wshShell.Run("cscript.exe """ & WScript.ScriptFullName & """", 0, True)
+  AllArgs = ""
+  Set wshArgs = WScript.Arguments
+  For I = 0 to wshArgs.Count - 1
+    AllArgs = AllArgs & " " & chr(34) & wshArgs(I) & chr(34)
+  Next
+  WScript.Quit wshShell.Run("cscript.exe """ & WScript.ScriptFullName & """" & AllArgs, 0, True)
 End If
 
 ' get the directory that script resides in