Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

CA with a vbs


9 replies to this topic

Eric

Eric
  • Members
  • 11 posts

Posted 19 March 2001 - 15:17

To create my msi file, i use wiw.
i can create a custom action that execute a vbs file.

My script is very simple :
set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.Run ("at 1:00 /every:m,t,w,th,f,s,su ""C:\Program Files\Antivir\scanner.bat""")

when i execute this file in command line, the execution is ok.
when i insert this file in a custom action that execute a vbscript, my msi file return an runtime vbsript error.

i don't understand this error.

thanks for your help.

Eric


SkipSailors

SkipSailors
  • Members
  • 34 posts

Posted 20 March 2001 - 16:29

Does WshShell.Run(...) return an error code fo some sort you are not dealing with correctly in the CA?

(Edited by SkipSailors at 8:29 am on Mar. 20, 2001)


Eric

Eric
  • Members
  • 11 posts

Posted 21 March 2001 - 09:21

i don't understand why i launch my vbs in command line, it is ok.

in my msi log file, i have a runtime vb error (on w2k i have wsh 5.5)


SkipSailors

SkipSailors
  • Members
  • 34 posts

Posted 21 March 2001 - 16:03

1) What is the runtime error in your log file?
2) Does ignoring custom action return code impact your behavior?

SteveP

SteveP
  • Members
  • 126 posts

Posted 23 March 2001 - 18:03

Eric,

What kind of CA are you using, and how are you passing the command line arguments?


RonnieBHansen

RonnieBHansen
  • Members
  • 2 posts

Posted 27 March 2001 - 13:14

I've got exactly the same problem. I'm able to run my VBScript file correctly from a command line. If I make the same lines of code in a custom action it fails. Internal error 2740. Microsoft VBScript Runtime Error.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 March 2001 - 13:21

I don't think the WScript object is available in a vbs that is run by Windows Installer. (The Scripting object is available)

RonnieBHansen

RonnieBHansen
  • Members
  • 2 posts

Posted 27 March 2001 - 15:11

Hi Stefan. Thanx a lot. I was creating an object like this:
Set MySomething = WScript.CreateObject("WScript.Shell")
I changed this to
Set MySomething = CreateObject("WScript.Shell")
And now it works !
Another little question:
Do you need to include scrrun.dll and vbscript.dll in your project. I can only get the code to run if I include those files.
Kind Regards, Ronnie

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 27 March 2001 - 20:49

If the target system doesn't have windows scripting installed, you have to install it. The suggested method is to run Microsoft's scr55en.exe install package instead of adding the files to your project. Unfortunately there's no merge module for windows scripting.