I'm assuming that the @BinaryKey attributes are pulling the scripts from the 
Binary table (populated with the <Binary> elements). Thus, you probably don't 
"need" the <File> elements with those same files for the <Sql:SqlScript> 
elements at all. That should get rid of the need to delete them towards the end 
of install.

-----Original Message-----
From: André Werlang [mailto:and...@gvdasa.com.br] 
Sent: Thursday, August 27, 2009 7:27 AM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] RES: Questions regarding the SqlExtension

Hi.

1) Check out the User and Password attributes of SqlDatabase.
   Need to ask the user for user/password? Create controls in a dialog and 
associate with properties.
   Remember to hid the password, i.e. <Property Id='SQLPASSWORD' 
Hidden='yes'></Property>

2) Hmm...I'm not sure, but I think that this binaries are deleted.

3) Could you write a single SQL script that checks on the existence of the 
database
   and perform the apropriate actions? Otherwise you would have to go for a 
custom
   action, I think.

Regards,

André Felipe Werlang

      Antes de imprimir pense em seu compromisso com o Meio Ambiente
                     e o comprometimento com os Custos

-----Mensagem original-----
De: Thomas Due [mailto:tho....@gmail.com]
Enviada em: 27 de agosto de 2009 09:46
Para: WiX-users
Assunto: [WiX-users] Questions regarding the SqlExtension

I am currently creating an installer which have to create a database. This
works fine as goes, however I have a question:



Right now my code looks like this:



        <Binary Id="DB" SourceFile=".\Database\DB.SQL" />

        <Binary Id="Data" SourceFile=".\Database\Data.SQL" />



        <DirectoryRef Id="INSTALLDIR">

            <Component Id="DatabaseInstall" Guid="
1D1A4965-D440-47C0-BA3E-29E43EBF1D03" DiskId="1" KeyPath="yes">

                <File Id="CreateDB" Name="DB.SQL" Source=".\Database\DB.SQL"
/>

                <File Id="CreateData" Name="Data.SQL" Source="
.\Database\Data.SQL"/>



                <Sql:SqlDatabase Id="ScanXNETDatabase" Server="
[DATABASESERVER]" Database="[DATABASENAME]" CreateOnInstall="yes"
ConfirmOverwrite="no">

                    <Sql:SqlScript Id="CreateDB" ExecuteOnInstall="yes"
BinaryKey="DB" Sequence="1"/>

                    <Sql:SqlScript Id="Data"     ExecuteOnInstall="yes"
BinaryKey="Data" Sequence="1"/>

                </Sql:SqlDatabase>



            </Component>

        </DirectoryRef>





I have a few problems with this:



First, this requires integrated security, if that is not possible, how do I
supply a user id and password for the creation of my database?

Second, how do I ensure that the script files are deleted from INSTALLDIR
after the database has been created?

Third, if the database already exists on the server I do NOT want to delete
it, but rather run an update script, how do I do that?



Please help. The help file is rather vague on the use of the Sql Extension,
and my google-fu seems to be lacking.

--
Thomas Due
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to