If you're creating a database using script, I would recommend a separate 
component with a sql:SqlDatabase element wrapped around the sql:SqlScript 
elements.

--
John Merryweather Cooper
Senior Software Engineer | Enterprise Service Applications | Continuing 
Development
Jack Henry & Associates, Inc.® | Lenexa, KS  66214 | Ext:  431050 
|jocoo...@jackhenry.com



-----Original Message-----
From: garymonk [mailto:g...@gurudental.com] 
Sent: Friday, October 24, 2014 4:06 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Error "database does not exist" when executing 
ExecuteSQLStrings

I have an installer that needs to execute a number of sql scripts. For some 
reason they are not getting executed and so I receive the above message. 

here is my Product.was file..

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
xmlns:fire="http://schemas.microsoft.com/wix/FirewallExtension";
xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension";
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension";>
  <Product Id="*" Name="Guru Teach Server Installation" Language="1033"
Version="6.0.4.0" Manufacturer="Guru Dental"
UpgradeCode="76c642f5-9ef3-4575-8ce1-05dd36ea4195">
    <Package InstallerVersion="200" Compressed="yes"
InstallScope="perMachine" Id="*" Platform="x86"/>

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is 
already installed." />

    <Media Id='1' Cabinet='Data.cab' EmbedCab='yes' DiskPrompt='Please insert 
DVD #1' />

    <Property Id='DiskPrompt' Value="Guru Teach Installation [1]" />
    <Property Id="ARPPRODUCTICON" Value="guru.ico" />
    <Property Id='CHGFIREWALL' Value='False' Secure='yes'/>

    <UI Id="MyWixUI_Mondo">
      <UIRef Id="WixUI_Mondo" />
      <UIRef Id="WixUI_ErrorProgressText" />

      <DialogRef Id="FirewallDlg" />

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog"
Value="FirewallDlg" Order="1">1</Publish>
      <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog"
Value="FirewallDlg">1</Publish>
    </UI>

    <sql:SqlDatabase Id="SqlDatabase" Database="master" Server="localhost"
Instance="MVSQLEXPRESS" />

      <Directory Id="TARGETDIR" Name="SourceDir">
      <Component Id="RegistryEntries"
Guid="{E677A056-74D9-4AF0-BC88-A4BE8C237E5E}">
        <RegistryKey Root="HKLM" Key="Software\Reality Engineering, 
Inc.\Medvisor Dental" ForceDeleteOnUninstall="yes">
          <RegistryValue Type="string" Name="INSTALLDIR"
Value="[APPLICATIONROOTDIR]"/>
          <RegistryValue Type="string" Name="ProgName" Value="Guru"
KeyPath="yes"/>
        </RegistryKey>
      </Component>
      <Directory Id="ProgramFilesFolder">
        <Directory Id="APPLICATIONROOTDIRECTORY" Name="Guru" >
          <Directory Id="AdditionalFolders">
            <Directory Id="SERVER" Name="Server" >
              <Directory Id="MANIFESTS" Name="Manifests" />
              <Directory Id="MODULES" Name="Modules" />
              </Directory>
            </Directory>
          </Directory>
        </Directory>
      </Directory>

    <Binary Id="CreateDatabaseSql"  SourceFile="SQL Scripts\CreateDatabase.sql" 
/>
    <Binary Id="CreateUsersSql"  SourceFile="SQL Scripts\CreateUsers.sql" />
    <Binary Id="CreateBaseLineDbSql"  SourceFile="SQL 
Scripts\CreateBaseLineDb.sql" />
    <Binary Id="RemoveOldGuruContentSql"  SourceFile="SQL 
Scripts\RemoveOldGuruContent.sql" />
    <Binary Id="UpgradeSql"  SourceFile="SQL Scripts\Upgrade.sql" />
    <Binary Id="AddCompleteMediaSql"  SourceFile="SQL Scripts\Upgrade.sql"
/>
    <Binary Id="InstallGuruContentSql"  SourceFile="SQL 
Scripts\InstallGuruContent.sql" />
    <Binary Id="UpdateCustomPlayListSql"  SourceFile="SQL 
