Advertisement
Guest User

Untitled

a guest
Mar 17th, 2012
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.12 KB | None | 0 0
  1. <#@ template debug="false" hostspecific="true" language="C#" #>
  2. <#@ include file="GetFiles.ttinclude" #>
  3. <#@ output extension=".wxi" #>
  4. <#@ import namespace="System" #>
  5. <#@ import namespace="System.Collections.Generic" #>
  6. <#@ import namespace="System.Text" #>
  7. <#@ import namespace="System.IO" #>
  8. <?xml version="1.0" encoding="utf-8"?>
  9.  
  10. <#
  11.     GetFiles(Path.GetDirectoryName(Host.TemplateFile) +  @"\..\MyApp\bin\Release", new List<string>( new string[]{"pdb"}) );
  12.  
  13.     //generate components
  14. #>
  15.  
  16.  
  17. <Include>
  18.  
  19. <DirectoryRef Id="APPLICATIONROOTDIRECTORY">
  20. <#
  21.     foreach(string f in files)
  22.     {
  23.     string fileName =  System.IO.Path.GetFileName(f);
  24.       #>
  25.       <Component Id="<#=FileToId(fileName)#>" Guid="<#=Guid.NewGuid().ToString()#>">
  26.         <File Id="<#=fileName#>" Source="<#=f#>" KeyPath="yes" Checksum="yes"/>
  27.       </Component>
  28.      <#
  29.     }
  30. #>
  31. </DirectoryRef>
  32.  
  33. <!-- Step 3: Tell WiX to install the files -->
  34. <Feature Id="MainApplication" Title="My App" Level="1">
  35. <#
  36.     foreach(string f in files)
  37.     {
  38.     string fileName =  System.IO.Path.GetFileName(f);
  39. #>
  40.       <ComponentRef Id="<#=fileName#>" />
  41. <#}#>
  42. </Feature>
  43. </Include>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement