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

(chocolatey-core.extension) Unescape app name pattern when calling 'Get-UninstallRegistryKey' #1210

Closed
wants to merge 2 commits into from

Conversation

AdmiringWorm
Copy link
Member

@AdmiringWorm AdmiringWorm commented Jan 21, 2019

This is needed in some rare cases when there is an actual
need to use a regex pattern when calling 'Get-AppInstallLocation'.
fixes chocolatey-community/chocolatey-extensions#11

This PR is dependent on the previous PR I opened: #1209

Below is a list of which packages have been tested, both before the change (1.3.3) and after the change (1.3.4). Every package have been tested by installing to a custom directory (when possible), and directory not named the same as what checked for when calling Get-AppInstallLocation

Package Name Version 1.3.3 Version 1.3.4 Notes
7zip.install ✔️ ✔️
activepresenter ✔️ ✔️
autohotkey.install Wrong Wildcard/Regex passed to function, probably won't match anything at all
avidemux Wrong Wildcard/Regex passed to function, only default location will match
cdburnerxp ✔️ Not picked up by parsing registry (expected), and directory can't be changed
clementine ✔️
codeblocks

More to come

This is a compatibility fix to make the function
compatible with Powershell V2. Without this fix
the 'UninstallString'/'InstallLocation' value
will always be null.
…et-UninstallRegistryKey'

This is needed in some rare cases when there is an actual
need to use a regex pattern when calling 'Get-AppInstallLocation'.
fixes #784
@AppVeyorBot
Copy link

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

@majkinetor
Copy link
Contributor

majkinetor commented Jan 21, 2019

I am not sure anymore that is the right path to take here. Its also not certain that current packages work with this change, or I would add this one line change back when it was reported.

Maybe better idea is to execute registry call 2 times, one with re and then with glob if re finds nothing. In this way there is lower probability that existing packages would bug up I think.

Or try this after all checks failed which will definitely work with all existing packages.

@AdmiringWorm
Copy link
Member Author

@majkinetor I did actually test a few packages after applying this change, which all seemed to work as expected.

Having a call to execute the registry several times doesn't really seem right either.

Pretty much the only thing that [registry]::Unescape does is to remove the backslashes \ if they are used (which, the only package I've seen that uses them is Notepad++), so it shouldn't make much of a different elsewhere.

But I can do some more testing to make sure.

@stale
Copy link

stale bot commented Jun 23, 2019

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Jul 23, 2019

Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you still feel this is a valid issue, please feel free to re-open the issue. Thank you for your contribution.

@stale stale bot closed this Jul 23, 2019
@majkinetor majkinetor closed this Jul 26, 2019
@AdmiringWorm AdmiringWorm deleted the unescape-pattern branch March 21, 2022 15:14
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.

(chocolatey-core.extension) regex pattern vs wildcard pattern usage in Get-AppInstallLocation
3 participants