I am trying to call msbuild task for all the project files with properties. I call the msbuild task four times with hardcoded configurations and platform combination. Something like
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Build" Properties="Configuration=Debug;Platform=Win32" BuildInParallel="true"/>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Build" Properties="Configuration=Debug;Platform=x64" BuildInParallel="true"/>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Build" Properties="Configuration=Release;Platform=Win32" BuildInParallel="true"/>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Build" Properties="Configuration=Release;Platform=x64" BuildInParallel="true"/>
But I want to provide this property as ItemGroup something like this
Configuration=%(BUILD_CONFIG.Identity);Platform=%(BUILD_PLATFORM.Identity)
Code sample
MyProject.vcxproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="BuildAll" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="BuildAllConfiguration.vcxproj"/>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E6B6F967-3BE3-428F-9288-3F838B8E726A}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>MyProject</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
...
Similar Configuration Details for release and Platforms x64
This project file includes BuildAllConfiguration.vcxproj
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BUILD_PLATFORMS>Win32;x64</BUILD_PLATFORMS>
<BUILD_CONFIGURATION>Debug;Release</BUILD_CONFIGURATION>
</PropertyGroup>
<Target Name="BuildAll">
<ItemGroup>
<CONFIGURATION Include="$(BUILD_CONFIGURATION.Split(';'))"/>
<PLATFORM Include="$(BUILD_PLATFORMS.Split(';'))"/>
<ProjectToBuild Include="$(MSBuildProjectFile)">
<Properties>Configuration=%(CONFIGURATION.Identity);Platform=%(PLATFORM.Identity)</Properties>
<Targets>Build</Targets>
</ProjectToBuild>
</ItemGroup>
<Message Text="MSBUILD TASK input #(ProjectToBuild)"/>
<MSBuild Projects="#(ProjectToBuild)" />
</Target>
</Project>
This project will call MyProject.vcxproj with Target Build and Properties which is not getting wellformed. My expectation is that the properties goes as following
Properties=Configuration=Debug;Platform=Win32
Properties=Configuration=Release;Platform=Win32
Properties=Configuration=Debug;Platform=x64
Properties=Configuration=Release;Platform=x64
Instead the properties are passed as following
Properties=Configuration=Debug;Platform=
Properties=Configuration=Release;Platform=
Properties=Configuration=;Platform=Win32
Properties=Configuration=;Platform=x64
You need a cross-product here, if you search for that you should find plenty of answers, though I reckon if you don't know it's called that it might be hard to find. Something like this:
<Target Name="BuildAll">
<ItemGroup>
<CONFIGURATION Include="$(BUILD_CONFIGURATION.Split(';'))"/>
<PLATFORM Include="$(BUILD_PLATFORMS.Split(';'))"/>
<!-- cross product of both -->
<ConfigAndPlatform Include="#(CONFIGURATION)">
<Platform>%(PLATFORM.Identity)</Platform>
</ConfigAndPlatform>
<ProjectToBuild Include="$(MSBuildProjectFile)"/>
</ItemGroup>
<MSBuild Projects="#(ProjectToBuild)" Properties="Configuration=%(ConfigAndPlatform.Identity);Platform=%(ConfigAndPlatform.Platform)" />
</Target>
Some notes: capitals make things harder to read, maybe don't use them? Also if you put your configurations/platforms in an ItemGroup instead of a PropertyGroup you don't need extra splitting logic:
<ItemGroup>
<Configuration Include="Debug;Release"/>
<Platform Include="Win32;x64"/>
<ItemGroup>
Related
I am currently trying to decouple a project and I am getting the following error
The OutputPath property is not set for project 'MyProj.vcxpro j'.
Please check to make sure that you have specified a valid combination
of Configuration and Platform for this project. Configuration=''
Platform='x64'. You may be seeing this message because you a re
trying to build a project without a solution file, and have specified
a non-default Configuration or Platform that doesn't exist for this
project. [D:\Test\MyProj.vcxproj]
I added this to my project but it is not helping
<PropertyGroup Label="Globals">
<Platform Condition="'$(Platform)' == ''">x64</Platform>
<TargetName>MyProj</TargetName>
<ResolveExportedSymbols>true</ResolveExportedSymbols>
<ProjectGuid>{xxxxx-xxxx-xxxx-xxx}</ProjectGuid>
<UsePrecompiledHeader>true</UsePrecompiledHeader>
<OutputPath>D:\MyOutput\out\</OutputPath>
</PropertyGroup>
Any suggestions ?
Please use this:
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<TargetName>MyProj</TargetName>
<ResolveExportedSymbols>true</ResolveExportedSymbols>
<ProjectGuid>{xxxxx-xxxx-xxxx-xxx}</ProjectGuid>
<OutputPath>D:\MyOutput\out\</OutputPath>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
.....
</ClCompile>
</ItemDefinitionGroup>
.....
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>
Then, delete any output folder like Debug and then rebuild again.
Only For educational purposes.
Basically I am trying to compile Juicy Potato exploit. I found a visual studio project from github and Now I am trying to compile it using mono xbuild, Although it compiles without any errors but I can't find the binary or .exe files.
see below:
>>>> xbuild tool is deprecated and will be removed in future updates, use msbuild instead <<<<
XBuild Engine Version 14.0
Mono, Version 5.18.0.240
Copyright (C) 2005-2013 Various Mono authors
Build started 2019-10-10 3:30:02 PM.
__________________________________________________
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Ignoring vcproj 'JuicyPotato'.
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Failed to find project 4164003e-ba47-4a95-8586-d5aac399c050
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
Project "/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln" (default target(s)):
Target ValidateSolutionConfiguration:
Building solution configuration "Debug|x64".
Done building project "/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy- potato/JuicyPotato/JuicyPotato.sln".
Build succeeded.
Warnings:
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Ignoring vcproj 'JuicyPotato'.
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Failed to find project 4164003e-ba47-4a95-8586-d5aac399c050
/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato/JuicyPotato.sln: warning : Don't know how to handle GlobalSection ExtensibilityGlobals, Ignoring.
3 Warning(s)
0 Error(s)
Time Elapsed 00:00:00.1375220
root#kali:/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato# ls
JuicyPotato JuicyPotato.sdf JuicyPotato.sln
root#kali:/home/HTB/Json/10.10.10.158/nmap/juicy_potato/juicy-potato/JuicyPotato# uname -a
Linux kali 4.19.0-kali3-amd64 #1 SMP Debian 4.19.20-1kali1 (2019-02-14) x86_64 GNU/Linux
my .vcxproj
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4164003E-BA47-4A95-8586-D5AAC399C050}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>JuicyPotato</RootNamespace>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
<ProjectName>JuicyPotato</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>```
Bottom:
```<PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;MSFROTTENPOTATO_EXPORTS;_CRT_SECURE_NO_WARNINGS;% (PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>secur32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<BuildLog>
<Path>$(SolutionDir)$(Configuration)\$(Platform)\$(MSBuildProjectName).log</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemGroup>
<Text Include="ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="BlockingQueue.h" />
<ClInclude Include="IStorageTrigger.h" />
<ClInclude Include="LocalNegotiator.h" />
<ClInclude Include="MSFRottenPotato.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
</PrecompiledHeader>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
</PrecompiledHeader>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
</PrecompiledHeader>
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="IStorageTrigger.cpp" />
<ClCompile Include="LocalNegotiator.cpp" />
<ClCompile Include="JuicyPotato.cpp" />
<ClCompile Include="stdafx.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>```
Architecture:
Linux kali 4.19.0-kali3-amd64 #1 SMP Debian 4.19.20-1kali1 (2019-02-14) x86_64 GNU/Linux
I have been experimenting with MSBuild to create custom targets. I am currently attempting to add support for compiling file with the JAWS script compiler. This is what I have so far.
Scripts.props
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DEVDOCS_DIR>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\..\..\DevDocs'))</DEVDOCS_DIR>
<BUILTIN_MASTER>$(DEVDOCS_DIR)\jsd\enu\builtin_master.jsd</BUILTIN_MASTER>
<TOOLBOX_DIR>$(DEVDOCS_DIR)\Toolbox</TOOLBOX_DIR>
<JAWS_VER>17.0</JAWS_VER>
<!-- If perl.exe is not in your path, set the following variable to the full path and file name of perl.exe.
Optionally you could set the PERL_EXE environment variable. -->
<PERL_EXE Condition="'$(PERL_EXE)'==''">perl.exe</PERL_EXE>
<!-- If scompile.exe is not in your path, set the following variable to the full path and file name of scompile.exe.
Optionally you could set the SCOMPILE_EXE environment variable. -->
<SCOMPILE_EXE Condition="'$(SCOMPILE_EXE)'==''">scompile.exe</SCOMPILE_EXE>
</PropertyGroup>
</Project>
Scripts.targets
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Target Name="GenerateBuiltinJSD">
<Exec Command=""$(PERL_EXE)" compilejsd.pl -v Jaws/$(JAWS_VER) -o "$(MSBuildProjectDirectory)\builtin.jsd" "$(BUILTIN_MASTER)"" WorkingDirectory="$(TOOLBOX_DIR)" />
</Target>
<Target Name="CompileScripts">
<Exec Command=""$(SCOMPILE_EXE)" /d "%(ScriptSourceFiles.FullPath)"" Outputs="%(ScriptSourceFiles.RootDir)%(ScriptSourceFiles.Directory)%(ScriptSourceFiles.Filename).jsb" WorkingDirectory="$(MSBuildProjectDirectory)" />
</Target>
<Target Name="Clean">
<ItemGroup>
<JSBFiles Include="$(MSBuildProjectDirectory)\*.jsb" />
</ItemGroup>
<Delete Files="#(JSBFiles)" />
</Target>
<Target Name="Build">
<CallTarget Targets="GenerateBuiltinJSD;CompileScripts" />
</Target>
</Project>
Scripts.vcxproj
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ScriptSourceFiles Include="Default.jss" />
</ItemGroup>
<ItemGroup>
<ScriptMessageFiles Include="Default.jsm" />
</ItemGroup>
<ItemGroup>
<ScriptHeaderFiles Include="HJConst.jsh" />
</ItemGroup>
<ItemGroup>
<ScriptDocumentationFiles Include="default.jsd" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{B2C4363D-D228-425D-AB04-38997EA229C0}</ProjectGuid>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="PropertySheets">
<Import Project="Scripts.props" />
</ImportGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<Import Project="$(MSBuildProjectDirectory)\Scripts.targets" />
</Project>
This works up to a point. The problem is that when I do a build, it rebuilds all the script files, even if the relevant source file has not changed.
My question is how can I modify this so that each file is only built if necessary?
The feature you are asking about is called Incremental Build, and hopefully it is supported by MSBuild utility. All you have to do is to specify inputs and outputs for a target you are planning to skip if no source files are changed.
To specify inputs and outputs for a target: Use the Inputs and Outputs attributes of the Target element. For example:
<Target Name="Build"
Inputs="#(CSFile)"
Outputs="hello.exe">
MSBuild can compare the timestamps of the input files with the timestamps of the output files and determine whether to skip, build, or partially rebuild a target.
To succeed in your task you have to properly generate the Inputs and Outputs of your target. This can be achieved by using special targets, which will populate the required items, or you can use the transformation explicitly:
<Target Name="CompileScripts"
Inputs="#(ScriptSourceFiles)"
Outputs="#(ScriptSourceFiles->'%(RootDir)%(Directory)%(FileName).jsb')">
<Exec Command=""$(SCOMPILE_EXE)" /d "%(ScriptSourceFiles.FullPath)"" Outputs="%(ScriptSourceFiles.RootDir)%(ScriptSourceFiles.Directory)%(ScriptSourceFiles.Filename).jsb" WorkingDirectory="$(MSBuildProjectDirectory)" />
</Target>
(Also note that instead of referencing %(RootDir) item metadata you should use $(OutDir) property, because it is more straightforward, but you should ensure that this property is specified and exists when the target is executed).
I have a VSIX package in a 2015 Solution, targetting VS2013. Whenever I try to run it against the VS2013 Experimental Instance, the extension doesn't show up in the installed list.
However, I am able to manually install the .vsix file into 2013 by double clicking on it. This will install (and run) successfully.
The settings for creating the .vsix and deploying it to Exp appear to be correct. What am I missing?
Manifest
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="9D7E0DF5-0A4D-4B43-9D73-4AD3F83260FA" Version="1.2" Language="en-US" Publisher="VersionOne" />
<DisplayName>VersionOne TFS Checkin Policy</DisplayName>
<Description xml:space="preserve">TFS Checkin policy from VersionOne for Visual Studio 2013. Requires code commits to contain a VersionOne identifier</Description>
<License>LICENSE.md</License>
<Icon>logo.ico</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[12.0]" />
<InstallationTarget Version="[12.0]" Id="Microsoft.VisualStudio.Premium" />
<InstallationTarget Version="[12.0]" Id="Microsoft.VisualStudio.Ultimate" />
</Installation>
<Dependencies>
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5]" />
</Dependencies>
<Assets>
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="File" Path="RegistryKeyToAdd.pkgdef" />
</Assets>
</PackageManifest>
Project File
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">11.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>12.0</OldToolsVersion>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{2153C73F-1BA9-49F8-BAB2-84F7769BD67A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>VersionOne.Integration.Tfs.Policy.Deployment.VS2013</RootNamespace>
<AssemblyName>VersionOne.Integration.Tfs.Policy.VS2013</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<GeneratePkgDefFile>false</GeneratePkgDefFile>
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>false</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CreateVsixContainer>True</CreateVsixContainer>
<DeployExtension>True</DeployExtension>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="..\VersionOne.Integration.Tfs.Policy.Deployment.Shared\logo.ico">
<Link>logo.ico</Link>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\VersionOne.Integration.Tfs.Policy.Deployment.Shared\RegistryKeyToAdd.pkgdef">
<Link>RegistryKeyToAdd.pkgdef</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="..\VersionOne.Integration.Tfs.Policy.Deployment.Shared\LICENSE.md">
<Link>LICENSE.md</Link>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="app.config" />
<None Include="source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\VersionOne.Integration.Tfs.Policy.VS2013\VersionOne.Integration.Tfs.Policy.VS2013.csproj">
<Project>{24b4af99-795b-4b33-ad1d-fd51f32e2aeb}</Project>
<Name>VersionOne.Integration.Tfs.Policy.VS2013</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
You need to configure your project to deploy to VS2013, even when run from VS2015.
Sam Harwell wrote a NuGet package that does exactly that; just install that package and you should be good to go.
I'm trying to apply a manifest to a WiX generated msi to create an exe that will immediately display a UAC prompt upon running the installer. Unfortunately I'm getting the following error upon building my installer project:
Values of attribute "level" not equal in different manifest snippets. mt.exe
I need to elevate the execution to allow custom actions that run during InstallUISequence to have admin privileges (to look up IIS app pools and web apps). I'm using Visual Studio 2012 on Windows 8.
Below is my wixproj file which shows my bootstrapper setup:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>3.5</ProductVersion>
<ProjectGuid>{d51029e8-4a79-4812-96e1-bf6b600d5d34}</ProjectGuid>
<SchemaVersion>2.0</SchemaVersion>
<OutputName>WixInstallerExampleWebInstaller</OutputName>
<OutputType>Package</OutputType>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
<DefineConstants>Debug</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>obj\$(Configuration)\</IntermediateOutputPath>
</PropertyGroup>
<ItemGroup>
<Compile Include="IisSettingsDlg.wxs" />
<Compile Include="Product.wxs" />
<Compile Include="UserInterface.wxs" />
<Compile Include="WixInstallerExampleWeb.wxs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WixInstallerExampleWeb\WixInstallerExampleWeb.csproj">
<Name>WixInstallerExampleWeb</Name>
<Project>{d23a374d-764c-40ba-b566-4d7c55319236}</Project>
<Private>True</Private>
<DoNotHarvest>True</DoNotHarvest>
<RefProjectOutputGroups>Binaries;Content;Satellites</RefProjectOutputGroups>
<RefTargetDir>INSTALLLOCATION</RefTargetDir>
<PackageThisProject>True</PackageThisProject>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<WixExtension Include="WixUtilExtension">
<HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
<Name>WixUtilExtension</Name>
</WixExtension>
<WixExtension Include="WixNetFxExtension">
<HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
<Name>WixNetFxExtension</Name>
</WixExtension>
<WixExtension Include="WixIIsExtension">
<HintPath>$(WixExtDir)\WixIIsExtension.dll</HintPath>
<Name>WixIIsExtension</Name>
</WixExtension>
<WixExtension Include="WixUIExtension">
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
<ItemGroup>
<Content Include="EULA.rtf" />
<Content Include="IisManager.CA.dll" />
<Content Include="uac.manifest" />
</ItemGroup>
<ItemGroup>
<BootstrapperFile Include="Microsoft.Windows.Installer.3.1" >
<ProductName>Windows Installer 3.1</ProductName>
</BootstrapperFile>
</ItemGroup>
<Import Project="$(WixTargetsPath)" />
<Target Name="Bootstrapper"
Inputs="$(OutDir)$(TargetFileName)"
Outputs="$(OutDir)\Setup.exe"
Condition=" '$(OutputType)'=='package' " >
<GenerateBootstrapper ApplicationName="application name"
ApplicationFile="$(TargetFileName)"
BootstrapperItems="#(BootstrapperFile)"
ComponentsLocation="Relative"
OutputPath="$(OutputPath)"
Culture="en-US"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\Bootstrapper" />
</Target>
<Target Name="PatchSetupExe" DependsOnTargets="Bootstrapper">
<Exec Command='"C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\bin\mt.exe" -manifest "$(ProjectDir)uac.manifest" -updateresource:"$(ProjectDir)$(OutputPath)Setup.exe;#1"' IgnoreExitCode='false' />
</Target>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets" />
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);Bootstrapper;PatchSetupExe</BuildDependsOn>
</PropertyGroup>
<Target Name="BeforeBuild">
<MSBuild Projects="%(ProjectReference.FullPath)" Targets="Package" Properties="Configuration=$(Configuration);Platform=AnyCPU" Condition="'%(ProjectReference.PackageThisProject)'=='True'" />
<Copy SourceFiles="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\TransformWebConfig\transformed\web.config" OverwriteReadOnlyFiles="true" DestinationFolder="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\" Condition="'%(ProjectReference.PackageThisProject)'=='True'" />
<PropertyGroup>
<LinkerBaseInputPaths>%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\</LinkerBaseInputPaths>
<DefineConstants>BasePath=%(ProjectReference.RootDir)%(ProjectReference.Directory);</DefineConstants>
</PropertyGroup>
<HeatDirectory OutputFile="%(ProjectReference.Filename).wxs" Directory="%(ProjectReference.RootDir)%(ProjectReference.Directory)obj\$(Configuration)\Package\PackageTmp\" DirectoryRefId="INSTALLLOCATION" ComponentGroupName="%(ProjectReference.Filename)_Project" SuppressCom="true" SuppressFragments="true" SuppressRegistry="true" SuppressRootDirectory="true" AutoGenerateGuids="false" GenerateGuidsNow="true" ToolPath="$(WixToolPath)" Condition="'%(ProjectReference.PackageThisProject)'=='True'" PreprocessorVariable="var.BasePath" />
</Target>
<PropertyGroup>
<PreBuildEvent />
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent />
</PropertyGroup>
<!--
To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Wix.targets.
<Target Name="AfterBuild">
</Target>
-->
</Project>
And here is my manifest file I'm trying to apply:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Setup" type="win32" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
I found one solution. Download Resource Hacker. Open your resulting executable file and browse it until you find your manifest file. You can edit it diretly in UI or you can script it in command line:
ResHacker.exe -modify old.exe,new.exe,manifestToUse.manifest,ROOTNODE,SUBNODE*
*Those NODEs are the path corresponding with resource (manifest) you are trying to update - it is the path in tree in Resource Hacker UI.
Another Hack is to modify the manifest information of the burn.exe of WiX. But this seems to be a very bad solution and I am not sure if there are any side effects. But in my case I could solve it that way because in my build process I use the WiX binaries (not the WiX setup) within my source control version system which then will not affect any other WiX projects on my machine.
I used Visual Studio´s Resource Editor to edit the manifest of burn.exe.