View Full Version : Capturing SQL errors

04-04-2006, 11:21 AM
I have a few scripts in the SQL view -- and I need to capture any errors that are returned from SQL Server so that I may place them into a log for the user to view after installation. Is there a way to do this in an InstallScript MSI project?

In my InstallScript projects, I do this by modifying the OnSQLBatchScript function and other functions where I can explicitly access the error being returned. In this InstallScript MSI project, it looks like I don't have access to those functions :(

04-06-2006, 10:06 AM

04-06-2006, 12:49 PM
In InstallScript MSI projects, SQL scripts will be executed by the ISSQLServerInstall action and SQL errors are written to a MSI verbose log. At this time InstallShield does not have the ability for Basic MSI and InstallScript MSI project types to capture SQL errors from InstallScript code.

Best regards.

04-06-2006, 03:07 PM
So if I add the cmd line:

"/L*v C:\everything.log"

to the MSI Command-Line Arguments property of a release icon in the Releases view, then the SQL errors will show up there? If so, is there any command line argument I could pass that will target a smaller set of errors such as SQL errors?

Thanks for your reply! :)

04-06-2006, 06:27 PM
Also, in the command line I'd like to have the log file created in INSTALLDIR, but I haven't found a way of using that value in the MSI Command-Line Arguments section of releases.

Any idea how to do this?


04-13-2006, 03:38 PM

Anyone know how to get the log file to be created in INSTALLDIR?

04-13-2006, 04:15 PM
MSI properties cannot be used to specify a log file because it needs to be specified before the setup starts. You can use an environment variable to specify a log file location that is the same location of the INSTALLDIR as follows:

setup.exe /v"/l*v %ENV%\log.log INSTALLDIR=%ENV%"

However, it will not match if an end user changes the INSTALLDIR location during the installation.

Hope this helps.

04-17-2006, 10:28 AM
I see, thanks for the reply.

I've tried moving the file to a different location at the end of the install with XCOPY, but it doesn't work. I'm thinking that the log file is still open, and this is why XCOPY fails.

Is there any command line arguement or other method to allow this file to be copied/moved?

04-17-2006, 06:43 PM
Since Windows Installer locks the log file, there is not much we can do for the issue. I filed the work order #IOC-000005873 to consider how InstallShield can support it to get workaround. We would probably have the ability to write only SQL related messages to a different log file.

Thank you for your feedback.

05-22-2006, 05:47 PM
Is there any new word on this Hidenori?