You probably have a UTF-16 script without a leading Byte Order Mark (U+FEFF,
the byte sequence 0xFF 0xFE for UTF-16 little-endian). Without the BOM, the
SQL custom action assumes that the script is ANSI and converts using
MultiByteToWideChar. If the data is actually UTF-16, the script will simply
appear to be a 'C' followed by a NULL byte.

 

Just a thought here, but should we really be using the end system's ANSI
codepage to convert to UTF-16 here (the code has CP_ACP)? If you install on
a system with a different codepage from that the file was generated on, you
could get unwanted results.

 

I think it would be better for the compiler to do the conversion before
storing the script to the Binary table. That would allow us to drop the
UTF-16 detection and conversion code in the custom action. Other thoughts:
use the codepage of the MSI database itself (looks quite difficult:
http://msdn2.microsoft.com/en-gb/library/aa368277.aspx), or extend the
schema to allow the appropriate codepage to be recorded. This would probably
be a good idea even if the compiler is extended to convert the script to
UTF-16 first. Alternatively we could just drop support for non-UTF-16
scripts, but that's a little unfriendly.

 

One idea I really wouldn't recommend is using the IsTextUnicode function:
see http://blogs.msdn.com/michkap/archive/2006/06/14/631016.aspx.

 

-- 

Mike Dimmick

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Dhaval Patel
Sent: 12 December 2006 01:18
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] SQL Script

 

I am a WIX newbie and I think I have been able to grasp most of the
functionality via trial and error over the last week or so. Nevertheless,
making this SQL script execute has been driving me nuts. I am hoping one of
you experienced folks will be able to help me out. I have attached an image
of the error I receive upon installation and here is the exact text of the
error: 

"Failed to execute SQL string, error detail: Could not find stored procedure
'C'., SQL Key: Script SQL string: C"

The very first line I had in my SQL script is: CREATE TABLE
[dbo].[DataMerge]

Before that I had the line: USE TABLE [MergeFiles] and I received this error
- "Failed to execute SQL string, error detail: Could not find stored
procedure 'U'., SQL Key: Script SQL string: U"

It seems that no matter what I put in the my sql script, it errors out on
the first character. Here is my WIX code:
<Component Id ='SqlDatabase' DiskId='1'
Guid='7FE20B5C-FF37-4618-8D6F-3D04BD66E845'>
    <SqlDatabase Id='Sql' ContinueOnError='no' CreateOnInstall='yes'
Database='MergeNist'
        CreateOnReinstall='no' DropOnUninstall='yes'
Instance='[SQLINSTANCE]' DropOnReinstall='no' 
        User='MySqlUser' Server='[SQLSERVER]' >
        <SqlScript Id='Script' BinaryKey='CreateSql' ExecuteOnInstall='yes'
/>
    </SqlDatabase>
</Component>

<!-- Path to Sql script -->
<Binary Id='CreateSql' SourceFile='Database.sql' />

Let me know if I am missing anything. It'd be thrilling for my entire team
if I get this to work. I am able to create a virtual directory, a Windows
user, install a service, and various assmeblies to the GAC. This is the only
thing that's not working. Thanks in advance!

  _____  

All-in-one security and maintenance for your PC.  Get a free 90-day trial!
Learn more!
<http://www.windowsonecare.com/purchase/trial.aspx?sc_cid=wl_wlmail> 

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to