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

Custom Action


4 replies to this topic

ehj

ehj
  • Members
  • 3 posts

Posted 15 September 2004 - 22:48

Hi all,
Got this VB script which runs outside Installshield X, but not inside in the Custom Action. The error is(translated to english):

A problem has occurred. A script, needed for this installation, could not be run. Contact supportperson or dealer.

My script waits for a process to stop, and then continues the installation. It seems that the error comes when the WScript is called. It works allright in a .vbs file. Any good suggestions from you good people ? smile.gif :

Function Running()

Set WshShell = WScript.CreateObject("WScript.Shell")
Set locator = CreateObject("WbemScripting.SWbemLocator")
Set service = locator.ConnectServer()
ISProcessId = Session.Property("PROCESSID")
Set props = service.ExecQuery("select ProcessId, description from Win32_Process where ProcessId = " & ISProcessId)
num = props.Count

If num > 0 Then
Running = true
Else
Running = false
End If

Set WSHShell = Nothing

End Function

While Running()
Wscript.sleep 1000
Wend



ehj

ehj
  • Members
  • 3 posts

Posted 15 September 2004 - 23:03

OK, I believe I've found out that WScript cannot be used in Custom Actions. How do I then stop my process, any suggestions ??

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 September 2004 - 08:58

You seem to be using an MSI type of project, not a InstallScript project. Therefore I'm moving your question to MSI custom action forum.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 16 September 2004 - 09:00

You don't need Wscript. The script is hosted inside MSI. You should be able to directly accessx Shell, without Wscript.

ehj

ehj
  • Members
  • 3 posts

Posted 16 September 2004 - 22:03

Yes, I found out after some googling. But thanks anyway smile.gif