2015-11-04 35 views
0

過去幾天我一直在與Wix一起苦苦掙扎,可能在網絡上閱讀了15本指南,試圖讓它在我的真實應用中運行,但沒有運氣。Wix:添加我收穫熱量的文件

我使用了一個小而簡單的其他項目來練習,並確保我理解並做一切正確的事情。

繼此guide之後,我設法讓它工作,下一階段試圖將目錄的內容添加到安裝中,因爲它包含許多我不想手動添加的文件。

因此,下面這個guide我用heat.exe收穫文件夾的內容,我得到了熱量來創建我需要的.wxs,但接下來試圖將其內容添加到我的Product.wxs文件中。

問題是,它說我應該補充一點:

<!-- Add ComponentGroupRef to existing Feature, or create new one --> 
<!-- Notice the IDs & what we used in heat --> 
<Feature Id="ProductFeature" Title="Main product" Level="1"> 
<ComponentGroupRef Id="ConfigurationUtilityComponents"/> 
</Feature> 

<Fragment> 
<Directory Id="INSTALLDIR" Name="SourceDir"> 
    <Directory Id="ProgramFilesFolder"> 
    <Directory Id="ConfigurationUtilityDir" Name="ConfigurationUtility" /> 
    </Directory> 
</Directory> 
</Fragment> 

我Product.wxs文件,但我似乎無法弄清楚如何做到這一點。 任何人都可以幫忙嗎?

這裏是我的Product.wxs文件:

<Product Id="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49" 
     Name="MyApp" Language="1033" Version="1.0.0.0" Manufacturer="My System Pvt Ltd" 
     UpgradeCode="8748CF04-E8D3-4A2B-B3F5-22E50B3A8E49"> 

<Package Id="*" InstallerVersion="200" Compressed="yes" InstallScope="perMachine" 
      InstallPrivileges="elevated" ReadOnly="yes"/> 

<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." /> 
<!--Add Cab1.cab File inside the Package--> 
<Media Id="1" Cabinet="cab1.cab" EmbedCab="yes" /> 

<!--Here We Install Our Main App--> 
<Directory Id="TARGETDIR" Name="SourceDir"> 
    <Directory Id="ProgramFilesFolder"> 
    <Directory Id="INSTALLFOLDER" Name="MY System Pvt Ltd"/> 
    </Directory> 

    <!-- Step 1: For the Program Menu --> 
    <Directory Id="ProgramMenuFolder"> 
    <Directory Id="ApplicationProgramsFolder" Name="My System Pvt Ltd"/> 
    </Directory> 

    <!--Step 2:For Desktop Folder--> 
    <Directory Id="DesktopFolder"/> 

    <!--Step 3:For StartUp Folder--> 
    <Directory Id="StartupFolder"/> 

</Directory> 

<!--Step 4 :Add Main App exe--> 
<DirectoryRef Id="INSTALLFOLDER"> 
    <Component Id="myapplication.exe" Guid="84C5B9E8-FD90-4EA8-A502-B08AC9B38D39"> 
    <File Source="$(var.WpfApplication2.TargetPath)" Name="MYApp.exe" 
      Id="MyAppEXE" KeyPath="yes"/> 
    </Component> 
</DirectoryRef> 

<!-- Step 1.1: Add the shortcut to your installer package Program Menu or Start Menu--> 
<DirectoryRef Id="ApplicationProgramsFolder"> 
    <Component Id="ApplicationShortcut" Guid="1A437020-D5C9-450C-9B3D-33957994780A"> 
    <!--Add Shortcut of the Application in start Menu--> 
    <Shortcut Id="ApplicationStartMenuShortcut" Name="MyApp" Description="My Application Description" 
     Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER"> 
     <!--Add Icon to the ShortCut--> 
     <Icon Id="MYPMenuIcon" SourceFile=".\Desktop.ico" /> 
    </Shortcut> 
    <!--Remove the Folder At time of Uninstall--> 
    <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/> 
    <RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]' 
        Name="installed" Type="integer" Value="1" KeyPath="yes"/> 
    </Component> 
</DirectoryRef> 

<!-- Step 2.1: Add the shortcut to your installer package For DeskTop--> 
<DirectoryRef Id="DesktopFolder"> 
    <Component Id="ApplicationDeskShortcutComp" Guid="40127963-856D-460D-9E1B-4C10EB65835B"> 
    <Shortcut Id="ApplicationDeskShortcut" Name="MYAppDesk" 
       Description="My Application Description" Target="[INSTALLFOLDER]MyApp.exe" 
       WorkingDirectory="INSTALLFOLDER"> 
     <Icon Id="MYDeskIcon" SourceFile=".\Desktop.ico" /> 
    </Shortcut> 
    <RemoveFolder Id="DesktopFolder" On="uninstall"/> 
    <RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]' 
        Name="installed" Type="integer" Value="1" KeyPath="yes"/> 
    </Component> 
</DirectoryRef> 

<!--Step 3.1: add Shortcut to StartUp Folder to run application when you login--> 
<DirectoryRef Id="StartupFolder"> 
    <Component Id="ApplicationStartUpShortcutComp" Guid="843B6A2E-AB61-40C7-BE49-FBCD7F81E35D"> 
    <Shortcut Id="ApplicationStartUpDeskShortcut" Name="MYAppDesk" Description="My Application Description" 
     Target="[INSTALLFOLDER]MyApp.exe" WorkingDirectory="INSTALLFOLDER"> 
     <Icon Id="MyIconStartUp" SourceFile=".\Desktop.ico" /> 
    </Shortcut> 
    <RemoveFolder Id="StartupFolder" On="uninstall"/> 
    <RegistryValue Root="HKCU" Key='Software\[Manufacturer]\[ProductName]' 
        Name="installed" Type="integer" Value="1" KeyPath="yes"/> 
    </Component> 
</DirectoryRef> 

<!--Add Component--> 
<Feature Id="MainApplication" Title="Main Application" Level="1"> 
    <ComponentRef Id="myapplication.exe" /> 
    <!--Step 1.2:Add Start menu or program Shortcut--> 
    <ComponentRef Id="ApplicationShortcut" /> 
    <!--step 2.2Add DeskTop Shortcut--> 
    <ComponentRef Id="ApplicationDeskShortcutComp" /> 
    <!--step 3.2Add DeskTop Shortcut--> 
    <ComponentRef Id="ApplicationStartUpShortcutComp"/> 
    <ComponentRef Id="dotNetClass.Output" /> 
    <!--<ComponentRef Id="AU" />--> 
</Feature> 
</Product> 

回答

-1

我種得到您的從,我想將我的熱生成的代碼到產品.wxs文件來..我做了什麼,添加熱源代碼(.wxs)第一組件組文件到您的項目..

,記下該名稱,如

<ComponentGroup Id="SampleGroup"> 

然後在本節

<Feature Id="ProductFeature" Title="Random Desktop" Level="1"> 
     <ComponentGroupRef Id="SampleGroup" /> 
    </Feature> 
</Product> 

確保兩個名稱都匹配,它表示「SampleGroup」