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

Help, why won't my CA run


3 replies to this topic

DavidF

DavidF
  • Members
  • 7 posts

Posted 31 January 2002 - 16:01

I am unable to get this CA to run

Dim strDBLoc, WshShell

Set WshShell = Wscript.CreateObject("Wscript.Shell")

strDBLoc = WshShell.RegRead("HKLM\Software\Altiris\Altiris eXpress\DataStorePath")

If strDBLoc = Null OR strDBLoc =  "" Then
WScript.Echo("No path specified in the registry")
Else
strDBLoc=REPLACE(strDBLoc,Chr(34),"")
WScript.Echo(strDBloc & " otepad.exe")
WshShell.Run(strDBLoc & " otepad.exe ")
End If

The CA obtains the path of the exe from the registry and then executes the exe.  My problem is that when installing the install bombs with error 1721.  The vbscript executes normally when run in Windows but not in the MSI.


Kurt Schneider

Kurt Schneider
  • Members
  • 98 posts

Posted 31 January 2002 - 17:50

David,

Not sure why it isn't working.  I have had oWindows Script Host do strange things oto me as well.  Here is my suggestion, it isn't completely done through a CA:

To Read the registry key do the following, go to the Power Editor and then go to the RegLocator table.  Enter the following:

Signature:  MYREGKEY
Root:  2
Key:  \SOFTWARE\Altiris\Altiris eXpress\
Name:  DataStorePath
Value:  2

Next in the Power Editor go to the AppSearch table and enter the following:

Property:  MYREGPROP
Signature:  MYREGKEY

This will set a Property with the value of the DataStorePath key if a value exists.  If not the Property will be blank.  I am not sure why you are replacing Carraige Return Line Feeds with "".  I don't know how you could get a CRLF in a reg key value but anyways, you could write some VBScript to do it:

Dim sProp

sProp = Session.Property("MYREGPROP")
sProp = Replace(sProp,chr(34),"")

Session.Property("MYREGPROP") = sProp

-------------------------------------------------------

Now you can write a Custom action to launch an executable (notepad.exe), and you can use the Property value to pass Notepad the path to whatever it is you were going to run.

Hope this gives you another alternative to using WSH.

Good Luck

Kurt Schneider


Brian Elliott

Brian Elliott
  • Members
  • 5 posts

Posted 31 January 2002 - 22:03

It is true, InstallShield's implementation of the scriting host is odd, however, I think this will solve yon problem:

The installshield scripting host doesn't understand wscript.createobject - replace with

Set WshShell = CreateObject ("WScript.Shell")
and watch out for wscript.echo's - it is much better to drop all that stuff into a logfile with a filesystemobject / textstream.WriteLine.

If this doesn't to work, drop me an email cause you are close to getting it to work.  Custom VB scripts are my forte (I've got over 30 of them in my various installations).
Brian.


DavidF

DavidF
  • Members
  • 7 posts

Posted 01 February 2002 - 08:53

Brian\Kurt thanks for your help.  I have removed the Wscript references and the script is running.