-
Notifications
You must be signed in to change notification settings - Fork 0
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
Url checking #148
Url checking #148
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
Selection: 2
[Required] Enter the Package Identifier, in the following format <Publisher shortname.Application shortname>. For example: Microsoft.Excel
PackageIdentifier: Paessler.PRTGDesktop
[Required] Enter the version. for example: 1.33.7
Version: 22.1.0
Found Existing Version: 21.12.0
Installer Entry #1:
Architecture: x64
InstallerType: wix
Scope: machine
[Required] Enter the download url to the installer.
Url: https://downloads.paessler.com/prtg_desktop/22.1.0/64bit/PRTG_Desktop_Full_Installer.msi
The URL provided appears to be redirected. Would you like to use the destination URL instead?
Discovered URL:
[Y] Use detected URL
[N] Use original URL
Enter Choice (default is 'Y'): y
[Warning] URL Changed - The URL was changed during processing and will be re-validated
Test-Url: C:\Users\Esco\GitHub\winget-pkgs\Tools\YamlCreate.ps1:328
Line |
328 | if ((Test-Url $NewInstallerUrl) -ne 200) {
| ~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'URL' because it is an empty string.
[Error] Internal Error - Value was not able to be saved successfully
Wut. Thats weird. I'll dig deeper |
I can't reproduce @OfficialEsco's issue. whereas it works as expected...I'm using: 🚀 $PSVersionTable
Name Value
---- -----
PSVersion 5.1.22538.1000
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22538.1000
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1 |
I'm not able to either. @OfficialEsco - What version of PowerShell are you using?
Using quick update -
|
|
Aha. Powershell improved their resource handling when they went to v7. In v5 it doesn't dispose of the resource immediately when you close it but it does in v7. Should be fixed in latest commit |
There needs to be a space between these lines
And there should not be a delay after you press y/n, if you for example paste a url it will throw a error |
A easy workaround for this would probably be to implement the Also Sourceforge redirects are a problem
HOWEVER, we cannot detect the ProductCode when its a redirect 🤔 Edit2:
|
I don't think I can fix the delay here, because that is where it is checking if the URL is valid, and depending on the mode you're running in, downloading and checking the application productcode etc.. What exactly do you mean by pasting a url throwing an error?
Possibly, I'm not sure what the exact error you're seeing is though
I would argue these aren't a problem, since the second url is more accurate for installer type and will ultimately be faster because it skips all the redirects |
We want it to choose the best location for the person downloading so its fast for everyone
Actually, i remember the issue now, it was because i pressed Enter, it then threw a error saying the NewInstallerUrl is empty which is understandable |
That is a good point; I didn't realize they redirected dynamically. I don't know which is more valuable, the product code or the dynamic cdn. I would think that almost all of their network url's would be fast enough for most places in the world. It isn't the most optimal to use a fixed url for sourceforge, but I think it is probably the better route |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
708dd1c
to
e550cef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok so, this is approvable, and @vedantmgoyal2009 needs to have a json switch for this UseRedirectedURL: yay/nay
However i'm still not 100% satisfied with how this feels to use #148 (comment)
When you press Y
its okay because you have a Write-Host, but when you press N
you're left wondering if it does anything
I'll take a look at updating the user experience flow here; Hope to have a new commit in ~20 mins |
@OfficialEsco Updated with some messaging to be more clear |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok the feedback feels goood
* Prompt user to use direct URL * Formatting * Fix: PS7 Resource Delegation * Ignore github for url checking * Add messaging for User Experience * Fix bug where URI could contain invalid characters
* Prompt user to use direct URL * Formatting * Fix: PS7 Resource Delegation * Ignore github for url checking * Add messaging for User Experience * Fix bug where URI could contain invalid characters
* Url checking (Trenly#148) * Prompt user to use direct URL * Formatting * Fix: PS7 Resource Delegation * Ignore github for url checking * Add messaging for User Experience * Fix bug where URI could contain invalid characters * Match WIX logic to wingetcreate (Trenly#152) * Fix: Don't retain SignatureSha256 between installers * Culture sorting (Trenly#157) * Set culture of current thread while running * Fix Null Value
@OfficialEsco @jedieaston
I've been seeing a few PRs where the URL is redirected. This adds a prompt and a setting to replace URLs which are redirected.
@vedantmgoyal2009 - This might help with your automation, if there is a vanity URL to the latest but it just redirects to a package specific URL
Example if you need one to test with -