I know that using MSBuild Extension Pack I can decompress Zip files, but in my project I need to decompress a RAR file.
How can I do this?
Use Exec to extract archive by winrar.exe/rar.exe. If you have installed WinRar you can extract its installdir from registry otherwise specify where you rar.exe is located.
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<Target Name="ExtractRar">
<PropertyGroup>
<RarExe>$(registry:HKEY_LOCAL_MACHINE\Software\Winrar@exe32)</RarExe>
<archive>E:\sample.rar</archive>
<targetDir>E:\ExtratedArchive\</targetDir>
</PropertyGroup>
<Exec Command=""$(RarExe)" x "$(archive)" "$(targetDir)"" />
</Target>
</Project>