This is a little crazy, so I'll try to be as clear as possible...

Here's the pertinent section of my DB installer:

        <!-- ******************** Database Creation Entities
******************** -->
        <util:User Id="SqlCreateUser" Name="[SQLCREATEUSER]"
Password="[SQLCREATEPASSWORD]" />

        <sql:SqlDatabase Id="SqlMasterDB" Database="master"
Server="[SQLSERVER]" />
        <sql:SqlDatabase Id="SqlMasterDBAuth" Database="master"
Server="[SQLSERVER]" User="SqlCreateUser" />
        <!-- ******************** /Database Creation Entities
******************** -->

        <CustomAction Id="SetDBUserMaster" Property="SqlMasterDB"
Value="SqlMasterDBAuth" />
        <InstallExecuteSequence>
            <Custom Action="SetDBUserMaster"
Before="ProcessComponents">USESQLAUTH=1</Custom>
        </InstallExecuteSequence>


First, I create a User entity using the possibly supplied properties.  Then
I create 2 SqlDatabase items.
SqlMasterDB is the one I intend to use with my scripts, and is set up to use
integrated security.
I also create a SqlMasterDBAuth which connects to the same server, but uses
SqlAuthentication.

I schedule a property replacement CA to assign the Sql Auth DB object over
the integrated security one if the USESQLAUTH Property is set.

This allows me to write all my components pointing to SqlMasterDB, and it
will contain the correct connection info when the time comes.

If this isn't clear enough, let me know.  I'll be happy to cover it more.

Chris

On Tue, Dec 16, 2008 at 8:12 AM, tgoffice <tgoff...@web.de> wrote:

>
> Ok, how can I implement it in a better way ...
>
> Thanks in advanced!
> tom
>
>
> cemiles wrote:
> >
> > Oh, I think I know what you're saying now.  And I believe the answer is
> > you
> > do need 2 components in order to do so, or so I've read and done.
> >
> > On Mon, Dec 15, 2008 at 9:10 AM, tgoffice <tgoff...@web.de> wrote:
> >
> >>
> >> Sorry, no this is a missunterstanding (my bad english
> >>  ... :confused:)
> >>
> >> How can I differ between a SqlDatabase with and without integrated
> >> security,
> >> withoud creating to components with nearly the same content (only the
> >> User
> >> differs but I have to duplicate all sql scripts)
> >>
> >>
> >>
> >>
> >> cemiles wrote:
> >> >
> >> > Sorry, and that tag is incorrect for the RBG.
> >> >
> >> > Should read <RadioButtonGroup Property="ISINTEGRATEDSECURITY">
> >> >
> >> >
> >> >
> >> > cemiles wrote:
> >> >>
> >> >> You could set up a radiobuttongroup control and tie that condition
> >> >> property to it.
> >> >>
> >> >> So, something like this would be the short version for 1 property
> >> >> DATABASEUSER:
> >> >>
> >> >>   <Fragment>
> >> >>     <UI>
> >> >>       <Dialog Id="DBUserServerDlg" Width="370" Height="270"
> >> >> Title="!(loc.DBUserServerDlg_Title)">
> >> >>         <Control Id="RadioButtons" Type="RadioButtonGroup" X="35"
> >> Y="85"
> >> >> Width="301" Height="66" Property="ISINTEGRATEDSECURITY">
> >> >>           <RadioButtonGroup Property="SQLTYPE">
> >> >>             <RadioButton Text="!(loc.DBUserServerDlg_DBRadio1_Text)"
> >> >> X="0" Y="0" Width="300" Height="15" Value="1" />
> >> >>           </RadioButtonGroup>
> >> >>         </Control>
> >> >>         <Control Type="Edit" Width="172" Height="15" X="155" Y="151"
> >> >> Id="DatabaseUserText" Property="DATABASEUSER">
> >> >>         <Condition Action="show">ISINTEGRATEDSECURITY=0</Condition>
> >> >>         <Condition Action="hide>ISINTEGRATEDSECURITY=1</Condition>
> >> >>         </Control>
> >> >>         <Control Type="Text" Width="112" Height="10" X="35" Y="154"
> >> >> Id="DatabaseUser" Transparent="yes" NoPrefix="yes"
> >> >> Text="!(loc.DBUserServerDlg_DatabaseUser)">
> >> >>           <Condition Action="show">ISINTEGRATEDSECURITY=0</Condition>
> >> >>           <Condition Action="hide">ISINTEGRATEDSECURITY=1</Condition>
> >> >>         </Control>
> >> >>       </Dialog>
> >> >>     </UI>
> >> >>   </Fragment>
> >> >>
> >> >> Is this what you're looking for or am I mis-reading?
> >> >>
> >> >>
> >> >> tgoffice wrote:
> >> >>>
> >> >>> Hello,
> >> >>>
> >> >>> what is the most elegant (common way) to distingwhish between sql
> >> >>> connection with integrated security and with user name/password.
> >> >>>
> >> >>> I have a GUI to enter user database server, instance name, user
> name,
> >> >>> password ... to connect to an database. If user name and password
> are
> >> >>> not provided integrated securits should be used.
> >> >>> I have a property "ISINTEGRATEDSECURITY" to differ between the
> >> >>> installation of two different components.
> >> >>> (very error pron and with duplicate code, very ugly)
> >> >>>
> >> >>> WIX code to differ between both authentications
> >> >>>
> >> >>> <util:User Id="DatabaseUser" Name="[DATABASEUSER]"
> >> >>> Password="[DATABASEPASSWORD]"/>
> >> >>>
> >> >>> <Component Directory="SERVERDIR" Id="comp_db_create" DiskId="1"
> >> >>> KeyPath="yes" Guid="3B3DCDB3-BCA8-4F71-8269-AF2F36EFF80A">
> >> >>>     <Condition>ISINTEGRATEDSECURITY = 0</Condition>
> >> >>>     <sql:SqlDatabase Id="ProcessEngineDatabase"
> >> ConfirmOverwrite="yes"
> >> >>> CreateOnInstall="yes" Server="[DATABASESERVER]"
> >> >>> Instance="[DATABASEINSTANCE]" Database="[DBNAME]"
> User="DatabaseUser"
> >> >>> ContinueOnError="no">
> >> >>>     <sql:SqlScript Id="Upper.S3.DataObjects.drop" BinaryKey="SQL1"
> >> >>> ExecuteOnInstall="yes" ContinueOnError="no" Sequence="10"/>
> >> >>> ...
> >> >>>
> >> >>> <Component Directory="SERVERDIR" Id="comp_db_create" DiskId="1"
> >> >>> KeyPath="yes" Guid="3B3DCDB3-BCA8-4F71-8269-AF2F36EFF80A">
> >> >>>     <Condition>ISINTEGRATEDSECURITY = 1</Condition>
> >> >>>     <sql:SqlDatabase Id="ProcessEngineDatabase"
> >> ConfirmOverwrite="yes"
> >> >>> CreateOnInstall="yes" Server="[DATABASESERVER]"
> >> >>> Instance="[DATABASEINSTANCE]" Database="[DBNAME]"
> >> ContinueOnError="no">
> >> >>>     <sql:SqlScript Id="Upper.S3.DataObjects.drop" BinaryKey="SQL1"
> >> >>> ExecuteOnInstall="yes" ContinueOnError="no" Sequence="10"/>
> >> >>> ...
> >> >>>
> >> >>> What is the best way to accomplish this issue.
> >> >>>
> >> >>> Thank's
> >> >>> TG
> >> >>>
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://n2.nabble.com/Distinguish-between-SQL-integrated-security-and-normal-authentication-tp1642658p1658344.html
> >>  Sent from the wix-users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> >> Nevada.
> >> The future of the web can't happen without you.  Join us at MIX09 to
> help
> >> pave the way to the Next Web now. Learn more and register at
> >>
> >>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> >> _______________________________________________
> >> WiX-users mailing list
> >> WiX-users@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/wix-users
> >>
> >
> >
> >
> > --
> > Chad E. Miles
> > Software Engineer, Development
> > Interactive Intelligence, Inc.
> > chad.mi...@inin.com
> > 317.715.8280 Office/Fax
> >
> ------------------------------------------------------------------------------
> > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas,
> > Nevada.
> > The future of the web can't happen without you.  Join us at MIX09 to help
> > pave the way to the Next Web now. Learn more and register at
> >
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> > _______________________________________________
> > WiX-users mailing list
> > WiX-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/wix-users
> >
> >
>
> --
> View this message in context:
> http://n2.nabble.com/Distinguish-between-SQL-integrated-security-and-normal-authentication-tp1642658p1662667.html
> Sent from the wix-users mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
>
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to