Created
January 5, 2013 22:03
-
-
Save zippy1981/4463936 to your computer and use it in GitHub Desktop.
Here is some working code to make a 7zip of a bin folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<TargetSevenZip>$(TargetDir)\$(TargetName).7z</TargetSevenZip> | |
<!-- See http://msdn.microsoft.com/en-us/magazine/dd419659.aspx#id0090093 --> | |
<CleanDependsOn> | |
CleanArt; | |
CleanSevenZip | |
$(CleanDependsOn); | |
</CleanDependsOn> | |
<SevenZipDependsOn>Build;</SevenZipDependsOn> | |
</PropertyGroup> | |
<Target Name="CleanSevenZip"> | |
<Delete Files="$(TargetSevenZip)"/> | |
</Target> | |
<Target Name="7zip" DependsOnTargets="$(SevenZipDependsOn)"> | |
<PropertyGroup> | |
<SevenZipExePath>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip', 'Path', null, RegistryView.Registry64))7z.exe</SevenZipExePath> | |
</PropertyGroup> | |
<Message Importance="Low" Text="7Zip executable: $(SevenZipExePath)"/> | |
<Error Condition="'$(SevenZipExePath)' == '' Or !Exists($(SevenZipExePath))" Text="7zip does not appear to be installed." /> | |
<Exec Command=""$(SevenZipExePath)" a -t7z -mx9 -x "poshrunner.vshost.exe" "$(TargetSevenZip)" "$(TargetDir)*""/> | |
</Target> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment