Skip to content

Instantly share code, notes, and snippets.

@i-e-b
Last active August 29, 2015 13:56
Show Gist options
  • Save i-e-b/9229128 to your computer and use it in GitHub Desktop.
Save i-e-b/9229128 to your computer and use it in GitHub Desktop.
Including files in Visual Studio project files, where it may be in one of a few places
<!-- Fragment showing conditions for both location and target platform -->
<PropertyGroup>
<InternalPath>..\..\Installers\Binaries</InternalPath>
<ExternalPath>..\..\..\..\..\Installers\Binaries</ExternalPath>
</PropertyGroup>
<ItemGroup>
<WixLibrary Include="Template" Condition=" '$(Platform)' == 'x86' ">
<HintPath Condition="Exists('$(InternalPath)')">$(InternalPath)\x86\Template.wixlib</HintPath>
<HintPath Condition="Exists('$(ExternalPath)')">$(ExternalPath)\x86\Template.wixlib</HintPath>
<Name>Template</Name>
</WixLibrary>
<WixLibrary Include="Template" Condition=" '$(Platform)' == 'x64' ">
<HintPath Condition="Exists('$(InternalPath)')">$(InternalPath)\x64\Template.wixlib</HintPath>
<HintPath Condition="Exists('$(ExternalPath)')">$(ExternalPath)\x64\Template.wixlib</HintPath>
<Name>Template</Name>
</WixLibrary>
</ItemGroup>
<PropertyGroup>
<SharedPathDeep>..\..\..\..\Shared Code</SharedPathDeep>
<SharedPathShallow>..\..\..\Shared Code</SharedPathShallow>
<SharedCodePath Condition="Exists('$(SharedPathDeep)')">$(SharedPathDeep)</SharedCodePath>
<SharedCodePath Condition="Exists('$(SharedPathShallow)')">$(SharedPathShallow)</SharedCodePath>
</PropertyGroup>
<ItemGroup>
<None Include="$(SharedCodePath)\MyKey.snk">
<Link>MyKey.snk</Link>
</None>
</ItemGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment