How to run a VB script after install / before uninstall?

Got a problem you cannot solve? Try here.
binkle

How to run a VB script after install / before uninstall?

Postby binkle » Wed Sep 27, 2006 7:22 am

Hi,
I need to run a VB script after install, but the following code does not work:

Code: Select all

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.

How to do this?

Greetings

Harry

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Sep 27, 2006 1:10 pm

I'd take out the outer-most double quotes.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

binkle

Postby binkle » Thu Sep 28, 2006 2:37 am

That's it.

Thank you very much!!!
:D

binkle

there is a bug:

Postby binkle » Thu Sep 28, 2006 7:13 am

Hi,
one more thing.
I use this code on installation:

Code: Select all

...
    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.

Hint: I use a similar command on uninstall

Code: Select all

...
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.

Any ideas on this?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Thu Sep 28, 2006 7:17 am

That's very strange, no actually :(
Try using Run Program As maybe?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

binkle

Postby binkle » Thu Sep 28, 2006 7:43 am

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').

Any further ideas?

What about 'run programm'? Can you fix this?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Thu Sep 28, 2006 1:46 pm

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

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

binkle

Postby binkle » Fri Sep 29, 2006 4:10 am

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.

Thanks so far.


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 205 guests