Henrik Grankvist

Custom Action Error but only on windows XP - URGENT

Hello!

I have created a custom vbscript action that runs a few commands on a database. The database is msde and is installed during installation of another program with advanced installer.

The thing is that the script works very well on windows2000 but on windowsxp it won't run, no matter what I do. I have tried the following variants on the script:

variant 1:

Code: Select all

Function runSqlScripts()
Const ERROR_SUCCESS = 0
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "osql -U sa -P pwd -i %TEMP%\db.sql", 1, true
WshShell.Run "osql -U sa -P pwd -i %TEMP%\logdb.sql", 1, true
WshShell.Run "osql -U sa -P pwd -i %TEMP%\CreateUsers.sql", 1, true
WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLSERVER\MSSQLSERVER\SuperSocketNetLib\ProtocolList", "tcp", "REG_SZ"
runSqlScripts = ERROR_SUCCESS
Exit Function
End Function
variant 2:

Code: Select all

Function runSqlScripts() 
Set WshShell = CreateObject("WScript.Shell")
Rem Return = WshShell.Run("osql -U sa -P pwd -i fpdb.sql",1,true)
ret1 = WshShell.Run("osql -U sa -P pwd -i %TEMP%\db.sql", 1, true)
ret2 = WshShell.Run("osql -U sa -P pwd -i %TEMP%\logdb.sql", 1, true)
ret3 = WshShell.Run("osql -U sa -P pwd -i %TEMP%\CreateUsers.sql", 1, true)

WshShell.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLSERVER\MSSQLSERVER\SuperSocketNetLib\ProtocolList", "tcp", "REG_SZ"
runSqlScripts = 1
Exit Function
End Function
And yes, the sqlscripts (db.sql, logdb.sql and CreateUsers.sql) are during install available in the temp dir also osql.exe is available. Variant no 2 above works perfectly on a windows2000 machine, I haven't tested variant1 yet.

The error I get in the log file on windowsXP (variant no1) is the following:
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 runSqlScripts.vbs script error -2147024894, : Line 4, Column 1,

I can not figure out what is wrong, if I try to run the script manually while the error box that is stating that the script couldn't be run then it works ok. But it doesn't work if the installerpackage tries to run it, does anyone here have a clue why???

Thanks in advance
Henrik Grankvist

Developer/Consultant
AerotechTelub AB

Return to “Common Problems”