I am using Wise PS 3.2. I have created a custom (vbscript with embedded code, normal execute immeadiate/deferred, 1 step before scheduled reboot, deferred execution - system context, synchronous processing) with the following coding

Set objShell = WScript.CreateObject("WScript.Shell")
Set objEnvVar = objShell.Environment("PROCESS")

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(objEnvVar("ProgramFiles") & "\Reuters\ipcroute",True)

objfile.WriteLine("#triarch_sink.sinklib:<localHostName>:<SinkDistributor>")
objfile.WriteLine("triarch_sink.sinklib:"& objEnvVar("COMPUTERNAME") & ":dist1 dist2")
objfile.WriteLine("triarch_dbms.srclib:"& objEnvVar("COMPUTERNAME") & ":src1 src2")
objFile.Close

This creates a file and populates it with the computer name of the machine the msi is being run on.

Whenever I compile this and try installing I get an internal error 2762.

CAn you help??
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Hello LawrenceTucker,

The error you are receiving is because you have set the Custom Action to "deferred execution - system context", yet placed the action outside of the required sequence (which exists from InstallInitalize and InstallFinalize).

Move the custom action so that it is before InstallFinalize.
Answered 10/26/2005 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
Sorry the actual error code is 1720.
The action does lie between installinitialize and and installfinalize.

Any other ideas??
Answered 10/26/2005 by: LawrenceTucker
Yellow Belt

Please log in to comment
0
Set objShell = WScript.CreateObject("WScript.Shell")

delete WScript just use Set objShell = CreateObject("WScript.Shell")
Answered 10/26/2005 by: artiahc_elay
Senior Yellow Belt

Please log in to comment
0
OK, error code 1720 means there is a problem with your script.

I've looked at your script at the top of this page, and see the command line:

Set objShell = WScript.CreateObject("WScript.Shell")

Change this line so that it reads:

Set objShell = CreateObject("WScript.Shell")

(You can't use that syntax within MSI custom actions. I don't know why not, but I just know you can't. If anyone knows the reasoning behind this, please let us know! [8D] )
Answered 10/26/2005 by: brenthunter2005
Fifth Degree Brown Belt

Please log in to comment
0
Funniliy enough I tried that and it worked......... I was just coming back to post the solution and saw that two people provided me with an answer. Thanks anyway.
Answered 10/26/2005 by: LawrenceTucker
Yellow Belt

Please log in to comment
0
If anyone knows the reasoning behind this, please let us know

"The installer runs script custom actions directly and does not use the Windows Script Host. The WScript object cannot be used inside a script custom action because this object is provided by the Windows Script Host. Objects in the Windows Script Host object model can only be used in custom actions if Windows Script Host is installed on the computer by creating new instances of the object, with a call to CreateObject, and providing the ProgId of the object (for example "WScript.Shell"). Depending on the type of script custom action, access to some objects and methods of the Windows Script Host object model may be denied for security reasons."

Clear as mud [:D]

Cheers,
Rob.
Answered 10/26/2005 by: MSIPackager
Third Degree Black Belt

Please log in to comment
2
Hi All:

The reason behind why you cannot use wscript.createobject coz MSI custom actions do not believe in instance creation at runtime and its not with Wscript.Createobject its with almost everything if you try to create any object at the runtime.
Answered 10/26/2005 by: wiseapp
Second Degree Green Belt

Please log in to comment
Answer this question or Comment on this question for clarity