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

Custom Action when calling VBScript


3 replies to this topic

badzoy07

badzoy07
  • Full Members
  • 27 posts

Posted 22 September 2008 - 11:22

Hi,
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.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 22 September 2008 - 13:40

Most 1720 errors are due to the use of the 'WScript' directive (e.g. WScript.Echo). The Windows Installer engine uses its own VBScript 'host', not the Windows Scripting Host. Thus, anywhere you see 'WScript', remove it. Of course, this means you can't use certain things which you may be used to (and which appear in samples) in which case, you need to re-work the code to avoid its use.

Note that this advice does NOT apply to creating objects with 'WScript' prefixes. For example, this line:
CODE
Set objWshShell = WScript.CreateObject("WScript.Shell")

needs to become:
CODE
Set objWshShell = CreateObject("WScript.Shell")



- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- 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.

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 22 September 2008 - 14:09

Your friend may be right, that the file that you are overwriting is in use and you need to unload this from SQL Server.
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.


badzoy07

badzoy07
  • Full Members
  • 27 posts

Posted 23 September 2008 - 08:25

Hi VBScab and Zweitze, thank you so much. Now I know how to start with and what aspect I should consider in fixing this error.

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