2013-09-25 41 views

回答

2

使用Exec通过winrar.exe/rar.exe解压档案。 如果您已安装WinRar,则可以从注册表中提取其installdir,否则指定您的rar.exe所在的位置。

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> 

<Target Name="ExtractRar"> 
    <PropertyGroup> 
     <RarExe>$(registry:HKEY_LOCAL_MACHINE\Software\[email protected])</RarExe> 
     <archive>E:\sample.rar</archive> 
     <targetDir>E:\ExtratedArchive\</targetDir> 
    </PropertyGroup> 
    <Exec Command="&quot;$(RarExe)&quot; x &quot;$(archive)&quot; &quot;$(targetDir)&quot;" /> 
</Target> 

</Project> 
+0

@Fernando,如果帕洛回答你的问题,请在他的回答旁边打勾。 – dabuild