2015-11-25 37 views
0

我嘗試學習如何在Visual Studio 2012上使用WIX安裝安裝程序,首先創建一個HelloWorld項目來測試WIX並進行簡單的配置。但我在建築物出現錯誤:它說我:WIX安裝程序在構建期間出錯

「無法打開數據庫。在驗證期間,這最常發生在嘗試使用不受支持的代碼頁或無效的文件打開數據庫時Windows Installer數據庫請在Module/@ Codepage,Package/@ SummaryCodepage,Product/@ Codepage或WixLocalization/@ Codepage中使用不同的代碼頁;或者確保提供有效Windows Installer數據庫的路徑。 1 SetupProject1「

我看到幾個解決方案,比如改變XML的編碼,用utf-16切換utf-8。我也嘗試刪除編碼語句。但它沒有改變。

這裏是我的維克斯XML:

<?xml version="1.0" encoding="utf-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Product Id="54612752-7163-4B36-8CA6-01615090CD7F" Name="WIXTestSetup" Language="1033" Codepage="1252" Version="1.0.0.0" Manufacturer="MyCompany Ltd." 
    UpgradeCode="1756bfd5-c713-412a-9524-fb1b72886116"> 
    <Package Id="*" Keywords="Installer" Description="My WIXTest Installer" Languages="1033" SummaryCodepage="1252" InstallerVersion="200" 
    Compressed="yes" InstallScope="perMachine" Comments="WIXTest Installer is a registered trademark of MyCompany and Co.Ltd" /> 
    <Media Id="1" Cabinet="Sample.cab" EmbedCab="yes" DiskPrompt="CD-ROM #1" /> 
    <Property Id="DiskPrompt" Value="WIXTestSetup Installation [1]"/> 
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 


    <Feature Id="ProductFeature" Title="WIXTestSetup" Level="1"> 
     <ComponentGroupRef Id="ProductComponents" /> 
    </Feature> 
    </Product> 

    <Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder" Name="PFiles"> 
     <Directory Id="MyCompany" Name = "MyCompany" > 
      <Directory Id="INSTALLFOLDER" Name="WIXTestSetup" /> 
     </Directory> 
     </Directory> 
    </Directory> 
    </Fragment> 

    <Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --> 
     <Component Id="MainExecutable" Guid="4BFF8919-9C07-4BBE-BD1C-46AB49524566"> 
     <!-- TODO: Insert files, registry keys, and other resources here. --> 
     <File Id="WIxTestExe" Name ="WIXTest.exe" DiskId="1" Source="D:\PROJETS VISUAL STUDIO\Projects\MyFirstWIXProject\MyFirstWIXProject\bin\Debug\MyFirstWIXProject.exe" KeyPath="yes" /> 
     </Component> 
     <Component Id="ProgramFilesFolder" Guid="53B3FC8A-9D2B-4CDD-BE68-D155435C6163"> 
     <RemoveFolder Id="ProgramFilesFolder" On="uninstall"/> 
     </Component> 
    </ComponentGroup> 
    </Fragment> 
</Wix> 

我還要檢查「代碼頁」和「SummaryCodePage」,但我還沒有解決構建問題。

我已經試過了太:WiX ICE validation errors

有你一些想法解決它?

+0

可能有關? http://stackoverflow.com/questions/14840233/error-lght0301-failed-to-open-the-database – sjdowling

回答

1

在數據庫驗證步驟中,light.exe會嘗試重新打開MSI文件進行讀取/寫入訪問,同時防病毒掃描已創建的新msi文件。

儘量做到以下幾點:

  1. 排除從實時病毒掃描的臨時目錄。
  2. 在Windows的區域設置中添加英文輸入語言。
  3. 禁用ICE驗證。轉至wix項目屬性,工具設置,然後選中「取消ICE驗證」。

您可以檢查有關這個話題的討論,在這裏:

Error LGHT0301: Failed to open the database

+0

它是偉大的工程 – Julien698