Scripts\UpdateCustomPlayList.sql" />
    <Binary Id="InstallFeaturedContentSql"  SourceFile="SQL 
Scripts\InstallFeaturedContent.sql" />
    
    <DirectoryRef Id="SERVER">
      <Component Id='CreateDtxDataUser.exe'
Guid='26f80392-dcbe-47af-a7e0-d187cbec0e15'>
        <File Id='CreateDtxDataUser.exe' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\CreateDtxDataUser.exe' KeyPath='yes'/>
      </Component>
      <Component Id='Guru.Server.exe'
Guid='8027388d-0f90-465b-9668-d1388977caaa'>
        <File Id='Guru.Server.exe' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Guru.Server.exe' KeyPath='yes'/>
        <ServiceInstall
          Id="ServiceInstaller"
          Type="ownProcess"
          Name="GuruService"
          DisplayName="Guru Media and Licensing Service"
          Description="Provides media distribution, data coordination, and 
licensing services to the Guru application"
          Start="auto"
          Account="[SERVICEACCOUNT]"
          Password="[SERVICEPASSWORD]"
          ErrorControl="normal"
          />
        <ServiceControl Id="StartService" Start="install" Stop="both"
Remove="uninstall" Name="GuruService" Wait="yes" />
        <sql:SqlScript Id="CreateDatabase" ExecuteOnInstall="yes"
BinaryKey="CreateDatabaseSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="CreateUsers" ExecuteOnInstall="yes"
BinaryKey="CreateUsersSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="CreateBaseLineDb" ExecuteOnInstall="yes"
BinaryKey="CreateBaseLineDbSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="RemoveOldGuruContent" ExecuteOnInstall="yes"
BinaryKey="RemoveOldGuruContentSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="Upgrade" ExecuteOnInstall="yes"
BinaryKey="UpgradeSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="AddCompleteMedia" ExecuteOnInstall="yes"
BinaryKey="AddCompleteMediaSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="InstallGuruContent" ExecuteOnInstall="yes"
BinaryKey="InstallGuruContentSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="UpdateCustomPlayList" ExecuteOnInstall="yes"
BinaryKey="UpdateCustomPlayListSql" SqlDb="SqlDatabase"/>
        <sql:SqlScript Id="InstallFeaturedContent" ExecuteOnInstall="yes"
BinaryKey="InstallFeaturedContentSql" SqlDb="SqlDatabase"/>
      </Component>
      <Component Id="ChangeFirewall"
Guid="{B6200626-D896-4E85-960B-F98D2AC1EA3E}" KeyPath="yes">
        <Condition></Condition>
          <fire:FirewallException Id="FW6501" Name="Guru Server" Port="6501"
Protocol="tcp" Scope="any"/>
          <fire:FirewallException Id="FW6502" Name="Guru Server" Port="6502"
Protocol="tcp" Scope="any"/>
          <fire:FirewallException Id="FW6505" Name="Guru Server iPad Interface" 
Port="6505" Protocol="tcp" Scope="any"/>
      </Component>
      <Component Id='Guru.Server.exe.config'
Guid='15b44bc2-69f1-4d45-becd-a1f58104ba16'>
        <File Id='Guru.Server.exe.config' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Guru.Server.exe.config'
KeyPath='yes'/>
      </Component>
      <Component Id='Guru.Server.Remoting.dll'
Guid='a6cc9df6-27e3-4215-a920-7357288c6438'>
        <File Id='Guru.Server.Remoting.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Guru.Server.Remoting.dll'
KeyPath='yes'/>
      </Component>
      <Component Id='Guru.ServerLibrary.dll'
Guid='97cfe539-e262-4f0b-afe5-0b37f47f804c'>
        <File Id='Guru.ServerLibrary.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Guru.ServerLibrary.dll'
KeyPath='yes'/>
      </Component>
      <Component Id='Ionic.Zip.Reduced.dll'
Guid='94aa21fc-b547-46b6-b385-5d41ca9f6e26'>
        <File Id='Ionic.Zip.Reduced.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Ionic.Zip.Reduced.dll' KeyPath='yes'/>
      </Component>
      <Component Id='JsonChannel.dll'
