Community
    • Login

    Wanted: 7-zip API Guru

    Scheduled Pinned Locked Moved General Discussion
    11 Posts 5 Posters 6.6k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • donhoD Offline
      donho
      last edited by donho

      The zip decompressor that Notepad++ is using for Plugins Admin has a quite critical bug. So Notepad++ needs a more reliable decompress component for that.

      7zip could be a solution to the project, and it has great advantages because 1. it’s well tested. 2. it contains the better ratio compression algorithm which allow Notepad++ (plugin) community use 7z format.

      I have check LZMA SDK in the official site here: https://www.7-zip.org/sdk.html
      However I didn’t find the way/tutorial to integrate their source code into Notepad++. So if you have had 7zip integrate experience, please point me to a tutorial link or provide me a concrete example. Thank you.

      Eko palypseE 1 Reply Last reply Reply Quote 0
      • rinku singhR Offline
        rinku singh
        last edited by

        https://sourceforge.net/projects/sevenzip/files/

        1 Reply Last reply Reply Quote -3
        • Eko palypseE Offline
          Eko palypse @donho
          last edited by Eko palypse

          @donho

          not a 7-zip API Guru but maybe this C++ wrapper is useful for you.

          Eko

          1 Reply Last reply Reply Quote 0
          • dinkumoilD Offline
            dinkumoil
            last edited by dinkumoil

            @donho

            I have created a Gist with a small demo program written in C++ (actually it’s very C-ish ;-) ). It uses the Windows Explorer OLE automation object for unzipping. It mimics the following VBScript code:

            With CreateObject("Shell.Application")
              .Namespace("E:\Dst").CopyHere .Namespace("E:\Src\AZipFile.zip").Items, &H0614
            
              Do Until .Namespace("E:\Dst").Items.Count = .Namespace("E:\Src\AZipFile.zip").Items.Count
                WScript.Sleep 500
              Loop
            End With
            

            It’s 300 lines of code, comments and whitepace. I bet if you use 7Zip it will be not much less.

            Please also read the comment under the Gist.

            1 Reply Last reply Reply Quote 4
            • dinkumoilD Offline
              dinkumoil
              last edited by

              @donho

              Forgot to mention: The above script and, of course, the program from my Gist can extract recursively the whole content of a ZIP file, including all subfolders.

              donhoD 1 Reply Last reply Reply Quote 0
              • chcgC Offline
                chcg
                last edited by

                @donho See https://github.com/notepad-plus-plus/wingup/tree/master/src/ZipLib/extlibs/lzma. 7z is already there, but don’t know if this issues observed with ziplib are caused by the ziplib itself or the usage of it. At least the part from https://github.com/notepad-plus-plus/wingup/pull/8 I would see as user issue or as missing feature to unzip the complete content of a zip file by just one api call.
                As already said at github I would avoid switching the file format from zip to 7z only without a real functional gain apart from some less Kbytes nowadays with high bandwidth internet access.

                1 Reply Last reply Reply Quote 4
                • dinkumoilD Offline
                  dinkumoil
                  last edited by

                  @chcg said:

                  I would avoid switching the file format from zip to 7z only without a real functional gain apart from some less Kbytes nowadays with high bandwidth internet access.

                  I fully agree.

                  @donho

                  Please do not switch away from the ZIP format! That’s simply not necessary.

                  1 Reply Last reply Reply Quote 1
                  • donhoD Offline
                    donho @dinkumoil
                    last edited by donho

                    @dinkumoil

                    I believe the unzip bug in WinGup has been fixed (no more zero length unzipped file) :
                    https://notepad-plus-plus.org/temp/GUP_new.zip

                    Could you confirm me if it’s fixed?

                    1 Reply Last reply Reply Quote 1
                    • dinkumoilD Offline
                      dinkumoil
                      last edited by

                      @donho

                      The result of my tests is, that I didn’t find 0 byte files but a plugin package that could not be unzipped. The same ZIP file can be extracted with 7-ZIP and Windows Explorer without any problems.

                      1 Reply Last reply Reply Quote 3
                      • dinkumoilD Offline
                        dinkumoil
                        last edited by

                        @donho

                        Unfortunately your last fix of Gup.exe didn’t help. Now we have other bugs. See the results of my test.

                        1 Reply Last reply Reply Quote 1
                        • dinkumoilD Offline
                          dinkumoil
                          last edited by

                          @donho

                          Your latest fix did it! Thank you and happy holidays.

                          1 Reply Last reply Reply Quote 1

                          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                          With your input, this post could be even better 💗

                          Register Login
                          • First post
                            Last post
                          The Community of users of the Notepad++ text editor.
                          Powered by NodeBB | Contributors