Automatic account creation is now enabled. Captcha authentication required for account creation and editing unless you are trusted here.
WiX and SQLServer
From WiX Wiki at MindCapers
Contents |
SQLServer properties, query batch
A stored procedure definition must be the only thing in the query batch. There should be a GO command after SET QUOTED_IDENTIFIER ON and after the END (note that BEGIN/END are not necessary around a stored procedure body because of the requirement that it's the only thing in the batch). If there are GO commands there, then there's a problem with splitting the script at that point.
Creating SqlDataase with/without Windows Authentification
<util:User Id="SQLUser" Name="[SQLUSERNAME]"
Password="[SQLUSERPASSWORD]" />
...
<!--database authentification, SQLUSER will be used -->
<!-- SQLUSERNAME and SQLUSERPASSWORD will be entered in a customized dialog -->
<Component Id="CreateDBUser" DiskId="1" Guid="YOURGUID">
<sql:SqlDatabase Id="dbUser" Server="[SQLSERVER]"
Database="[SQLDBNAME]" CreateOnInstall="yes" ConfirmOverwrite="yes"
DropOnReinstall="no" DropOnUninstall="no" User="SQLUser">
<sql:SqlScript Id="CreateTablesSqlScriptUser" ContinueOnError="no"
ExecuteOnInstall="yes" ExecuteOnReinstall="no" Sequence="002"
BinaryKey="CreateTablesBin" User="SQLUser" />
</sql:SqlDatabase>
<Condition>WIN_AUTH_DB="False"</Condition>
</Component>
<!-- Windows authentification, without User attribute -->
<Component Id="CreateDBWindows" DiskId="1" Guid="YOURGUID">
<sql:SqlDatabase Id="dbWindows" Server="[SQLSERVER]"
Database="[SQLDBNAME]" CreateOnInstall="yes" ConfirmOverwrite="yes"
DropOnReinstall="no" DropOnUninstall="no">
<sql:SqlScript Id="CreateTablesSqlScriptWindows"
ContinueOnError="no" ExecuteOnInstall="yes" ExecuteOnReinstall="no"
Sequence="002" BinaryKey="CreateTablesBin" />
</sql:SqlDatabase>
<Condition>WIN_AUTH_DB="True"</Condition>
</Component>
...
<!-- this script will be used for both above -->
<Binary Id="CreateTablesBin" SourceFile="Create XCB Tables_Views_StoredProcedures.sql">
</Binary>
...
<!-- the property WIN_AUTH_DB will be set using a radio button control in the same customized dialog
as username and password -->
<!-- the property must be "global", eg. its name uses capitals only -->
<Control Id="SecurityButtons1" Type="RadioButtonGroup" X="90"
Y="142" Width="197" Height="30" Property="WIN_AUTH_DB">
</Control>
...
<RadioButtonGroup Property="WIN_AUTH_DB">
<RadioButton Text="{\DlgFont8}&Integrated Security (Windows authentification)" Value="True" X="0" Y="0" Width="206" Height="12" />
<RadioButton Text="{\DlgFont8}&User Name and Password"
Value="False" X="0" Y="15" Width="206" Height="15" />
</RadioButtonGroup>
Running SQLCMD via WiX
See Neil Sleightholm's blog for an indepth article with source code.
Thread about choosing what server
Hi Matthew,
The error you encounter is because the CA function is not exported in the DLL; in my project i forgot to add the DEF file in the linker options; just add $(TargetPath).DEF to the appropriate linker setting. (Configuration Properties -> Linker -> Input -> Module Definition File) Rebuild and you're done..
I've updated my project for this and added a sample wxs file which runs great :-)
If you wish I'll send you an update; I still haven't found where to put the files online so any suggestions are welcome :)
Messageboxes in the CA are possible with ::AfxMessageBox(..) although i recommend in using the log functions instead.
Regards,
Albert van Peppen
________________________________
Van: Matthew Rowan [1] Verzonden: woensdag 24 januari 2007 8:07 Aan: Albert van Peppen; wix-users@lists.sourceforge.net Onderwerp: Re: SQL Server List in ComboBox
Thanks Albert,
I'm still having some trouble I'm hoping you could please help me with. I've built the dll and added these lines to my WiX source as in the example in the C++ code you provided.
<Property Id="D4WSQLSERVER">(local)</Property>
<Property Id="D4WLOCALDATABASEONLY">0</Property><br />
<CustomAction Id="D4WFillSQLServersListbox" BinaryKey="SQLMsiCA"
DllEntry="D4WFillSQLServersListbox" />
<Binary Id="SQLMsiCA"
SourceFile="CustomActions\SQLMsiCA\Release\SQLMsiCA.dll" /> <br />
<InstallUISequence>
<Custom Action="D4WFillSQLServersListbox"
After="CostFinalize">D4WSQLSERVER = "(local)"</Custom>
</InstallUISequence> <br />
<Control Id="D4WFillSQLServersListbox" Type="ListBox" X="18" Y="106"
Width="278" Height="80" Property="D4WSQLSERVER" Sorted="yes" />
However, when I run the installer I get an error immediately as shown
below:
Action 16:52:03: D4WFillSQLServersListbox.<br /> Action start 16:52:03: D4WFillSQLServersListbox.<br /> Error 1723. There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action D4WFillSQLServersListbox, entry: D4WFillSQLServersListbox, library:<br /> C:\DOCUME~1\mrowan\LOCALS~1\Temp\MSI19E.tmp <br /> MSI (c) (E0:F8) [16:52:05:526]: Product: Zap BI Suite -- Error 1723.<br /> There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. Action D4WFillSQLServersListbox, entry: D4WFillSQLServersListbox, library: C:\DOCUME~1\mrowan\LOCALS~1\Temp\MSI19E.tmp <br /> Action ended 16:52:05: D4WFillSQLServersListbox. Return value 3.
I don't know how to display a MessageBox to see if it has gotten into the function as I have seen suggested, since I don't know how to get a hWnd handle. I have been trying all day to get it to work with no avail. If you could point me to some tutorials or documentation regarding C++ custom action writing or suggest anything I'm doing wrong, it would be much appreciated.
Thanks,
-Matthew Rowan
SQLMsiCA
SQL MSI Custom Actions I.ve just put a new version of SQLMsiCA (V1.70) online on http://madbutcher.dyndns.org/snippets/.

