Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DrGierth opened this issue Nov 20, 2020 · 2 comments
Labels

Comments

@DrGierth
Copy link

DrGierth commented Nov 20, 2020

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

@3F
Copy link
Owner

3F commented Nov 23, 2020

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 3F added the bug label Nov 23, 2020
@DrGierth
Copy link
Author

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

@3F 3F added this to the 1.15 milestone Dec 15, 2021
@3F 3F removed this from the 1.15 milestone Feb 1, 2022
3F added a commit that referenced this issue Feb 2, 2022
* NEW: Visual Studio 2022 support. SDK17. PR #75

* FIXED: MSBuild Properties not changing according to solution configuration.
         Issue #71

* FIXED: Fixed unexpected plugin deactivation in Visual Studio 2010.

* FIXED: Fixed incorrect format of new generated .sln for CIM.

* CHANGED: Updated the follwoing references:

    * MSBuild 17.0.0 for SDK15 and SDK17 only
      https://www.nuget.org/packages/Microsoft.Build/17.0.0

    * MvsSln 2.6.1
      https://github.com/3F/MvsSln/releases/tag/2.6.1

    * 7z.Libs 21.6.0
      https://github.com/3F/7z.Libs/releases/tag/21.6.0

    * Microsoft.VisualStudio.Interop 17.0.32112.339
      https://www.nuget.org/packages/Microsoft.VisualStudio.Interop/17.0.32112.339

    * NLog 4.7.13
      https://github.com/NLog/NLog/releases/tag/v4.7.13

    * AvalonEdit 6.1.3.50
      https://github.com/icsharpcode/AvalonEdit/releases/tag/v6.1.3

    * System.Runtime.CompilerServices.Unsafe 5.0.0
      https://go.microsoft.com/fwlink/?LinkID=799421

    * Newtonsoft.Json 13.0.1
      https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.1

    * LSender 1.16
      https://github.com/3F/LSender/releases/tag/1.16

* KNOWN: 7z: relative paths like ..\Dir for input files lead to wrong filename in zip file.
         Please follow the temporary solution described here:
         #70

* NOTE: Choose the package that suits your needs:

        *.vsix  - Visual Studio
        *.nupkg - MSBuild
        *.zip   - API, samples, etc.

        GitHub: https://github.com/3F/vsSolutionBuildEvent/releases/tag/1.15
        NuGet:  https://www.nuget.org/packages/vsSolutionBuildEvent/

        * SDK17: Visual Studio 2022+
        * SDK15: Visual Studio 2019, 2017
        * SDK10: Visual Studio 2017, 2015, 2013, 2012, 2010
3F added a commit to 3F/vsCommandEvent that referenced this issue Feb 18, 2022
* NEW: Visual Studio 2022 support. SDK17.
       Related PR 3F/vsSolutionBuildEvent#75

* NEW: Extends events when a file is open from the solution explorer.
       Issue #5

* NEW: Added the ability to disable the CustomIn/CustomOut check.
       You can control parameters through script, for example:
       ```
        #[var v = #[DTE events.LastCommand.CustomOut]]
        ...
        $(v.Split(",")[0].Trim("{}"))
        == "Language":"CSharp"

        $(v.Split(",")[0].Trim("{}").Split(":")[1])
        == "CSharp"
       ```
       Details #7

* NEW: Extra events:
       Scope `@Document`     <- {2555243A-2A69-4335-BAD6-DDE9DFFE90F2}
       Scope `@OutputWindow` <- {600FCA14-172C-42F3-AC91-1BC5F32CF896}
       Scope `@Solution`     <- {AD4AD581-801F-4399-B986-27FE2D308BDD}
       Scope `@Window`       <- {69F5F698-996B-4293-9FE7-4202564FE6E5}
       Scope `@Debugger`     <- {4885535D-A7F9-46AB-A285-8E4D76F4C5B0}

* FIXED: Restored accidentally removed `raise` method in v1.3. Issue #6

* FIXED: MSBuild Properties not changing according to solution configuration.
         Related Issue 3F/vsSolutionBuildEvent#71

* FIXED: Fixed unexpected plugin deactivation in Visual Studio 2010.

* CHANGED: Updated the follwoing references:

    * MSBuild 17.0.0 for SDK15 and SDK17 only
      https://www.nuget.org/packages/Microsoft.Build/17.0.0

    * MvsSln 2.6.1
      https://github.com/3F/MvsSln/releases/tag/2.6.1

    * 7z.Libs 21.7.0
      https://github.com/3F/7z.Libs/releases/tag/21.7.0

    * Microsoft.VisualStudio.Interop 17.0.32112.339
      https://www.nuget.org/packages/Microsoft.VisualStudio.Interop/17.0.32112.339

    * NLog 4.7.13
      https://github.com/NLog/NLog/releases/tag/v4.7.13

    * AvalonEdit 6.1.3.50
      https://github.com/icsharpcode/AvalonEdit/releases/tag/v6.1.3

    * System.Runtime.CompilerServices.Unsafe 5.0.0
      https://go.microsoft.com/fwlink/?LinkID=799421

    * Newtonsoft.Json 13.0.1
      https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.1

    * LSender 1.16
      https://github.com/3F/LSender/releases/tag/1.16

* KNOWN: 7z: relative paths like ..\Dir for input files lead to wrong filename in zip file.
         Please follow the temporary solution described here:
         3F/vsSolutionBuildEvent#70

* NOTE: Choose the package that suits your needs:
        https://github.com/3F/vsSolutionBuildEvent/releases/tag/1.4

        * SDK17: Visual Studio 2022+
        * SDK15: Visual Studio 2019, 2017
        * SDK10: Visual Studio 2017, 2015, 2013, 2012, 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants