Finally I found a way to give the user a choice and don't want to
withhold it:

 

I use two components, one for SQL-Auth and one for Win-Auth:

              <Component Id="CreateDB_WinAuth"
Guid="3A10A7F9-E920-430a-88B1-E97584AC65E8">

                           <!-- Create a DB with Windows Authentication
-->

                           <SqlDatabase Id='SqlDatabaseWinAuth'
Database='TranspoDispo' Server='[DBSERVER]' CreateOnInstall='yes'
DropOnUninstall='no' ContinueOnError='no'>

                           </SqlDatabase>

                     </Component>

                     

                     <Component Id="CreateDB_SqlAuth"
Guid="6FAE9F5E-AFF8-4b15-B9EE-BA427854D461">

                           <!-- Create a DB with SQL-Server
Authentication -->

                           <SqlDatabase Id='SqlDatabaseSQLAuth'
Database='TranspoDispo' User='DBCreationUser' Server='[DBSERVER]'
CreateOnInstall='yes' DropOnUninstall='no' ContinueOnError='no'>

                           </SqlDatabase>

                     </Component>

 

Additionally I have two features which get installed as default but
which are not displayed in the feature tree of the UI:

<Feature Id="Feature_DB_WinAuth" Title="Database" Level="1"
Display="hidden">

                     <ComponentRef Id="CreateDB_WinAuth" />

              </Feature>

              <Feature Id="Feature_DB_SqlAuth" Title="Database"
Level="1" Display="hidden">

                     <ComponentRef Id="CreateDB_SqlAuth" />

              </Feature>

 

And a dummy feature which refs the two DB-Features:

<Feature Id="Feature_DB_DUMMY" Title="Database" Level="1">

                     <FeatureRef Id="Feature_DB_WinAuth" />

                     <FeatureRef Id="Feature_DB_SqlAuth" />

              </Feature>

 

In the UI I have to do the following:

<RadioButtonGroup Property="WINAUTH">

                           <RadioButton Text="Windows Authentifizierung"
X="5" Y="0" Width="300" Height="15" Value="yes" />

                           <RadioButton Text="SQL-Server
Authentifizierung" X="5" Y="20" Width="300" Height="15" Value="no" />

                     </RadioButtonGroup>

 

<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56"
Height="17" Default="yes" Text="[Button_Next]">

                                  <Publish Event="Remove"
Value="Feature_DB_SqlAuth">WINAUTH = "yes"</Publish>

                                  <Publish Event="Remove"
Value="Feature_DB_WinAuth">WINAUTH = "no"</Publish>

                                  <Publish Event="NewDialog"
Value="VerifyReadyDialog">1</Publish>

                           </Control>

 

This works fine for me

 

Daniel

 

From: Daniel Janz 
Sent: Montag, 7. Januar 2008 16:31
To: 'wix-users@lists.sourceforge.net'
Subject: How to use Windows-Authentication for SQL-Server with WiX?

 

Hi,

 

I'm just wondering if it's possible to create a database on a
SQL-Server using its Windows-Authentication feature. 

I managed to create a database using the SQL-Server's "sa"-Account but I
need to give the user the choice between the two different login modes.

 

I'm working with version 2 of WiX which is delivered with SharpDevelop
and currently use the "User"-Tag as described in this tutorial:
http://www.tramontana.co.hu/wix/lesson7.php .

 

Thanks in advance!

Daniel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to