vsSolutionBuildEvent icon indicating copy to clipboard operation
vsSolutionBuildEvent copied to clipboard

7z: relative paths like ..\Dir for input files lead to wrong filename in zip file

Open DrGierth opened this issue 5 years ago • 2 comments

First of all, thank you for this great addin!

Input: grafik

grafik

Output: grafik

grafik

Workaround using $(TargetDir): grafik

grafik

grafik

Thank you in advance for your efforts.

Michael

DrGierth avatar Nov 20 '20 18:11 DrGierth

Hello Michael

I have a similar internal report LC-552 (861) related to missing first letters in file names, for example:

$(dbin = "bin/Release/")
  • ok: $(dbin)raw -> bin/Release/raw
  • missing letters: $(dbin)raw/ -> bin/Release/raw/
  • missing letters: $(dbin)/raw -> bin/Release//raw

This is bug of the SevenZipSharp 3rd party library as far as I remember it. Please check if this is the same issue.

I have the plan to completely replace SevenZipSharp through Conari. But still no time for this task. Not sure about today's SevenZipSharp but any PR are welcomed!

If this is relevant to this issue,

Please temporarily use the following rules for paths.

  • Just avoid any trailing slashes and some incorrect double/triple etc.
  • Try to not use any ..\ in paths at all. You can convert relative path to full like
$([System.IO.Path]::GetFullPath('$(SolutionDir)$(OutDir)'))
  • Also note the difference between \ and / here. That can be also replaced at any time like
$(OutDir.Replace('\', '/'))app.exe

Also note $(OutDir) contains a relative path which by default implicitly starts with $(SolutionDir) in most arguments.

But $(OutDir) can be different because of various project structure in used solutions. That's why $(TargetDir) is more correct way for the cases like yours.

Let me know if you still have the problems or questions. Thanks for using!

3F avatar Nov 23 '20 11:11 3F

Thank you for the fast reply. I can live with the mentioned workaround. Michael

DrGierth avatar Nov 23 '20 11:11 DrGierth