简体   繁体   中英

WIX Installer error during the build

I try to learn how to do an installer with WIX on Visual Studio 2012, First I create an HelloWorld Project to test WIX and to do an easy configuration. But I have an error during the building : It says me :

"Failed to open the database. During validation, this most commonly happens when attempting to open a database using an unsupported code page or a file that is not a valid Windows Installer database. Please use a different code page in Module/@Codepage, Package/@SummaryCodepage, Product/@Codepage, or WixLocalization/@Codepage; or make sure you provide the path to a valid Windows Installer database. light.exe 0 1 SetupProject1"

I see several solution like change XML's encoding, switch utf-8 by utf-16. And I also try to delete the encoding statement. But it changes nothing.

Here is my WIX 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>

I also check "CodePage" and "SummaryCodePage" but I've not resolve the build problem.

I've tried that too : WiX ICE validation errors

Have you some Idea to fix it ?

In the database validation step, light.exe tries to reopen the MSI file for read/write access While anti virus scanning the new msi file that been created.

Try to do the following:

  1. Exclude the temporary directory from the real-time virus scan.
  2. Adding English input language in Windows' regional settings.
  3. Disable the ICE validation. Go to the wix Project Properties, Tool Settings, then checked "Suppress ICE validation".

You can check discussion related to this topic, here:

Error LGHT0301: Failed to open the database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM