簡體   English   中英

當我嘗試使用WIX安裝數據庫時出現錯誤0x80004005

[英]Error 0x80004005 when I tried to install a database with WIX

我正在嘗試使用WIX安裝數據庫。

我已經在Windows7(32位)上安裝了SQL Server 2008 Express。 在此安裝上,啟用了TCP / IP,SQL Server服務正在運行。

我正在使用SQL Server和Windows Server的Windows身份驗證。 我在代碼中都嘗試過-我在組件中添加了一個用戶。

該代碼非常基本:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
     xmlns:sql="http://schemas.microsoft.com/wix/SqlExtension">
    <Product Id="*" Name="NewDatabaseInstaller" Language="1033" 
             Version="1.0.0.0" Manufacturer="My Company" 
             UpgradeCode="17ef693b-3ab5-4788-a6b5-70eeabc13497">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate EmbedCab="yes" />
        <Feature Id="ProductFeature" Title="NewDatabaseInstaller" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>
    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="INSTALLFOLDER" Name="NewDatabaseInstaller" />
            </Directory>
        </Directory>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="cmpSqlDatabase" Guid="{F950605D-AA59-43E6-AB19-9452F6BEC649}" KeyPath="yes">
                <sql:SqlDatabase Id="sqlDatabase_MyDatabase" Server="localhost"
                     Instance="MSSQLSERVER" Database="MyDatabase"
                     CreateOnInstall="yes" DropOnUninstall="yes"
                     ContinueOnError="no" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>

通過在Management Studio中點擊以下查詢,我獲得了實例名稱:

SELECT @@servicename

但是,我得到一個錯誤:

CreateDatabase:錯誤0x80004005:無法創建到數據庫:'MyDatabase',錯誤:未知錯誤
錯誤26201。錯誤-2147467259:創建SQL數據庫失敗:MyDatabase,錯誤詳細信息:未知錯誤。
MSI(s!)(FC!74)[17:43:27:786]:產品:測試-錯誤26201。錯誤-2147467259:創建SQL數據庫失敗:MyDatabase,錯誤詳細信息:未知錯誤。

CustomAction CreateDatabase返回了實際錯誤代碼1603(請注意,如果在沙箱中發生翻譯,則此錯誤可能不是100%准確)
動作結束17:43:27:InstallFinalize。 返回值3。

我錯過了什么?

謝謝 !

我發現了問題。 我為自己的錯誤感到as愧:我放了一個實例

Instance =“ MSSQLSERVER”

我不需要 我以為是

選擇@@ servicename

所以,我不知道我們什么時候需要...有人知道嗎?

感謝Yan的幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM