2016-04-08 16 views
0

Wix Bootstrap yükleyicisini kullanarak bir exe yükleyicisi oluşturdum. Yükleyiciyi yüklemek için tıkladığımda, her zaman net çerçeveyi yüklemeyi isteyen iletişim kutusunu işaret eder. Ama ben zaten bu nokta net çerçeveye sahibim. Yüklemeye tıkladığımda hiçbir şey olmaz, her şey kapanır.Yükleyici, Wix bootstrap UI kullanılarak oluşturuldu, her zaman nokta net framework yüklemeye çalışıyor olsa da,

BootstrapperApplication'ı genişleten sınıfım aşağıda.

public class CustomBootstrapperApplication : BootstrapperApplication 
{ 
    public static Dispatcher Dispatcher { get; set; } 
    protected override void Run() 
    { 
     Dispatcher = Dispatcher.CurrentDispatcher; 
     var model = new BootstrapperApplicationModel(this); 
     var viewModel = new InstallViewModel(model); 
     var view = new InstallView(viewModel); 
     model.SetWindowHandle(view); 
     this.Engine.Detect(); 
     view.Show(); 
     Dispatcher.Run(); 
     this.Engine.Quit(model.FinalResult); 
    } 
} 

Aşağıda benim AssemblyInfo.cs

using System.Reflection; 
using System.Runtime.CompilerServices; 
using System.Runtime.InteropServices; 
using CustomBA; 
using Microsoft.Tools.WindowsInstallerXml.Bootstrapper; 

// General Information about an assembly is controlled through the following 
// set of attributes. Change these attribute values to modify the information 
// associated with an assembly. 
[assembly: AssemblyTitle("CustomBA")] 
[assembly: AssemblyDescription("")] 
[assembly: AssemblyConfiguration("")] 
[assembly: AssemblyCompany("")] 
[assembly: AssemblyProduct("CustomBA")] 
[assembly: AssemblyCopyright("Copyright © 2016")] 
[assembly: AssemblyTrademark("")] 
[assembly: AssemblyCulture("")] 

// Setting ComVisible to false makes the types in this assembly not visible 
// to COM components. If you need to access a type in this assembly from 
// COM, set the ComVisible attribute to true on that type. 
[assembly: ComVisible(false)] 

// The following GUID is for the ID of the typelib if this project is exposed to COM 
[assembly: Guid("0640182b-2d21-4f58-ad2a-7a4efc1d5d94")] 

// Version information for an assembly consists of the following four values: 
// 
//  Major Version 
//  Minor Version 
//  Build Number 
//  Revision 
// 
// You can specify all the values or you can default the Build and Revision Numbers 
// by using the '*' as shown below: 
// [assembly: AssemblyVersion("1.0.*")] 
[assembly: AssemblyVersion("1.0.0.0")] 
[assembly: AssemblyFileVersion("1.0.0.0")] 

[assembly: BootstrapperApplication(
typeof(CustomBootstrapperApplication))] 

Aşağıda benim BootstrapCore.config dosyası

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
    <sectionGroup name="wix.bootstrapper" type="Microsoft. 
Tools.WindowsInstallerXml.Bootstrapper.BootstrapperSectionGroup, 
BootstrapperCore"> 
     <section name="host" type="Microsoft.Tools. 
WindowsInstallerXml.Bootstrapper.HostSection, BootstrapperCore" /> 
    </sectionGroup> 
    </configSections> 
    <startup useLegacyV2RuntimeActivationPolicy="true"> 
    <supportedRuntime version="v4.5" /> 
    </startup> 
    <wix.bootstrapper> 
    <host assemblyName="CustomBA" /> 
    </wix.bootstrapper> 
</configuration> 

benim Bootstrap projeye bir bağımlılık olarak bu projeyi ekledi olan

olduğunu. Aşağıda bootstrap projesinin Product.wxs var.

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" > 
    <Bundle Name="MyBootstrapper" Version="1.0.0.0" Manufacturer="WiX Tests" UpgradeCode="416b6bbf-2beb-4187-9f83-cdb764db2840"> 
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost"> 
     <Payload SourceFile="$(var.CustomBA.TargetDir)CustomBA.dll" /> 
     <Payload SourceFile= "$(var.CustomBA.TargetDir)BootstrapperCore.config" /> 
     <Payload SourceFile= "$(var.CustomBA.TargetDir)BootstrapperCore.xml" /> 
     <Payload SourceFile= "$(var.CustomBA.TargetDir)Microsoft.Practices.Prism.Mvvm.Desktop.dll" /> 
    <Payload SourceFile= "$(var.CustomBA.TargetDir)Microsoft.Practices.Prism.Mvvm.dll" /> 
    <Payload SourceFile= "$(var.CustomBA.TargetDir)Microsoft.Practices.Prism.SharedInterfaces.dll" /> 
    </BootstrapperApplicationRef> 
    <WixVariable Id="WixMbaPrereqLicenseUrl" Value=""/> 
    <WixVariable Id="WixMbaPrereqPackageId" Value=""/> 
    <Chain> 
    <MsiPackage Id="Myapp" SourceFile="Lib\MyInstaller.msi" Compressed="yes" Vital="yes" /> 
    </Chain> 
    </Bundle> 
</Wix> 

Neden bu sorunu alıyorum? Ben yüklü nokta net 4.5 var. Lütfen tavsiye. BootstrapperCore.config yılında

cevap

2

, sizin supportedRuntime eleman v4.5 için yanlış bir değere sahip, olması gereken

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> 
İlgili konular