2013-05-31 15 views
9

Ero coinvolto con WiX e l'aggiunta di voci di registro funzionava bene, quindi ho problemi ad aggiungere file.WiX aggiungendo file a Directory Component

ottengo l'errore:

Found orphaned Component 'ProductComponent'. 
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. 

Il codice che funziona:

<Fragment> 
    <Directory Id="TARGETDIR" Name="SourceDir"> 

     <Directory Id="ProgramFilesFolder"> 
      <Directory Id="INSTALLFOLDER" Name="ChrisExcelAddintest" /> 

    <Component Id="Registry_FriendlyName"> 
     <RegistryValue Id="RegKey_FriendlyName" Root="HKCU" 
        Key="Software\Microsoft\Office\Excel\AddIns\ExcelAddIn1test" 
        Name="ChrisFriendlyName" 
        Value="My Excel Add-In" 
        Type="string" KeyPath="yes" /> 
    </Component> 
    <Component Id="Registry_Description"> 
     <RegistryValue Id="RegKey_Description" Root="HKCU" 
        Key="Software\Microsoft\Office\Excel\AddIns\ExcelAddIn1test" 
        Name="Description" 
        Value="Chris Excel Add-In" 
        Type="string" KeyPath="yes" /> 
    </Component> 
    <Component Id="Registry_Manifest"> 
     <RegistryValue Id="RegKey_Manifest" Root="HKCU" 
        Key="Software\Microsoft\Office\Excel\AddIns\ExcelAddIn1test" 
        Name="Manifest" Value="[INSTALLFOLDER]ExcelAddIn1test.vsto|vstolocal" 
        Type="string" KeyPath="yes" /> 
    </Component> 
    <Component Id="Registry_LoadBehavior"> 
     <RegistryValue Id="RegKey_LoadBehavior" Root="HKCU" 
        Key="Software\Microsoft\Office\Excel\AddIns\ExcelAddIn1test" 
        Name="LoadBehavior" Value="3" 
        Type="integer" KeyPath="yes" /> 
    </Component> 
     </Directory> 
    </Directory> 
</Fragment> 

Tuttavia ho provato semplicemente aggiungendo il seguente DESTRA codice dopo

<Directory Id="TARGETDIR" Name="SourceDir"> 

Questo codice:

<Directory Id="ProgramMenuFolder"> 
     <Directory Id="installcalc"> 
      <Component Id="ProductComponent" Guid="b11556a2-e066-4393-af5c-9c9210187eb2"> 
      <File Id="Calc" DiskId="1" Source="C:\WINDOWS\system32\calc.exe"/> 
      </Component> 
     </Directory> 
    </Directory> 

risposta

13

è necessario aggiungere il componente alla sezione "Funzioni"

esempio

<Feature Id="ProductFeature" Title="yourtitle" Level="1"> 
    EXISTING ENTRIES HERE, Your new entry below 
    <ComponentRef Id="ProductComponent2"/> 
</Feature> 
+0

Oh capisco. Ho dovuto cambiare anche ProgramMenuFolder, ma almeno questo mi aiuta a mettermi in pista –

Problemi correlati