Guid='bfd36abe-511e-4a28-892e-a28109e7dab8'>
        <File Id='JsonChannel.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\JsonChannel.dll' KeyPath='yes'/>
      </Component>
      <Component Id='license.dat'
Guid='77e5b7b8-e3d8-47c2-adf5-8a4feb792a8a'>
        <File Id='license.dat' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\license.dat' KeyPath='yes'/>
      </Component>
      <Component Id='Microsoft.Practices.Prism.dll'
Guid='793b146c-b452-42b6-aae3-b1bd40cba0f8'>
        <File Id='Microsoft.Practices.Prism.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Microsoft.Practices.Prism.dll'
KeyPath='yes'/>
      </Component>
      <Component Id='Microsoft.Practices.ServiceLocation.dll'
Guid='c75910cf-eb6f-4c31-9b05-188ebee29ecb'>
        <File Id='Microsoft.Practices.ServiceLocation.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Microsoft.Practices.ServiceLocation.dll'
KeyPath='yes'/>
      </Component>
      <Component Id='SQLExpressProvider.dll'
Guid='1b9d199a-f906-4d86-86b0-318f0be53bd1'>
        <File Id='SQLExpressProvider.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\SQLExpressProvider.dll'
KeyPath='yes'/>
      </Component>
    </DirectoryRef>

    <DirectoryRef Id="MANIFESTS">
      <Component Id='Guru_Featured_manifest.xml'
Guid='0e76726f-12e6-4d30-b405-94ef8a5d13ea'>
        <File Id='Guru_Featured_manifest.xml' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Manifests\Guru_Featured_manifest.xml'
KeyPath='yes'/>
      </Component>
      <Component Id='GURU_Library_manifest.xml'
Guid='fc4c8521-d307-47d9-afd7-b9b29804976c'>
        <File Id='GURU_Library_manifest.xml' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Manifests\GURU_Library_manifest.xml'
KeyPath='yes'/>
      </Component>
    </DirectoryRef>

    <DirectoryRef Id="MODULES">
      <Component Id='Guru.Server.Configuration.dll'
Guid='a65ccd7e-000e-4b1f-8bb2-1cf2976486bb'>
        <File Id='Guru.Server.Configuration.dll' Source='C:\VS 
Publish\Guru\ProgramFiles\Guru\Server\Modules\Guru.Server.Configuration.dll'
KeyPath='yes'/>
      </Component>
    </DirectoryRef>

    <Feature Id="Server" Title="Guru Teach Server" Level="1">
      <ComponentRef Id="RegistryEntries"/>
      <ComponentRef Id='CreateDtxDataUser.exe' />
      <ComponentRef Id='Guru.Server.exe' />
      <ComponentRef Id='ChangeFirewall' />
      <ComponentRef Id='Guru.Server.exe.config' />
      <ComponentRef Id='Guru.Server.Remoting.dll' />
      <ComponentRef Id='Guru.ServerLibrary.dll' />
      <ComponentRef Id='Ionic.Zip.Reduced.dll' />
      <ComponentRef Id='JsonChannel.dll' />
      <ComponentRef Id='license.dat' />
      <ComponentRef Id='Microsoft.Practices.Prism.dll' />
      <ComponentRef Id='Microsoft.Practices.ServiceLocation.dll' />
      <ComponentRef Id='SQLExpressProvider.dll' />
      <ComponentRef Id='Guru_Featured_manifest.xml' />
      <ComponentRef Id='GURU_Library_manifest.xml' />
      <ComponentRef Id='Guru.Server.Configuration.dll' />
    </Feature>
  </Product>

</Wix>

I don't see where in the log any of the sql scripts were run. I've uploaded my 
log with this post.

I would appreciate any help. I started this project a while ago and had to stop 
due to priorities, but I believe that this ran at one time. I'm not sure what's 
changed.

Gary



--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Error-database-does-not-exist-when-executing-ExecuteSQLStrings-tp7597477.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
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.


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to