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

Internal Error 2740


4 replies to this topic

Cusumano

Cusumano
  • Members
  • 4 posts

Posted 07 February 2002 - 16:10

I've create a VBS Script into Script in Custom Action.
When I run the install I'm getting an Internal Error 2740.

Does anyone know what I'm doing wrong.

Thanks,

Salvatore Cusumano


Cusumano

Cusumano
  • Members
  • 4 posts

Posted 07 February 2002 - 16:21

....and this is the content of my VBS Script.
It works very properly when I start this separate!
Why didn`t works into CA?


'==========================================================================
'
' VBScript Source File -- Created with Notepad
'
' NAME: Restore-Userinfo.vbs
'
' AUTHOR: Salvatore Cusumano
' DATE  : 17.01.2002
'
'
'==========================================================================

Option Explicit
'On Error Resume Next

'Konstanten
Const WinntPath = "C:\Winnt\"
Const UserDrivePath = "L:\MyDocu~1\Applic~1\Microsoft\Office\Sysfiles\"
Const BookXLTPath = "C:\Progra~1\Micros~2\Office\XLSTART\"
Const Temp = "C:\Temp\"

Dim WSHShell, WSHNetwork' Objektvariable
Dim fso, Stand, RunExe, Computername  ' Objektvariable


' Erstelle der Objekte, welches wir
' zum Zugriff auf das Dateisystem brauchen.
Set WSHShell = WScript.CreateObject("WScript.Shell")
Set WSHNetwork = WScript.CreateObject("Wscript.Network")
Set fso = CreateObject("Scripting.FileSystemObject")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set RunExe=Wscript.CreateObject("Wscript.Shell")

If (Not Fso.FolderExists(UserDrivePath)) Then WScript.Quit

'Autocorrect Files werden zurückkopiert
If (fso.FileExists(UserDrivePath & WshNetworK.Username &".acl")) Then
fso.CopyFile UserDrivePath & WshNetworK.Username &".acl", WinntPath  & WshNetworK.Username &".acl", True
End If

'Excel Toolbars File wird zurückkopiert
If (fso.FileExists(UserDrivePath & WshNetworK.Username &"8.xlb")) Then
fso.CopyFile UserDrivePath & WshNetworK.Username &"8.xlb", WinntPath  & WshNetworK.Username &"8.xlb", True
End If      

'PowerPoint Toolbars File wird zurückkopiert
If (fso.FileExists(UserDrivePath & WshNetworK.Username &".pcb")) Then
fso.CopyFile UserDrivePath & WshNetworK.Username &".pcb", WinntPath  & WshNetworK.Username &".pcb", True
End If

'Regfiles werden lokal kopiert      
fso.CopyFile UserDrivePath&"WordToolbars.reg ", Temp , True
fso.CopyFile UserDrivePath&"ExcelToolbars.reg ", Temp , True
fso.CopyFile UserDrivePath&"Autocorrect.reg ", Temp , True
fso.CopyFile UserDrivePath&"Userinfo.reg ", Temp , True
fso.CopyFile UserDrivePath&"UserTemplates.reg ", Temp , True


'User Templates Registry Key wird zurückkopiert
Stand = "c:\winnt\regedit.exe /s "& Temp&"UserTemplates.reg "
WSHShell.Run(Stand)

'Word Toolbars Registry Key wird zurückkopiert      
Stand = "c:\winnt\regedit.exe /s "& Temp&"WordToolbars.reg "
WSHShell.Run(Stand)

'Excel Toolbars Registry Key wird zurückkopiert
Stand = "c:\winnt\regedit.exe /s "& Temp&"ExcelToolbars.reg "
WSHShell.Run(Stand)

'AutoCorrect Path Registry Key wird zurückkopiert
Stand = "c:\winnt\regedit.exe /s "& Temp&"Autocorrect.reg "
WSHShell.Run(Stand)

'Userinfo Registry Key wird zurückkopiert
Stand = "c:\winnt\regedit.exe /s "& Temp&"Userinfo.reg "
WSHShell.Run(Stand)

     
WScript.Quit


Leigh Ravenhall

Leigh Ravenhall
  • Members
  • 269 posts

Posted 07 February 2002 - 23:19

When you run a VBScript through Windows Installer, you don't actually have access to the WScript object at the start of the script.  I guess the script would be crashing out at:
Set WSHShell = WScript.CreateObject("WScript.Shell")
Just try the line as:
Set WSHShell = CreateObject("WScript.Shell")
Change all other WScript.CreateObject lines.

It will probably also hit problems on the WScript.Quit at the end.

If you are having trouble debugging something like this in Windows Installer, create a verbose log file.  When Windows Installer crashes on a VBScript custom action, it sometimes writes useful information, like the line and column number it died on.

Hope this helps,


Cusumano

Cusumano
  • Members
  • 4 posts

Posted 08 February 2002 - 11:14

Hello Leigh

Yes,it works properly after I changed another this line:

"L:\MyDocu~1\Applic~1\Microsoft\Office\Sysfiles\"

without tilde

"L:\My Documents\Application Data\Microsoft\Office\Sysfiles\"


Thanks a lot for your help!

Best Regards

Salvatore


Cusumano

Cusumano
  • Members
  • 4 posts

Posted 08 February 2002 - 11:22

Hello Leigh

Yes,it works properly now.
But I musted change another line:

"L:\MyDocu~1\Applic~1\Microsoft\Office\Sysfiles\"

without tilde

"L:\My Documents\Application Data\Microsoft\Office\Sysfiles\"


Thanks a lot for your help!

Best Regards

Salvatore