VBScript and custom actions - HELP
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??
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
Answers (7)
Please log in to answer
Posted by:
wiseapp
19 years ago
Posted by:
brenthunter2005
19 years ago
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.
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.
Posted by:
LawrenceTucker
19 years ago
Posted by:
artiahc_elay
19 years ago
Posted by:
brenthunter2005
19 years ago
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:
Change this line so that it reads:
(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] )
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] )
Posted by:
LawrenceTucker
19 years ago
Posted by:
MSIPackager
19 years ago
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.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.