-
Notifications
You must be signed in to change notification settings - Fork 33
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
WinGUP causes download failure by using plugin download URL to generate file name to store downloaded file #9
Comments
In the meanwhile I found another plugin that can not be downloaded due to this issue, the Poor Man's T-Sql Formatter plugin. Its download link is
Again, there is a question mark that causes the download to fail because the local destination file can not be created. |
Hi - Poor Man's T-Sql Formatter dev here - without understanding the mechanism of the failure, I posted a thread on this in the community forums: https://notepad-plus-plus.org/community/topic/16940/gup-exe-crashes-on-some-zip-files-and-http-hosts. @dinkumoil helpfully pointed me here. It's worth noting that I've added a new official download location for the Poor Man's T-Sql Formatter plugin, in a GitHub release (https://github.com/TaoK/PoorMansTSqlFormatter/releases/tag/1.6.10), so this is no longer a blocker for this particular plugin. It can still easily be a significant cause of frustration for other plugin devs who spend a bunch of time debugging why their plugin won't install. Unfortunately, GUP.exe's UI-less crash here is particularly unhelpful. |
I just ran into the same problem with the PreviewHTML plugin, because I need query string parameters on the download URL. The Appveyor PR commit check doesn't complain, because it’s a perfectly valid URL. Is there any reason to actually use the URL as basis for the downloaded file? Since it's going to be unzipped anyway, I would expect that a random temporary file name would work just as well (if not better). Alternatively, if the URL-as-basis-for-the-filename is wanted, I suggest chopping off the part after the question mark, at the very least. And always check the resulting file name for invalid characters. Also, reporting the failure somewhere would be nice, too. |
Description
According to this list the plugin Kstudio.MaxscriptExplorer has a download issues with WinGup v5.0.4.
I have debugged this issue and found that WinGup uses the file name part of the plugin download URL to generate the file name used to store the downloaded file. Additionally, if the file name doesn't end with .zip this string gets appended.
In case of Kstudio.MaxscriptExplorer this leads to an illegal file name since the download URL of this plugin is
https://3d-kstudio.com/download-manager.php?id=112
, thus the resulting file name gets set to%TEMP%\download-manager.php?id=112.zip
.The contained question mark is an illegal character for filesystem objects, thus the download fails because the file can not be stored.
Possible solutions
WinGup should test the generated file name for illegal characters and remove them.
The text was updated successfully, but these errors were encountered: