1

I think I found a bug with multi-line comments and SQL scripts in InstallShield 2010.

To reproduce the bug, create a basic MSI project. Go to Installation Designer -> SQL Scripts, create a SQL connection then add a new script that contains the following script:

/*
USE [master]
GO
*/

USE master
GO

Build the MSI and try to install it, you will receive the following MSI error:

Error 27506.Error executing SQL script sqlscript.sql. Line 3. Missing end comment mark '*/'. (113)

Changing the multi-line comment to -- form will solve the issue. Also, if the end comment mark is not being preceded by a GO statement, the install will not fail. For instance:

/*
THIS
WILL
NOT
FAIL
*/

Has someone experienced this bug? Any way to "fix" it?

PS: I'll be posting this to Flexara's forum.

Ian
  • 5,625
  • 11
  • 57
  • 93

1 Answers1

2

This sounds like known behavior to me. I believe the parsing looks for lines of GO without respect to anything else, so multi-line comments do not affect it. See hidenori's second response on the thread Install Shield is trashing SQL Scripts.

You appear to have already identified the workaround - change the GO to a --GO.

Michael Urman
  • 15,737
  • 2
  • 28
  • 44
  • Yup. But the workaround is unacceptable because the SQL files are being generated by an O/R mapping tool. – Ian Jul 14 '11 at 13:07
  • Seems odd that a tool would generate commented sections. Can you fix the tool? Or change the separator from `GO` to something else? – Michael Urman Jul 15 '11 at 13:04
  • There are no options to turn off the comments on generated code. Worst case, I think I'll need to write a scrubber to clean the generated script. BTW, the tool is LLBLGen. I think its quite popular. – Ian Jul 15 '11 at 15:51