Custom Action when calling VBScript
Posted 22 September 2008 - 11:22
I would like to ask for help ragrding the problem I encountered when trying to install our application "M3 7.1 Replication Server 6.0.3". An error 1720 occured please see below:
MSI (s) (2C:8C) [17:11:50:099]: Product: M3 7.1 Replication Server 6.0.3 -- 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 CopySetupFiles script error -2146828275, Microsoft VBScript runtime error: Type mismatch: 'sqlfile_reldll' Line 421, Column 5,
The action script CopySetupFiles is called in the installer using a code made in VBScript function CopyReplicationServerFiles(). I figured out that my function fails to copy the new dll file to the specified location as it is an SQL path.
"D:\program files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn"
I tried to delete the file but it cannot, instead I rename the dll file and it worked. I tried installing and it works as it was unloaded already. Someone told me that I should use this command inside the vbscript to unload the dll before copying or overwriting the file as it's locked by SQL. The command is
"DBCC dllname ( FREE )". However, I cannot make it work and it's displaying the same error 1720. I declared my dll file to -- DBCC sqlfile_reldll (FREE). It says type mismatch. I'm not good at vbscript. Do I need to include or import something to be able to use the DBCC?? or there something wrong with my code.
Please, I really need you help. Thank you so much.
Posted 22 September 2008 - 13:40
Note that this advice does NOT apply to creating objects with 'WScript' prefixes. For example, this line:
|Set objWshShell = WScript.CreateObject("WScript.Shell")|
needs to become:
|Set objWshShell = CreateObject("WScript.Shell")|
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.
Posted 22 September 2008 - 14:09
One method is to stop the SQL Server service completely, and restart it afterwards. But this may have consequences you don't want to take.
The suggestion of using DBCC may work. Remember that DBCC is a SQL statement. So, to execute this, you need to build a connection string to the intended SQL Server instance, connect to it, and execute the statement.
Beware that the statement may fail in certain circumstances - for instance, insufficient priviliges.
You may be able to do all this (including the check of failure) in VB Script but your MSI authoring software may have better options for SQL Server management.
Edited by Zweitze, 22 September 2008 - 14:09.
Posted 23 September 2008 - 08:25
I'll also try create a function in VBScript to connect to osql and then use the DBCC command statement to release the dll files. Thanks again