2016-02-24 3 views
0

на самом деле я только начал изучать WiX сегодня из http://wixtoolset.org/documentation/сиротой ошибка компоненты при построении WIX проекта

после прочтения и изучения несколько вещей, которые я получил некоторую уверенность, чтобы начать создавать свой первый проект WIX и конфигурации для того же здесь:

<?xml version="1.0" encoding="UTF-8"?> 
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 

    <Product Id="*" Name="PersonalDailyInstaller" Language="1033" Version="1.0.0.0" 
     Manufacturer="Muhammad Sufiyan Shaikh" UpgradeCode="1327de13-b713-4cee-9778-be9c7460c0aa"> 
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 
    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 

    <MediaTemplate /> 
    <!-- <MediaTemplate EmbedCab="yes" /> --> 

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

    <Fragment> 

    <Directory Id="TARGETDIR" Name="SourceDir"> 
     <Directory Id="ProgramFilesFolder"> 
      <Directory Id="INSTALLFOLDER" Name="PersonalDaily" /> 
     </Directory> 
    </Directory> 

    <DirectoryRef Id="INSTALLFOLDER"> 
     <Component Id="MainExe" Guid="D7DC3991-2EE4-4BE5-B8B4-D15AC05592F3"> 
      <File Id="MainExe" Source="bin\Debug\PersonalDaily.exe" KeyPath="yes" Checksum="yes"/> 
     </Component> 
     <Component Id="DataPD" Guid="9DF21E80-F608-416A-BBAE-92AB3DA4CAE6"> 
      <File Id="DataPD" Source="bin\Debug\data.PD" KeyPath="yes" Checksum="yes"/> 
     </Component> 
    </DirectoryRef> 

    </Fragment> 

    <Fragment> 
     <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
     <Component Id="ProductComponent"> 
      <File Source="$(var.PersonalDaily.TargetPath)" /> 
     </Component> 
     </ComponentGroup> 
    </Fragment> 
</Wix> 

теперь, когда я строю WIX проекта я получаю ниже ошибки:

Severity Code Description Project File Line Suppression State Error Found orphaned Component 'MainExe'. If this is a Product, every Component must have at least one parent Feature. To include a Component in a Module, you must include it directly as a Component element of the Module element or indirectly via ComponentRef, ComponentGroup, or ComponentGroupRef elements. PersonalDailyInstaller C:\Users\muham\documents\visual studio 2015\Projects\PersonalDaily\PersonalDailyInstaller\Product.wxs 25

любая помощь или работа вокруг были бы большой помощью для меня. заранее спасибо.

ответ

0

спасибо всем, на самом деле я получил это работает, делая некоторые изменения и экспериментировать на нем, и обновленный рабочий код здесь:

да и наверняка, если у кого есть лучший подход, то это пожалуйста, напишите свой ответ .. .

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 

<Product Id="*" Name="PersonalDailyInstaller" Language="1033" Version="1.0.0.0" 
    Manufacturer="Muhammad Sufiyan Shaikh" UpgradeCode="1327de13-b713-4cee-9778-be9c7460c0aa"> 
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" /> 
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 

<MediaTemplate /> 
<!-- <MediaTemplate EmbedCab="yes" /> --> 

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

<Fragment> 

<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="ProgramFilesFolder"> 
     <Directory Id="INSTALLFOLDER" Name="PersonalDaily" /> 
    </Directory> 
</Directory> 

<ComponentGroup Id="Dlls" Directory="INSTALLFOLDER"> 
    <Component Id="DataPD" Guid="9DF21E80-F608-416A-BBAE-92AB3DA4CAE6"> 
     <File Id="DataPD" Source="..\PersonalDaily\bin\Debug\data.PD" KeyPath="yes" Checksum="yes"/> 
    </Component> 
</ComponentGroup> 

</Fragment> 

<Fragment> 
    <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> 
    <Component Id="ProductComponent"> 
     <File Source="$(var.PersonalDaily.TargetPath)" /> 
    </Component> 
    </ComponentGroup> 
</Fragment> 
</Wix> 
Смежные вопросы