开发者

Database permissions issue using MSI/WIX 3.5

I've created a WIX DB installer. It works on my DEV machine using SQLEXPRESS but not on my test machine using (local). I confirmed that the server is correct in each case, using Orca. The following, is pretty much what I'm using, only with a few more scripts. the scripts are known to work fine, and if I take them out altogether, it still fails.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi' 
     xmlns:util='http://schemas.microsoft.com/wix/UtilExtension' 
     xmlns:sql='http://schemas.microsoft.com/wix/SqlExtension'>

  <?include $(sys.CURRENTDIR)\Config.wxi?>
  <?include ..\Common.wxi?>

  <Product Name='Agent Desktop $(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName)' Id='*' UpgradeCode='$(var.UpgradeCode)'
    Language='1033' Codepage='1252' Version='$(var.ProductVersion)' Manufacturer='$(var.ProductManufacturer)'>

    <Package Id='*'
             Keywords='Installer'
             Description="$(var.ProductManufacturer) $(var.SVCNAME)-$(var.ProductVersion)-$(var.BranchName) Installer"
             Comments='Premier Contact Point and PCP are registered trademarks of $(var.ProductManufacturer)'
             Manufacturer='$(var.ProductManufacturer)'
             InstallerVersion='100'
             Languages='1033'
             Compressed='yes'
             SummaryCodepage='1252' />

    <Upgrade Id="$(var.UpgradeCode)">
      <UpgradeVersion
          Minimum="1.0.0.0" Maximum="99.0.0.0"
          Property="PREVIOUSVERSIONSINSTALLED"
          IncludeMinimum="yes" IncludeMaximum="no" />

    </Upgrade>
    <InstallExecuteSequence>
      <RemoveExistingProducts Before="InstallInitialize" />
    </InstallExecuteSequence>


    <Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
    <Property Id='DiskPrompt' Value="Premier Contact Point $(var.DBNAME)-$(var.ProductVersion)-$(var.BranchName) Installer [1]" />

        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
        <Directory Id="PremierTechnologies" Name="$(var.ProductManufacturer)">
                  <Directory Id="INSTALLLOCATION" Name="PCP $(var.DBNAME)-$(var.ProductVersion)-$(var.BranchName)">

            <Component Id='SqlComponent' Guid='YOUR-GUID-HERE'>
              <sql:SqlDatabase Id='SqlDatabase' Database='$(var.DBNAME)-$(var.ProductVersion)-$(var.BranchName)' 
                               Server='$(var.DbServer)' CreateOnInstall='yes' DropOnUninstall='yes' ConfirmOverwrite='no' ContinueOnError='no'>

                <sql:SqlScript Id='Script0001' Sequence='01' BinaryKey='Script0001' ExecuteOnInstall='yes' />

              </sql:SqlDatabase>

            </Component>
          </Directory>

        </Directory>
            </Directory>
        </Directory>

    <Binary Id='Script0001' SourceFile='../../DatabaseUpdater/UpgradeScripts/Script0001.sql' />

    <Feature Id='SqlFeature' Title='SqlFeature' Level="1">
      <ComponentRef Id='SqlComponent' />
    </Feature>

  </Product>
</Wix>

It installs OK on my local machine using (local)/SQLEXPRESS, but when I try to install it to a SQL std machine using '.' or '(local)', with Windows authentication, I get the dreaded Error 26201. failed to create SQL database error.

I invoked the MSI from a powershell script like so:

start-process "msiexec.exe" "/i Database.msi /l*v Database-install.log" -wait

And in the log file I got the following error details. (I read that a few lines of context on either side of the 'value 3' line is often enough to diagnose the error, but I can't see a solution from it):

MSI (s) (E4:70) [11:54:27:897]: Note: 1: 1402 2: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Rollback\Scripts 3: 2 
MSI (s) (E4:70) [11:54:27:897]: Executing op: Header(Signature=1397708873,Version=405,Timestamp=1025466054,LangId=1033,Platform=0,ScriptType=1,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=0)
MSI (s) (E4:70) [11:54:27:897]: Executing op: ProductInfo(ProductKey={59CBDFC0-F16D-492D-A46B-336421D7F2F2},ProductName=Agent Desktop DB-3.9.9.0-wix,PackageName=Database.msi,Language=1033,Version=50921481,Assignment=0,ObsoleteArg=0,,,PackageCode={A3E3E186-D9AF-46B9-90D8-8FB6217AC71F},,,InstanceType=0,LUASetting=0,RemoteURTInstalls=0,ProductDeploymentFlags=3)
MSI (s) (E4:70) [11:54:27:897]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\andrewm.PCPDEV\Application Data
MSI (s) (E4:70) [11:54:27:897]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (E4:70) [11:54:27:897]: Executing op: DialogInfo(Type=1,Argument=Agent Desktop DB-3.9.9.0-wix)
MSI (s) (E4:70) [11:54:27:897]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=F开发者_开发知识库ile: [1])
MSI (s) (E4:70) [11:54:27:897]: Executing op: SetBaseline(Baseline=0,)
MSI (s) (E4:70) [11:54:27:897]: Executing op: SetBaseline(Baseline=1,)
MSI (s) (E4:70) [11:54:27:897]: Executing op: ActionStart(Name=ProcessComponents,Description=Updating component registration,)
MSI (s) (E4:70) [11:54:27:897]: Executing op: ProgressTotal(Total=1,Type=1,ByteEquivalent=24000)
MSI (s) (E4:70) [11:54:27:897]: Executing op: ComponentRegister(ComponentId={A53B47BD-FFCD-4A7B-BF6D-E5356B0AD76A},KeyPath=C:\Program Files\Premier Technologies\PCP AgentDesktop-3.9.9.0-wix\,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0)
MSI (s) (E4:70) [11:54:27:913]: Executing op: ActionStart(Name=InstallFiles,Description=Copying new files,Template=File: [1],  Directory: [9],  Size: [6])
MSI (s) (E4:70) [11:54:27:913]: Executing op: InstallProtectedFiles(AllowUI=1)
MSI (s) (E4:70) [11:54:27:913]: Executing op: ActionStart(Name=CreateDatabase,Description=Creating Databases,)
MSI (s) (E4:70) [11:54:27:913]: Executing op: CustomActionSchedule(Action=CreateDatabase,ActionType=25601,Source=BinaryData,Target=**********,CustomActionData=**********)
MSI (s) (E4:60) [11:54:27:913]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSID7.tmp, Entrypoint: CreateDatabase
CreateDatabase:  Error 0x80004005: failed to create to database: 'AgentDesktop-3.9.9.0-wix', error: unknown error
MSI (c) (CC:08) [11:54:44:584]: Font created.  Charset: Req=0, Ret=0, Font: Req=MS Shell Dlg, Ret=MS Shell Dlg

