Yes.  In your case, if SQL_ADMIN_USERNAME and SQL_ADMIN_PASSWORD both evaluate 
to empty-string, then the sql:SqlDatabase will deploy with Windows 
Authentication.

I use this pattern all the time.

--
John Merryweather Cooper
Build & Install Engineer - ESA
Jack Henry & Associates, Inc.®
Shawnee Mission, KS  66227
Office:  913-341-3434 x791011
jocoo...@jackhenry.com
www.jackhenry.com



-----Original Message-----
From: Levi Wilson [mailto:l...@leviwilson.com] 
Sent: Tuesday, March 11, 2014 10:33 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Conditional SSPI / SQL Authentication on SqlScript

I have a component that has multiple <SqlScript /> elements. In my dialog 
sequence  I allow the user to choose whether or not they want to use SQL or 
Windows Authentication for the connection.

Each <SqlScript /> references my <SqlDatabase /> that currently looks like
this:

<util:User Id='SqlInstallerUserId'
  Name='[SQL_ADMIN_USERNAME]'
  Password='[SQL_ADMIN_PASSWORD]' />

<sql:SqlDatabase Id="CompassFrameworkDatabase"
  Server="[SQL_SERVER]" Database="[SQL_DATABASE]"
  User="SqlInstallerUserId" />

The problem is that will never work with Windows Authentication :-)

I've seen some have two different components that specified different 
<SqlDatabase /> elements, but I would rather not do that.

Is there a way to basically "clear" the "User_" record in the SqlDatabase table 
in the MSI to force it to use Windows Authentication depending on what the user 
chose in the dialog?

Thanks in advance.

Levi
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the 
definitive new guide to graph databases and their applications. Written by 
three acclaimed leaders in the field, this first edition is now available. 
Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
NOTICE: This electronic mail message and any files transmitted with it are 
intended
exclusively for the individual or entity to which it is addressed. The message, 
together with any attachment, may contain confidential and/or privileged 
information.
Any unauthorized review, use, printing, saving, copying, disclosure or 
distribution 
is strictly prohibited. If you have received this message in error, please 
immediately advise the sender by reply email and delete all copies.


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to