error 170
I'm running the following script as a custom action
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
WindowsFolder = oShell.ExpandEnvironmentStrings("%WinDir%")
'Set f = fso.OpenTextFile("C:\WINDOWS\system32\drivers\etc\services", ForAppending, True)
Set f = fso.OpenTextFile(WindowsFolder & "\system32\drivers\etc\services", ForAppending, True)
'Set f = fso.OpenTextFile(System.Property("SystemFolder") & "drivers\etc\services", ForAppending, True)
f.WriteLine "otsl_ar_ep 4290/tcp"
f.WriteLine "otsl_ep 4295/tcp"
f.WriteLine "otsl_a_ep 4296/tcp"
f.WriteLine "otsl_rp 6002/tcp"
f.Close
When I run this script externally, it works fine. But when I try to run it as a custom action I get the 1720 error.
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("Wscript.Shell")
WindowsFolder = oShell.ExpandEnvironmentStrings("%WinDir%")
'Set f = fso.OpenTextFile("C:\WINDOWS\system32\drivers\etc\services", ForAppending, True)
Set f = fso.OpenTextFile(WindowsFolder & "\system32\drivers\etc\services", ForAppending, True)
'Set f = fso.OpenTextFile(System.Property("SystemFolder") & "drivers\etc\services", ForAppending, True)
f.WriteLine "otsl_ar_ep 4290/tcp"
f.WriteLine "otsl_ep 4295/tcp"
f.WriteLine "otsl_a_ep 4296/tcp"
f.WriteLine "otsl_rp 6002/tcp"
f.Close
When I run this script externally, it works fine. But when I try to run it as a custom action I get the 1720 error.
0 Comments
[ + ] Show comments
Answers (7)
Please log in to answer
Posted by:
akhlaque
19 years ago
Posted by:
TomB
19 years ago
Posted by:
urban_diver
19 years ago
This is the error information message in the event viewer:
Product: PAS -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action Add Entries to Services File script error -2146827864, Microsoft VBScript runtime error: Object required: 'oShell' Line 5, Column 4,
Product: PAS -- Error 1720. There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action Add Entries to Services File script error -2146827864, Microsoft VBScript runtime error: Object required: 'oShell' Line 5, Column 4,
Posted by:
MSIPackager
19 years ago
When I run this script externally, it works fine. But when I try to run it as a custom action I get the 1720 error.
Where are you running the custom action - Execute Immediate / Deferred? Try sequencing it in Execute Deferred after Start Services... Also, ensure you are running it in the System Context.
Hope it helps,
Rob.
Posted by:
akhlaque
19 years ago
Posted by:
urban_diver
19 years ago
Apparently Wise doesn't like or understand "Set oShell". I changed that line to Set fso1 and it worked fine. This is the modified script:
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso1 = CreateObject("WScript.Shell")
WindowsFolder = fso1.ExpandEnvironmentStrings("%WinDir%")
'Set f = fso.OpenTextFile("C:\WINDOWS\system32\drivers\etc\services", ForAppending, True)
Set f = fso.OpenTextFile(WindowsFolder & "\system32\drivers\etc\services", ForAppending, True)
f.WriteLine "otsl_ar_ep 4290/tcp"
f.WriteLine "otsl_ep 4295/tcp"
f.WriteLine "otsl_a_ep 4296/tcp"
f.WriteLine "otsl_rp 6002/tcp"
f.Close
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso1 = CreateObject("WScript.Shell")
WindowsFolder = fso1.ExpandEnvironmentStrings("%WinDir%")
'Set f = fso.OpenTextFile("C:\WINDOWS\system32\drivers\etc\services", ForAppending, True)
Set f = fso.OpenTextFile(WindowsFolder & "\system32\drivers\etc\services", ForAppending, True)
f.WriteLine "otsl_ar_ep 4290/tcp"
f.WriteLine "otsl_ep 4295/tcp"
f.WriteLine "otsl_a_ep 4296/tcp"
f.WriteLine "otsl_rp 6002/tcp"
f.Close
Posted by:
MSIPackager
19 years ago
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.