Closed EDM115 closed 2 weeks ago
As stated in README, we need a separate logic on different zip structure, which I don't have a clear idea now.
maybe a check like this :
flowchart LR
A{Does the archive have only a single directory inside ?} -- Yes --> B[Do what you already do];
A -- No --> C{Is there at least one .dll file inside ?};
C -- Yes --> D[Extract all the content of the archive in a new directory with the name that the user has chosen];
C -- No --> E[Probably invalid archive, dunno how to process];
I ended up using a completely different approach due to how ZipArchive
structured. You can check it if you're curios.
https://github.com/8LWXpg/ptr/blob/754896eb77628ff1ef82bc3641e1a8e1682385a4/src/util.rs#L122-L152
Description
If an archive containing a PT plugin have a top level folder inside that contains the plugin, it'll work (ex : https://github.com/8LWXpg/PowerToysRun-SSH/releases/download/v1.2.1/SSH-v1.2.1-x64.zip)
However if all the content of the plugin is directly at the root of the archive (ex : https://github.com/GTGalaxi/quick-lookup-ptrun/releases/download/v1.3.3/QuickLookup-v1.3.3.zip), then ptr will not extract the files correctly (one folder too high in the arborescence)
Steps to reproduce
ptr add QuickLookup GTGalaxi/quick-lookup-ptrun
we have this :