sql-server
  • security
  • permissions
  • wix
  • 2010-08-31 74 views 0 likes 
    0

    我創建了一個WIX DB安裝程序。它使用SQLEXPRESS在我的DEV機器上運行,但不在我的測試機器上使用(本地)。我確認服務器在每種情況下都是正確的,使用Orca。以下幾乎是我正在使用的,只有幾個腳本。已知腳本可以正常工作,如果我將它們全部取出,它仍然會失敗。使用MSI/WIX的數據庫權限問題3.5

    <?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> 
    

    它使用(本地)/ SQLEXPRESS我的本地機器上安裝好了,但是當我嘗試把它安裝到使用SQL STD機「」或'(本地)',與Windows身份驗證,我得到了可怕的Error 26201. failed to create SQL database錯誤。

    我調用的MSI從PowerShell腳本,像這樣:

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

    並在日誌文件中,我得到了以下錯誤的詳細信息。 (我讀這方面對「價值3」線兩側的幾行往往足以診斷錯誤,但我不能看到它的解決方案):

    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=File: [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 
    

    我試着我能想到的所有東西,或者WIX討論論壇(和這裏)提到的東西,但沒有任何作用。我假設這個錯誤確實是一個權限問題,但我正在使用的帳戶在我嘗試安裝的數據庫中具有sysadmin權限。

    你能想到或者你聽說過WIX中的SqlDatabase安裝程序CA可以像這樣失敗的其他方式嗎?

    回答

    2

    我發現調試這些問題的最佳方式是在相關數據庫服務器上設置SQL Profiler並觀察其中的詳細錯誤消息。每一次它都指出我做錯了什麼。 :)

    相關問題