Run Program $WINSYSDIR$\\cscript.exe ""$TARGETDIR$\\bin\\Myscript.Vbs" scriptparam1 scriptparam2 "script param3"" (WAIT)
I also tried to put this with relative paths into a batch file and started the startScript.bat, but is batch file is executed from a temp path, so the relative params aren't correct.
...
Apply Install (get result into variable SUCCESS)
if Variable SUCCESS not Equals ERROR
if Variable SUCCESS not Equals CANCEL
Run Program $TARGETDIR$\\bin\\RegAsm.exe ExchangeServerToolbox.dll /codebase
Run Program $WINSYSDIR$\\cscript.exe "$TARGETDIR$\\bin\\SMTPReg.Vbs" /add 1 OnArrival ExchangeServerToolbox Jam.ExchangeServerToolbox.Plugin.MsgSub "MAIL FROM=*" (WAIT)
end
end
...
the last line works only fine if the 'hide window' checkbox is NOT checked.
If I check it to avoid a commandline window flashing the command seems not to be executed.
...
if Variable REMOVE Equals TRUE
Run Program $WINSYSDIR$\\cscript.exe "$TARGETDIR$\\bin\\SMTPReg.Vbs" /remove 1 OnArrival ExchangeServerToolbox (WAIT)
Run Program $TARGETDIR$\\bin\\RegAsm.exe ExchangeServerToolbox.dll /unregister
Apply Uninstall (get result into variable SUCCESS)
...
this works fine no matter if the 'hide window' option is checked or not.
can't get it to work with 'run programm as' in any window mode.....
I even do not see any window popping up in windows 'normal' mode using the same syntax as in 'run programm' (without 'as').
I'm not sure this is an error with the product. You have to make sure every parameter is specified correctly, the startup folders are set correctly, and so on. Run Program As is more flexible but uses the same internal API calls as Run Program, so it makes no sense that one would work and the other not.
Please double-check everything you're doing...
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Ok, I tried it again with run...as.
It works now, but it still works only if the window mode is set to 'normal'.
The other three modes prevent my script from successful execution.
I fear the problem is somewhere in my script. It seems to need a window handle.