由于依赖问题,wix创建的wpf app msi无法正常工作?

时间:2017-08-01 09:42:22

标签: wpf wix windows-installer

Here is my solution. 我有一个基本的wpf应用程序,它使用cefsharp来显示google.com。从VisualStudio本身的bin文件夹运行时,该应用程序正常工作。

对于此应用程序,我创建了以下WiX文件:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"><?define WpfApplication6_TargetDir=$(var.WpfApplication6.TargetDir)?>
<Product Id="*" Name="SetupProject1" Language="1033" Version="1.0.0.0" Manufacturer="acv" UpgradeCode="PUT-GUID-HERE">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate />

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

<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="SetupProject1" />
        </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="ProductComponent"> -->
            <!-- TODO: Insert files, registry keys, and other resources here. -->
        <!-- </Component> -->
        <Component Id="WpfApplication6.exe" Guid="*">
          <File Id="WpfApplication6.exe" Name="WpfApplication6.exe" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe" />
        </Component>
        <Component Id="WpfApplication6.exe.config" Guid="*">
          <File Id="WpfApplication6.exe.config" Name="WpfApplication6.exe.config" Source="$(var.WpfApplication6_TargetDir)WpfApplication6.exe.config" />
        </Component>
        <Component Id="CefSharp.WinForms.dll" Guid="*">
          <File Id="CefSharp.WinForms.dll" Name="CefSharp.WinForms.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.WinForms.dll" />
        </Component>
        <Component Id="CefSharp.dll" Guid="*">
          <File Id="CefSharp.dll" Name="CefSharp.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.dll" />
        </Component>
        <Component Id="CefSharp.Core.dll" Guid="*">
          <File Id="CefSharp.Core.dll" Name="CefSharp.Core.dll" Source="$(var.WpfApplication6_TargetDir)CefSharp.Core.dll" />
        </Component>
    </ComponentGroup>
</Fragment>

此代码创建安装程序,并在安装以下异常后运行应用程序时:无法找到cefsharp.core或未加载其中一个依赖项。

当Visual c ++不存在时,会出现此错误。 我如何修复此问题,因为我安装了Visual c ++。 我应该在我的WiX文件中添加任何引用吗?

0 个答案:

没有答案