2013-09-25 23 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