Skip to content
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

(alldup)(#2171) Update links and be explicit on binary name #2172

Closed

Conversation

pauby
Copy link
Member

@pauby pauby commented Mar 10, 2023

Description

Ensured links used https, pointed to the English site and removed the licenseUrl link as it is no longer available and refactored code to be more in keeping with the repository and to explicitly specify the embedded binary name.

Motivation and Context

Latest package failed Package Validator and the package did not meet the standards of what we have in this repository now.

How Has this Been Tested?

Tested in Chocolatey Test Environment.

Screenshot (if appropriate, usually isn't needed):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Migrated package (a package has been migrated from another repository)

Checklist:

  • My code follows the code style of this repository.
  • My change requires a change to documentation (this usually means the notes in the description of a package).
  • I have updated the documentation accordingly (this usually means the notes in the description of a package).
  • I have updated the package description and it is less than 4000 characters.
  • All files are up to date with the latest Contributing Guidelines
  • The added/modified package passed install/uninstall in the chocolatey test environment.
  • The changes only affect a single package (not including meta package).

Ensured links used https, pointed to the English site and removed the licenseUrl link as it is no longer available. Package did not uninstall at all and the install script wasn't clear.
@AppVeyorBot
Copy link

✅ Package verification completed without issues. PR is now pending human review

fileType = $fileType
file = Get-Item $toolsPath\*.exe
fileType = 'EXE'
file = Join-Path -Path $toolsPath -ChildPath 'AllDupSetup.exe'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use Join-Path, but rather follow the convention we typically use.

Suggested change
file = Join-Path -Path $toolsPath -ChildPath 'AllDupSetup.exe'
file = "$toolsPath\AllDupSetup.exe"

Then to a search replace in the update.ps1 file similar to how we do it in the calibre package (in case the executable name changes in the future).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? They both do the same thing, and Join-Path is safer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you also indicated below, Join-Path is used in this repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then to a search replace in the update.ps1 file similar to how we do it in the calibre package (in case the executable name changes in the future).

👍 I'll look at that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Join-Path also makes it harder to do a search replace in the update.ps1 file (which we very commonly do).

It also goes against the consistency we have of not using it (unless when necessary).

$installLocation = Get-AppInstallLocation "$packageName*"
if (!$installLocation) { Write-Warning "Can't find $packageName install location"; return }
Write-Host "$packageName installed to '$installLocation'"
Get-ChildItem -Path (Join-Path -Path $toolsPath -ChildPath '*.exe') | ForEach-Object { Remove-Item -Path $_ -ErrorAction SilentlyContinue }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code equivalent to this one is on purpose, it creates an ignore file if for some reason it fails to remove the executable (to prevent it from being shimmed).

It is also very rare that we make use of Join-Path in this repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also very rare that we make use of Join-Path in this repository.

Rare, but not never?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost never. Pretty much the only time we use Join-Path is if the situation requires it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you adding a uninstaller script?

Chocolatey CLI is able to automatically uninstall inno setup installers without the uninstall script.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was so long ago I have no idea, but would likely have been it didn't uninstall for me. I'm not in the habit of adding uninstall scripts where they are not needed.

@{ URL32 = $url; Version = $version }
@{
URL32 = $url
Version = $matches.version
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Version = $matches.version
Version = $Matches.version

We have commonly used an uppercase M when using the Matches variables.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's very strange. $matches is just another variable and variables traditionally start with a lower case character. Why would you need to use an uppercase letter?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need it from a code standpoint. It is for consistency to keep the casing similar to what we use elsewhere.

Copy link
Contributor

@JPRuskin JPRuskin Sep 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On this: $Matches is a variable being defined by PowerShell, so the approach I've generally seen uses that existing casing - similar to guidance around foreach vs ForEach-Object.

@github-actions
Copy link

Dear contributor,

As this PR seems to have been inactive for 30 days after changes or additional information
was requested, I've automatically closed it.
If you feel the changes are still valid, please re-open the PR once all changes or additional information
that was requested has been added.
Thank you for your contribution.

@github-actions github-actions bot closed this May 15, 2023
@pauby pauby reopened this May 15, 2023
@AppVeyorBot
Copy link

✅ Package verification completed without issues. PR is now pending human review

@github-actions
Copy link

Dear contributor,

As this PR seems to have been inactive for 30 days after changes or additional information
was requested, I've automatically closed it.
If you feel the changes are still valid, please re-open the PR once all changes or additional information
that was requested has been added.
Thank you for your contribution.

Copy link

Dear contributor,

As this PR seems to have been inactive for 30 days after changes or additional information
was requested, I've automatically closed it.
If you feel the changes are still valid, please re-open the PR once all changes or additional information
that was requested has been added.
Thank you for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(alldup) Failing Validator due to invalid URL's
4 participants