Error 26201. Error -2147467259: failed to create SQL database: AgentDesktop-3.9.9.0-wix, error detail: unknown error.
MSI (s) (E4!6C) [11:54:46:444]: Product: Agent Desktop DB-3.9.9.0-wix -- Error 26201. Error -2147467259: failed to create SQL database: AgentDesktop-3.9.9.0-wix, error detail: unknown error.

Action ended 11:54:46: InstallFinalize. Return value 3.
MSI (s) (E4:70) [11:54:46:459]: User policy value 'DisableRollback' is 0
MSI (s) (E4:70) [11:54:46:459]: Machine policy value 'DisableRollback' is 0
MSI (s) (E4:70) [11:54:46:475]: Executing op: Header(Signature=1397708873,Version=405,Timestamp=1025466062,LangId=1033,Platform=0,ScriptType=2,ScriptMajorVersion=21,ScriptMinorVersion=4,ScriptAttributes=0)
MSI (s) (E4:70) [11:54:46:475]: Executing op: DialogInfo(Type=0,Argument=1033)
MSI (s) (E4:70) [11:54:46:475]: Executing op: DialogInfo(Type=1,Argument=Agent Desktop DB-3.9.9.0-wix)
MSI (s) (E4:70) [11:54:46:475]: Executing op: RollbackInfo(,RollbackAction=Rollback,RollbackDescription=Rolling back action:,RollbackTemplate=[1],CleanupAction=RollbackCleanup,CleanupDescription=Removing backup files,CleanupTemplate=File: [1])
MSI (s) (E4:70) [11:54:46:475]: Executing op: ActionStart(Name=CreateDatabase,Description=Creating Databases,)
MSI (s) (E4:70) [11:54:46:475]: Executing op: ProductInfo(ProductKey={59CBDFC0-F16D-492D-A46B-336421D7F2F2},ProductName=Agent Desktop DB-3.9.9.0-wix,PackageName=Database.msi,Language=1033,Version=50921481,Assignment=0,ObsoleteArg=0,,,PackageCode={A3E3E186-D9AF-46B9-90D8-8FB6217AC71F},,,InstanceType=0,LUASetting=0,RemoteURTInstalls=0,ProductDeploymentFlags=3)
MSI (s) (E4:70) [11:54:46:491]: SHELL32::SHGetFolderPath returned: C:\Documents and Settings\andrewm.PCPDEV\Application Data
MSI (s) (E4:70) [11:54:46:491]: Executing op: ActionStart(Name=InstallFiles,Description=Copying new files,Template=File: [1],  Directory: [9],  Size: [6])
MSI (s) (E4:70) [11:54:46:491]: Executing op: ActionStart(Name=ProcessComponents,Description=Updating component registration,)
MSI (s) (E4:70) [11:54:46:491]: Executing op: ComponentUnregister(ComponentId={A53B47BD-FFCD-4A7B-BF6D-E5356B0AD76A},ProductKey={59CBDFC0-F16D-492D-A46B-336421D7F2F2},BinaryType=0,)
MSI (s) (E4:70) [11:54:46:491]: Executing op: End(Checksum=0,ProgressTotalHDWord=0,ProgressTotalLDWord=0)
MSI (s) (E4:70) [11:54:46:491]: Error in rollback skipped.  Return: 5
MSI (s) (E4:70) [11:54:46:491]: No System Restore sequence number for this installation.
MSI (s) (E4:70) [11:54:46:491]: Unlocking Server
MSI (s) (E4:70) [11:54:46:491]: PROPERTY CHANGE: Deleting UpdateStarted property. Its current value is '1'.
Action ended 11:54:46: INSTALL. Return value 3.
Property(S): DiskPrompt = Premier Contact Point AgentDesktop-3.9.9.0-wix Installer [1]
Property(S): UpgradeCode = {79DB4D69-D287-4441-8148-40E270729E21}
Property(S): CreateDatabase = SqlDatabase?.??AgentDesktop-3.9.9.0-wix?3?1???0?0
Property(S): ExecuteSqlStrings = SqlDatabase?.??AgentDesktop-3.9.9.0-wix?3?1???Script0001?1?create table dbo.SchemaVersions 

I've tried everything I can think of, or that is mentioned in the WIX discussion forums (and here) but nothing works. I assume that the error is truly a permissions issue, but the account I'm using has sysadmin permissions in the DB I'm trying to install to.

Can you think of, or have you heard of, any other ways that the SqlDatabase installer CA in WIX can fail like this?


The best way I've found to debug these issues is to set up the SQL Profiler on the database server in question and watch for detailed error messages there. Every single time it's pointed out what I was doing wrong. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