notepad-plus-plus / wingup

WinGup - Generic Updater for Windows
http://wingup.org/
GNU Lesser General Public License v3.0
47 stars 31 forks source link

Unzip with size 0 #7

Closed chcg closed 5 years ago

chcg commented 5 years ago

See https://github.com/notepad-plus-plus/nppPluginList/pull/11 and https://notepad-plus-plus.org/community/topic/16642/npp-snippets-plug-in-and-plug-in-manager

Some files are unzipped with size 0.

donho commented 5 years ago

https://github.com/notepad-plus-plus/wingup/commit/a4f12fd8cd0ca6eb6e44594b08ef6c9e2665a72e

dinkumoil commented 5 years ago

@donho

I have no good news. I wrote a script to automatically test downloading and unzipping all plugins which are part of the latest version of the plugin list. I have used a self compiled debug build of latest GUP.exe since the download link you provided somewhere doesn't work.

I found issues with the plugins listed below. During unzipping the ZIP packages of the first three ones the following error message is shown:

Can't unzip: Operation not permitted or decompression failed

With the TagsView plugin it's even worse. No error message was shown but it wasn't unzipped correctly, some files haven't been unpacked.

There may be more bugs I havn't discovered yet. The one regarding TagsView plugin I found when I searched for 0 byte files.

Pork2Sausage

Complete directory structure of ZIP file:

|
|   license.txt
|   pork2sausage.dll
|   readmetxt
|   
+---Config
|       pork2Sausage.ini
|       
\---demo
    \---zip.base64
            commons-codec-1.4.jar
            readme.txt
            zipB64.java

Unzipping stops after creating the following structure:

|
|    Config      <-- These should be directories
|    demo        <-- but they are created as files

NppCalc

Complete directory structure of ZIP file:

|
|   NppCalc.dll
|   
\---doc
    \---NppCalc
            HelpNppCalcEn_1.5.txt
            HelpNppCalcRu_1.5.txt

Unzipping stops after creating the following structure:

|
|    doc      <-- This should be a directory but it is created as a file

CSScriptNpp

Complete directory structure of ZIP file:

|
|   CSScriptNpp.dll
|   
\---CSScriptNpp
    |   CompatibilityTest.exe
    |   cscs.exe
    |   cscs.v3.5.exe
    |   CSScriptIntellisense.dll
    |   CSScriptLibrary.dll
    |   CSScriptLibrary.xml
    |   CSScriptNpp.asm.dll
    |   CSSRoslynProvider.dll
    |   css_dbg.exe
    |   css_dbg.pdb
    |   csws.exe
    |   ICSharpCode.NRefactory.CSharp.dll
    |   ICSharpCode.NRefactory.dll
    |   Intellisense.Common.dll
    |   launcher.exe
    |   Mono.Cecil.dll
    |   npp_jit.exe
    |   nuget.exe
    |   syntaxer.exe
    |   Updater.exe
    |   
    \---Mdbg
            corapi.dll
            DbgAgent.dll
            enc.dll
            mdbg.exe
            mdbgeng.dll
            mdbgext.dll
            mdbghost_32.exe
            mdbghost_64.exe
            NativeDebugWrappers.dll
            npp.dll
            raw.dll

Unzipping stops after creating the following structure:

|   
|    CSScriptNpp          <-- This should be a directory but it is created as a file
|    CSScriptNpp.dll

TagsView

Complete directory structure of ZIP file:

|
|   TagsView.dll
|   
+---doc
|       TagsView.txt
|       
\---TagsView
        COPYING
        ctags.exe
        ctags.html
        ctags.opt
        EXTENDING.html
        README

Unzipping produced the following structure:

|
|   TagsView            <-- This should be a directory but it is created as a file.
|   TagsView.dll
|   
\---doc
        TagsView.txt
donho commented 5 years ago

@dinkumoil Thank you very much for catching all these error. I do believe it's fixed in this binary (tested with all the not working plugins mentioned above): https://notepad-plus-plus.org/temp/GUP_NEW3.zip

However, due to the unreliable of unzip core component, the directory (leaf) can still be treated as a file, and there's no way to fix it.

donho commented 5 years ago

Please reopen it if it's not fixed totally by; https://github.com/notepad-plus-plus/wingup/commit/dfbc2ad37abe67e0db6844e54d56bf0e423b1f26

dinkumoil commented 5 years ago

@donho It works!

I ran my test script and GUP.exe downloaded and unzipped all plugins.

My test script does the same using CURL.exe for downloading and Windows Explorer OLE automation object for unzipping. With a directory comparison using BeyondCompare I was able to verify that the output of GUP.exe and of my own routines is identical.

Thank you for your hard work!

donho commented 5 years ago

@dinkumoil Thank you for your help!