开发者

How to unzip from PostBuildScript in Visual Studio?

I'm trying to unzip a File in my PostBuild Event from Visual Studio, but I get an error (Command 'unzip' ended with Code 50) evertime the command gets executed.

unzip -o "SourceFile.zip" -d "Destinatio开发者_运维知识库nFolder"

If I run this command from a cmd it works fine.

I googled a bit and found out that Code 50 means either Disk full or insufficient rights. But my harddrive has plenty of free space. Also I tried runing VS with Admin rights, but still Code 50.

So? Whats wrong with unzip?

Thx


I also had this problem. It was caused by the fact that my destination folder string ended with an "\". If I remove this final backslash from the name of the destination folder it works fine.


powershell Expand-Archive "sourcepath" -DestinationPath "targetpath"

Ex: powershell Expand-Archive "$(SolutionDir)SomeFolder\Test.zip" -DestinationPath "$(SolutionDir)SomeFolder"


Escape all pathes with quotes to allow spaces inside, e.g. "$(TargetDir)" instead of just $(TargetDir).


I made a rar-File out of that zip and use unrar from the winrarfolder and everything works fine now. (But I'm still interested in the real answer.)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