Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
742 lines (643 sloc) 32.8 KB
<#@ Template debug="true" hostspecific="false" language="C#" #>
<#@ Import Namespace="System.Security.Cryptography" #>
<#@ Import Namespace="System.Text" #>
<#@ Import Namespace="System.IO" #>
<#@ Import Namespace="System.Collections.Generic" #>
<#@ Output extension=".wxs" #><#
var visualStudioVersions = new []
{
new VisualStudioVersion
{
ReleaseName = "2005",
WixPrefix = "2005",
DirectoryName = "Visual Studio 8",
},
new VisualStudioVersion
{
ReleaseName = "2008",
WixPrefix = "90",
DirectoryName = "Visual Studio 9.0",
},
new VisualStudioVersion
{
ReleaseName = "2010",
WixPrefix = "2010",
DirectoryName = "Visual Studio 10.0",
SupportsWindowsPhone = true,
},
};
var supportedFrameworks = new []
{
new FrameworkInfo
{
ShortName = "Mono2",
FullName = "Mono 2.x",
HasExtendedProfile = true,
HasConfigInstaller = true,
},
new FrameworkInfo
{
ShortName = "NetFx20",
FullName = ".NET Framework 2.0",
HasConfigInstaller = true,
HasExtendedProfile = true,
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\NLog2",
},
},
new FrameworkInfo
{
ShortName = "NetFx35",
FullName = ".NET Framework 3.5",
HasConfigInstaller = true,
HasExtendedProfile = true,
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\.NETFramework\v3.5\AssemblyFoldersEx\NLog2",
},
},
new FrameworkInfo
{
ShortName = "NetFx40",
FullName = ".NET Framework 4.0",
HasExtendedProfile = true,
HasConfigInstaller = true,
HasNLogC = true,
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\.NETFramework\v4.0.30319\AssemblyFoldersEx\NLog2",
},
},
new FrameworkInfo
{
ShortName = "NetCf20",
FullName = ".NET Compact Framework 2.0",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\.NETCompactFramework\v2.0.0.0\PocketPC\AssemblyFoldersEx\NLog2",
@"SOFTWARE\Microsoft\.NETCompactFramework\v2.0.0.0\Smartphone\AssemblyFoldersEx\NLog2",
@"SOFTWARE\Microsoft\.NETCompactFramework\v2.0.0.0\WindowsCE\AssemblyFoldersEx\NLog2",
},
},
new FrameworkInfo
{
ShortName = "NetCf35",
FullName = ".NET Compact Framework 3.5",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\.NETCompactFramework\v3.5.0.0\PocketPC\AssemblyFoldersEx\NLog2",
@"SOFTWARE\Microsoft\.NETCompactFramework\v3.5.0.0\Smartphone\AssemblyFoldersEx\NLog2",
@"SOFTWARE\Microsoft\.NETCompactFramework\v3.5.0.0\WindowsCE\AssemblyFoldersEx\NLog2",
},
},
new FrameworkInfo
{
ShortName = "SL2",
FullName = "Silverlight 2.0",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v2.0\AssemblyFoldersEx\NLog2",
}
},
new FrameworkInfo
{
ShortName = "SL3",
FullName = "Silverlight 3.0",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v3.0\AssemblyFoldersEx\NLog2",
}
},
new FrameworkInfo
{
ShortName = "SL4",
FullName = "Silverlight 4.0",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v4.0\AssemblyFoldersEx\NLog2",
}
},
new FrameworkInfo
{
ShortName = "WP7",
FullName = "Silverlight for Windows Phone 7",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\Microsoft SDKs\Silverlight for Phone\v4.0\AssemblyFoldersEx\NLog2",
}
},
new FrameworkInfo
{
ShortName = "WP71",
FullName = "Silverlight for Windows Phone 7.1",
AssemblyInfoRegistryKeys =
{
@"SOFTWARE\Microsoft\Microsoft SDKs\Silverlight for WindowsPhone\v4.0\AssemblyFoldersEx\NLog2",
}
},
};
#><Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="$(var.ProductId)"
Name="$(var.ProductName) v$(var.BuildVersion)$(var.BuildLabel)"
Language="1033"
Version="$(var.BuildVersion)"
Manufacturer="NLog Project"
UpgradeCode="ecae2a6d-d653-40b8-9025-e0b9e68d0ea9">
<Package InstallerVersion="200" Compressed="yes" />
<Property Id="ApplicationFolderName" Value="NLog" />
<Property Id="WixAppFolder" Value="WixPerMachineFolder" />
<Property Id="WebSiteUrl" Value="http://nlog-project.org" />
<!-- import properties from Wix VS extensions-->
<!-- http://wix.sourceforge.net/manual-wix3/wixvsextension.htm -->
<# foreach (var vs in visualStudioVersions) { #>
<PropertyRef Id="VS<#= vs.WixPrefix #>_ROOT_FOLDER" />
<PropertyRef Id="VS<#= vs.WixPrefix #>_ITEMTEMPLATES_DIR" />
<PropertyRef Id="VS<#= vs.WixPrefix #>_SCHEMAS_DIR" />
<PropertyRef Id="VS<#= vs.WixPrefix #>_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED"/>
<PropertyRef Id="VS<#= vs.WixPrefix #>_IDE_VB_PROJECTSYSTEM_INSTALLED"/>
<# }
foreach (var vs in visualStudioVersions) {
#>
<CustomActionRef Id="VS<#= vs.WixPrefix #>InstallVSTemplates" />
<CustomActionRef Id="VCSHARP<#= vs.WixPrefix #>InstallVSTemplates" />
<CustomActionRef Id="VB<#= vs.WixPrefix #>InstallVSTemplates" />
<CustomActionRef Id="VWD<#= vs.WixPrefix #>InstallVSTemplates" />
<# if (vs.SupportsWindowsPhone) { #>
<CustomActionRef Id="VPD<#= vs.WixPrefix #>InstallVSTemplates" />
<#
}
}
#>
<WixVariable Id="WixUILicenseRtf" Value="license.rtf" />
<WixVariable Id="WixUIBannerBmp" Value="TopBanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="Background.bmp" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Icon Id="NLog.ico" SourceFile="NLog.ico" />
<Icon Id="Help.ico" SourceFile="Help.ico" />
<InstallExecuteSequence>
<!-- install/remove VS templates if the state of the feature changes -->
<# foreach (var vs in visualStudioVersions) { #>
<Custom Action="VS<#= vs.WixPrefix #>InstallVSTemplates" Before="InstallFinalize">NOT (&amp;Feature_VS<#= vs.ReleaseName #> = -1)</Custom>
<Custom Action="VCSHARP<#= vs.WixPrefix #>InstallVSTemplates" Before="InstallFinalize">NOT (&amp;Feature_VCSHARP<#= vs.ReleaseName #> = -1)</Custom>
<Custom Action="VB<#= vs.WixPrefix #>InstallVSTemplates" Before="InstallFinalize">NOT (&amp;Feature_VB<#= vs.ReleaseName #> = -1)</Custom>
<Custom Action="VWD<#= vs.WixPrefix #>InstallVSTemplates" Before="InstallFinalize">NOT (&amp;Feature_VWD<#= vs.ReleaseName #> = -1)</Custom>
<#
if (vs.SupportsWindowsPhone) {
#>
<Custom Action="VPD<#= vs.WixPrefix #>InstallVSTemplates" Before="InstallFinalize">NOT (&amp;Feature_VPD<#= vs.ReleaseName #> = -1)</Custom>
<#
}
} #>
</InstallExecuteSequence>
<UI>
<# foreach (var vs in visualStudioVersions) { #>
<ProgressText Action="VS<#= vs.WixPrefix #>InstallVSTemplates" Template="[1]">Registering Visual Studio <#= vs.ReleaseName #> Templates</ProgressText>
<ProgressText Action="VCSHARP<#= vs.WixPrefix #>InstallVSTemplates" Template="[1]">Registering Visual C# <#= vs.ReleaseName #> Express Templates</ProgressText>
<ProgressText Action="VB<#= vs.WixPrefix #>InstallVSTemplates" Template="[1]">Registering Visual Basic <#= vs.ReleaseName #> Express Templates</ProgressText>
<ProgressText Action="VWD<#= vs.WixPrefix #>InstallVSTemplates" Template="[1]">Registering Visual Web Developer <#= vs.ReleaseName #> Express Templates</ProgressText>
<#
if (vs.SupportsWindowsPhone) {
#>
<ProgressText Action="VPD<#= vs.WixPrefix #>InstallVSTemplates" Template="[1]">Registering Visual Studio <#= vs.ReleaseName #> Express for Windows Phone Templates</ProgressText>
<#
}
}
#>
</UI>
<!-- directories -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="NLog v$(var.BuildVersion)$(var.BuildLabel)" />
</Directory>
<Directory Id="ProgramFilesFolder">
<!-- application install directory -->
<Directory Id="APPLICATIONFOLDER" Name="NLog">
<# foreach (var framework in supportedFrameworks) { #>
<Directory Id="<#= (framework.ShortName + "_Dir").ToUpperInvariant() #>" Name="<#= framework.FullName #>" />
<# } #>
</Directory>
<# foreach (var vs in visualStudioVersions) { #>
<!-- Visual Studio <#= vs.ReleaseName #> directories -->
<Directory Id="VS<#= vs.WixPrefix #>_ROOT_FOLDER" Name="<#= vs.DirectoryName #>">
<Directory Id="VS<#= vs.ReleaseName #>_Common7" Name="Common7">
<Directory Id="VS<#= vs.ReleaseName #>_IDE" Name="IDE">
<Directory Id="VS<#= vs.ReleaseName #>_VCSExpress" Name="VCSExpress">
<Directory Id="VS<#= vs.ReleaseName #>_CSharpExpressItemTemplates" Name="ItemTemplates" />
</Directory>
<Directory Id="VS<#= vs.ReleaseName #>_VBExpress" Name="VBExpress">
<Directory Id="VS<#= vs.ReleaseName #>_VBExpressItemTemplates" Name="ItemTemplates" />
</Directory>
<Directory Id="VS<#= vs.ReleaseName #>_VWDExpress" Name="VWDExpress">
<Directory Id="VS<#= vs.ReleaseName #>_VWDExpressItemTemplates" Name="ItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VWDCSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_VWDVBItemTemplates" Name="VisualBasic" />
<Directory Id="VS<#= vs.ReleaseName #>_VWDWebItemTemplates" Name="Web">
<Directory Id="VS<#= vs.ReleaseName #>_VWDWebCSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_VWDWebVBItemTemplates" Name="VisualBasic" />
</Directory>
</Directory>
</Directory>
<# if (vs.SupportsWindowsPhone) { #>
<Directory Id="VS<#= vs.ReleaseName #>_VPDExpress" Name="VPDExpress">
<Directory Id="VS<#= vs.ReleaseName #>_VPDExpressItemTemplates" Name="ItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VPDCSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_VPDVBItemTemplates" Name="VisualBasic" />
<Directory Id="VS<#= vs.ReleaseName #>_VPDWebItemTemplates" Name="Web">
<Directory Id="VS<#= vs.ReleaseName #>_VPDWebCSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_VPDWebVBItemTemplates" Name="VisualBasic" />
</Directory>
</Directory>
</Directory>
<# } #>
<Directory Id="VS<#= vs.WixPrefix #>_ITEMTEMPLATES_DIR" Name="ItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_CSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_VBItemTemplates" Name="VisualBasic" />
<Directory Id="VS<#= vs.ReleaseName #>_WebItemTemplates" Name="Web">
<Directory Id="VS<#= vs.ReleaseName #>_WebCSharpItemTemplates" Name="CSharp" />
<Directory Id="VS<#= vs.ReleaseName #>_WebVBItemTemplates" Name="VisualBasic" />
</Directory>
</Directory>
</Directory>
</Directory>
<Directory Id="VS<#= vs.ReleaseName #>_Xml" Name="Xml">
<Directory Id="VS<#= vs.WixPrefix #>_SCHEMAS_DIR" Name="Schemas" />
</Directory>
<Directory Id="VS<#= vs.ReleaseName #>_VCS" Name="VC#">
<Directory Id="VS<#= vs.ReleaseName #>_VCS_Snippets" Name="Snippets">
<Directory Id="VS<#= vs.ReleaseName #>_VCS_Snippets_1033" Name="1033">
<Directory Id="VS<#= vs.ReleaseName #>_VisualCSharpSnippets" Name="Visual C#" />
</Directory>
</Directory>
</Directory>
<Directory Id="VS<#= vs.ReleaseName #>_VB" Name="VB">
<Directory Id="VS<#= vs.ReleaseName #>_VB_Snippets" Name="Snippets">
<Directory Id="VS<#= vs.ReleaseName #>_VB_Snippets_1033" Name="1033">
<Directory Id="VS<#= vs.ReleaseName #>_VisualBasicSnippets" Name="application" />
</Directory>
</Directory>
</Directory>
</Directory>
<# } #>
</Directory>
</Directory>
<!-- common stuff in the target directory -->
<DirectoryRef Id="APPLICATIONFOLDER" FileSource="$(var.NLogSourcePath)">
<Component Id="License_File" Guid="203ED250-FA92-4553-A590-723318DC7946">
<File Id="LICENSE.txt" Name="LICENSE.txt" Vital="yes" KeyPath="yes" />
</Component>
<Component Id="Help_File" Guid="374D5BEB-490D-4a9e-8663-8CD31B0F1363">
<File Id="NLog.chm" Name="NLog.chm" KeyPath="yes" Source="$(var.NLogBuildPath)\Documentation\NLog.chm" />
<Shortcut Id="Help_Shortcut"
Directory="ApplicationProgramsFolder"
Name="NLog Documentation"
Description="Documentation for NLog v$(var.BuildVersion)$(var.BuildLabel)"
Icon="Help.ico"
Advertise="yes">
</Shortcut>
</Component>
</DirectoryRef>
<!-- Common menu shortcuts -->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationProgramsFolder" Guid="ADA1D20F-C6C7-4826-89FF-CA0FAB65A74D">
<RemoveFolder Id='ApplicationProgramsFolder' On='uninstall' />
<Shortcut Target='[WebSiteUrl]' Name='NLog Website' Id='Website_Shortcut' Icon='NLog.ico' />
<RegistryValue Root='HKCU' Key='Software\NLog Project\NLog 2.0' Type='string' Value='' KeyPath='yes' />
</Component>
</DirectoryRef>
<ComponentGroup Id="Shared_Components">
<ComponentRef Id="License_File" />
<ComponentRef Id="ApplicationProgramsFolder" />
</ComponentGroup>
<# foreach (var framework in supportedFrameworks) { #>
<!-- <#= framework.FullName #> support -->
<?ifdef Include_<#= framework.ShortName #> ?>
<DirectoryRef Id="<#= (framework.ShortName + "_Dir").ToUpperInvariant() #>" FileSource="$(var.NLogBuildPath)\\<#= framework.FullName #>">
<# if (framework.HasNLogC) { #>
<Directory Id="<#= (framework.ShortName + "_NLogC_Dir").ToUpperInvariant() #>" Name="NLogC" FileSource="$(var.NLogBuildPath)\\<#= framework.FullName #>\NLogC">
<Directory Id="<#= (framework.ShortName + "_NLogC_x86_Dir") #>" Name="x86" FileSource="$(var.NLogBuildPath)\\<#= framework.FullName #>\NLogC\x86">
<Component Id="<#= framework.ShortName #>_NLogC_x86" Guid="<#= GetGuid(framework.ShortName, "NLogC_x86") #>">
<File Id="<#= framework.ShortName #>_NLogC_x86.dll" Name="NLogC.dll" Vital="yes" KeyPath="yes" />
<File Id="<#= framework.ShortName #>_NLogC_x86.pdb" Name="NLogC.pdb" />
<File Id="<#= framework.ShortName #>_NLogC_x86.lib" Name="NLogC.lib" />
<File Id="<#= framework.ShortName #>_NLogC_x86.exp" Name="NLogC.exp" />
</Component>
</Directory>
<Directory Id="<#= (framework.ShortName + "_NLogC_x64_Dir") #>" Name="x64" FileSource="$(var.NLogBuildPath)\\<#= framework.FullName #>\NLogC\amd64">
<Component Id="<#= framework.ShortName #>_NLogC_x64" Guid="<#= GetGuid(framework.ShortName, "NLogC_x64") #>">
<File Id="<#= framework.ShortName #>_NLogC_x64.dll" Name="NLogC.dll" Vital="yes" KeyPath="yes" />
<File Id="<#= framework.ShortName #>_NLogC_x64.pdb" Name="NLogC.pdb" />
<File Id="<#= framework.ShortName #>_NLogC_x64.lib" Name="NLogC.lib" />
<File Id="<#= framework.ShortName #>_NLogC_x64.exp" Name="NLogC.exp" />
</Component>
</Directory>
<Directory Id="<#= (framework.ShortName + "_NLogC_Include_Dir") #>" Name="include">
<Component Id="<#= framework.ShortName #>_NLogC_Include" Guid="<#= GetGuid(framework.ShortName, "NLogC_Include") #>">
<File Id="<#= framework.ShortName #>_NLogC.h" Name="NLogC.h" Vital="yes" KeyPath="yes" />
<File Id="<#= framework.ShortName #>_NLogger.h" Name="NLogger.h" />
</Component>
</Directory>
</Directory>
<# } #>
<Component Id="<#= framework.ShortName #>_Binaries" Guid="<#= GetGuid(framework.ShortName, "Binaries") #>">
<File Id="<#= framework.ShortName #>_NLog.dll" Name="NLog.dll" Vital="yes" KeyPath="yes" />
<File Id="<#= framework.ShortName #>_NLog.xml" Name="NLog.xml" />
<# if (framework.HasConfigInstaller) { #>
<File Id="<#= framework.ShortName #>_InstallNLogConfig.exe" Name="InstallNLogConfig.exe" />
<# } #>
<# if (framework.HasExtendedProfile) { #>
<File Id="<#= framework.ShortName #>_NLog.Extended.dll" Name="NLog.Extended.dll" Vital="yes" />
<File Id="<#= framework.ShortName #>_NLog.Extended.xml" Name="NLog.Extended.xml" />
<# } #>
<# foreach (string assemblyInfoPath in framework.AssemblyInfoRegistryKeys) {
#>
<RegistryKey Root="HKLM" Key="<#= assemblyInfoPath #>" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="[<#= (framework.ShortName + "_Dir").ToUpperInvariant() #>]"></RegistryValue>
</RegistryKey>
<# } #>
</Component>
<Component Id="<#= framework.ShortName #>_DebugInfo" Guid="<#= GetGuid(framework.ShortName, "DebugInfo") #>">
<File Id="<#= framework.ShortName #>_NLog.<#= framework.GetDebugInfo("NLog.dll") #>" Name="<#= framework.GetDebugInfo("NLog.dll") #>" />
<# if (framework.HasExtendedProfile) { #>
<File Id="<#= framework.ShortName #>_NLog.<#= framework.GetDebugInfo("NLog.Extended.dll") #>" Name="<#= framework.GetDebugInfo("NLog.Extended.dll") #>" />
<# } #>
<# if (framework.HasConfigInstaller) { #>
<File Id="<#= framework.ShortName #>_InstallNLogConfig.pdb" Name="<#= framework.GetDebugInfo("InstallNLogConfig.exe") #>" />
<# } #>
</Component>
</DirectoryRef>
<?endif ?>
<# } #>
<# foreach (var vs in visualStudioVersions) { #>
<!-- Visual Studio <#= vs.ReleaseName #> -->
<!-- C# -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_CSharpItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_CSharpItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_CSharpItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "CSharpItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "CSharp", "CSharp", ""); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VB -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VBItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VBItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VBItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VBItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "VisualBasic", "VB", "VB"); #>
</Component>
</Directory>
</DirectoryRef>
<!-- C# in web projects -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_WebCSharpItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_WebCSharpItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_WebCSharpItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "WebCSharpItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "CSharp", "WebCSharp", "Web"); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VB in web projects -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_WebVBItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_WebVBItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_WebVBItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "WebVBItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "WebVisualBasic", "WebVB", "VB"); #>
</Component>
</Directory>
</DirectoryRef>
<!-- C# express -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_CSharpExpressItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_CSharpExpressItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_CSharpExpressItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "CSharpExpressItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "CSharp", "CSharpExpress", ""); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VB express -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VBExpressItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VBExpressItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VBExpressItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VBExpressItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "VisualBasic", "VBExpress", ""); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VWD C# -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VWDCSharpItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VWDCSharpItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VWDCSharpItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VWDCSharpItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "CSharp", "VWDCSharp", ""); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VWD VB -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VWDVBItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VWDVBItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VWDVBItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VWDVBItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "VisualBasic", "VWDVB", "VB"); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VWD C# in web projects -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VWDWebCSharpItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VWDWebCSharpItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VWDWebCSharpItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VWDWebCSharpItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "WebCSharp", "VWDWebCSharp", "Web"); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VWD VB in web projects -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VWDWebVBItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VWDWebVBItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VWDWebVBItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VWDWebVBItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "WebVisualBasic", "VWDWebVB", "VB"); #>
</Component>
</Directory>
</DirectoryRef>
<# if (vs.SupportsWindowsPhone) { #>
<!-- VPD C# -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VPDCSharpItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VPDCSharpItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VPDCSharpItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VPDCSharpItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "CSharp", "VPDCSharp", ""); #>
</Component>
</Directory>
</DirectoryRef>
<!-- VPD VB -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VPDVBItemTemplates">
<Directory Id="VS<#= vs.ReleaseName #>_VPDVBItemTemplates_NLog" Name="NLog" FileSource="$(var.NLogSourcePath)\src\VSIntegration\ItemTemplates">
<Component Id="VS<#= vs.ReleaseName #>_VPDVBItemTemplates" Guid="<#= GetGuid(vs.ReleaseName, "VPDVBItemTemplates") #>">
<# PrintTemplates(vs.ReleaseName, "VisualBasic", "VPDVB", "VB"); #>
</Component>
</Directory>
</DirectoryRef>
<# } #>
<!-- C# code snippets -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VisualCSharpSnippets" FileSource="$(var.NLogSourcePath)\src\VSIntegration\Snippets">
<Component Id="VS<#= vs.ReleaseName #>_CSharpCodeSnippets" Guid="<#= GetGuid(vs.ReleaseName, "CSharpSnippets") #>">
<File Id="VS<#= vs.ReleaseName #>_CSharpLogger.snippet" Name="CSharpLogger.snippet" />
</Component>
</DirectoryRef>
<!-- VB code snippets -->
<DirectoryRef Id="VS<#= vs.ReleaseName #>_VisualBasicSnippets" FileSource="$(var.NLogSourcePath)\src\VSIntegration\Snippets">
<Component Id="VS<#= vs.ReleaseName #>_VBCodeSnippets" Guid="<#= GetGuid(vs.ReleaseName, "VBSnippets") #>">
<File Id="VS<#= vs.ReleaseName #>_VBLogger.snippet" Name="VBLogger.snippet" />
</Component>
</DirectoryRef>
<DirectoryRef Id="VS<#= vs.WixPrefix #>_SCHEMAS_DIR" FileSource="$(var.NLogBuildPath)">
<Component Id="VS<#= vs.ReleaseName #>_XmlSchemas" Guid="<#= GetGuid(vs.ReleaseName, "XmlSchemas") #>">
<File Id="VS<#= vs.ReleaseName #>_NLog.xsd" Name="NLog.xsd" />
<# foreach (var framework in supportedFrameworks) { #>
<?ifdef Include_<#= framework.ShortName #> ?>
<File Id="VS<#= vs.ReleaseName #>_NLog.<#= framework.ShortName #>.xsd" Name="NLog.<#= framework.ShortName #>.xsd" Source="$(var.NLogBuildPath)\\<#= framework.FullName #>\NLog.<#= framework.ShortName #>.xsd" />
<?endif ?>
<# } #>
</Component>
</DirectoryRef>
<# } #>
<!-- Features -->
<Feature Id="Shared_Feature" Title="NLog Shared Components" Level="1" Absent="disallow">
<ComponentGroupRef Id="Shared_Components" />
</Feature>
<Feature Id="Feature_Binaries" Title="Binaries" Level="1">
<# foreach (var framework in supportedFrameworks) { #>
<?ifdef Include_<#= framework.ShortName #> ?>
<Feature Id="<#= framework.ShortName #>_Binaries" Title="<#= framework.FullName #>" Level="1">
<ComponentRef Id="<#= framework.ShortName #>_Binaries" />
</Feature>
<?endif?>
<# } #>
</Feature>
<Feature Id="Feature_Help" Title="Help" Level="1">
<ComponentRef Id="Help_File" />
</Feature>
<Feature Id="Feature_DebugInfo" Title="Debug Symbols" Level="100">
<# foreach (var framework in supportedFrameworks) { #>
<?ifdef Include_<#= framework.ShortName #> ?>
<Feature Id="<#= framework.ShortName #>_DebugInfo" Title="<#= framework.FullName #>" Level="1">
<ComponentRef Id="<#= framework.ShortName #>_DebugInfo" />
</Feature>
<?endif?>
<# } #>
</Feature>
<Feature Id="Feature_NLogC" Title="NLogC" Level="1">
<# foreach (var framework in supportedFrameworks) {
if (!framework.HasNLogC) continue;
#>
<?ifdef Include_<#= framework.ShortName #> ?>
<Feature Id="<#= framework.ShortName #>_NLogC" Title="<#= framework.FullName #>" Level="1">
<ComponentRef Id="<#= framework.ShortName #>_NLogC_x86" />
<ComponentRef Id="<#= framework.ShortName #>_NLogC_x64" />
<ComponentRef Id="<#= framework.ShortName #>_NLogC_Include" />
</Feature>
<?endif?>
<# } #>
</Feature>
<Feature Id="Feature_IDE" Title="IDE Support" Level="1">
<# foreach (var vs in visualStudioVersions) { #>
<!-- Visual Studio <#= vs.ReleaseName #> -->
<Feature Id="Feature_VS<#= vs.ReleaseName #>" Title="Visual Studio <#= vs.ReleaseName #>" Level="0">
<Condition Level="1">VS<#= vs.WixPrefix #>_ROOT_FOLDER AND (VS<#= vs.WixPrefix #>_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED OR VS<#= vs.WixPrefix #>_IDE_VB_PROJECTSYSTEM_INSTALLED)</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_XmlSchemas"/>
<Feature Id="Feature_VS<#= vs.ReleaseName #>_CSharp" Title="C# Support" Level="0">
<Condition Level="1">VS<#= vs.WixPrefix #>_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_WebCSharpItemTemplates" />
</Feature>
<Feature Id="Feature_VS<#= vs.ReleaseName #>_VB" Title="VB Support" Level="0">
<Condition Level="1">VS<#= vs.WixPrefix #>_IDE_VB_PROJECTSYSTEM_INSTALLED</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_WebVBItemTemplates" />
</Feature>
</Feature>
<Feature Id="Feature_VCSHARP<#= vs.ReleaseName #>" Title="Visual C# <#= vs.ReleaseName #> Express" Level="0">
<Condition Level="1">VCSHARP<#= vs.WixPrefix #>EXPRESS_IDE</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_XmlSchemas"/>
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpExpressItemTemplates" />
</Feature>
<Feature Id="Feature_VWD<#= vs.ReleaseName #>" Title="Visual Web Developer <#= vs.ReleaseName #> Express" Level="0">
<Condition Level="1">VWD<#= vs.WixPrefix #>EXPRESS_IDE</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_XmlSchemas"/>
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VWDCSharpItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VWDVBItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VWDWebCSharpItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VWDWebVBItemTemplates" />
</Feature>
<# if (vs.SupportsWindowsPhone) { #>
<Feature Id="Feature_VPD<#= vs.ReleaseName #>" Title="Visual Studio <#= vs.ReleaseName #> Express for Windows Phone" Level="0">
<Condition Level="1">VPD<#= vs.WixPrefix #>EXPRESS_IDE</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_XmlSchemas"/>
<ComponentRef Id="VS<#= vs.ReleaseName #>_CSharpCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VPDCSharpItemTemplates" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VPDVBItemTemplates" />
</Feature>
<# } #>
<Feature Id="Feature_VB<#= vs.ReleaseName #>" Title="Visual Basic <#= vs.ReleaseName #> Express" Level="0">
<Condition Level="1">VB<#= vs.WixPrefix #>EXPRESS_IDE</Condition>
<ComponentRef Id="VS<#= vs.ReleaseName #>_XmlSchemas"/>
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBCodeSnippets" />
<ComponentRef Id="VS<#= vs.ReleaseName #>_VBExpressItemTemplates" />
</Feature>
<# } #>
</Feature>
<UIRef Id="WixUI_Mondo" />
</Product>
</Wix>
<#+
void PrintTemplates(string releaseName, string language, string shortLanguage, string specifier)
{
var itemTemplateNames = new []
{
"Console",
"Empty",
"File",
"LogReceiver",
"NLogViewer",
};
for (int i = 0; i < itemTemplateNames.Length; i++) {
string templateName = itemTemplateNames[i];
#>
<File Id="VS<#= releaseName #>_<#= shortLanguage #><#= templateName #>NLogConfig.zip" Name="<#= language #><#= templateName #>NLogConfig.zip" ShortName="<#= specifier #>NLog<#= (i + 1) #>.zip" <#= (i == 0) ? "KeyPath=\"yes\" " : "" #>/>
<#+ }
}
string GuidNamespace = "{417548C6-D8AB-4f95-9BAE-B0D60D9C8529}";
string GetGuid(string p1, string p2)
{
byte[] bytes = Encoding.ASCII.GetBytes(GuidNamespace + p1 + "." + p2);
bytes = MD5.Create().ComputeHash(bytes);
bytes[7] &= 0x0F;
bytes[7] |= 0x30;
return new Guid(bytes).ToString();
}
public class VisualStudioVersion
{
public string ReleaseName { get; set; }
public string WixPrefix { get; set; }
public string DirectoryName { get; set; }
public bool SupportsWindowsPhone { get; set; }
};
public class FrameworkInfo
{
public FrameworkInfo()
{
AssemblyInfoRegistryKeys = new List<string>();
}
public string GetDebugInfo(string dllName)
{
if (this.ShortName.StartsWith("Mono"))
{
return dllName + ".mdb";
}
return Path.ChangeExtension(dllName, ".pdb");
}
public string ShortName { get; set; }
public string FullName { get; set; }
public bool HasExtendedProfile { get; set; }
public bool HasConfigInstaller { get; set; }
public bool HasNLogC { get; set; }
public string DebugInfoExtension { get; set; }
public List<string> AssemblyInfoRegistryKeys { get; private set; }
}
#>
Jump to Line
Something went wrong with that request. Please try again.