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

netbeans corrupts enumeration of the registry #92

Closed
dtgm opened this issue Jan 22, 2016 · 6 comments
Closed

netbeans corrupts enumeration of the registry #92

dtgm opened this issue Jan 22, 2016 · 6 comments

Comments

@dtgm
Copy link
Owner

dtgm commented Jan 22, 2016

NetBeans versions tested and affected: 8.0.2, 8.1

After installing netbeans, attempting to enumerate a key created by netbeans fails.

This is bad because many chocolatey packages enumerate the registry in this way to locate their uninstall routine.

Typical code found in chocolateyUninstall.ps1

Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*',
                         'HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*',
                         'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*') `
                 -ErrorAction:SilentlyContinue `
| Where-Object   {$_.DisplayName -like *FOO*}

Error

Get-ItemProperty : Specified cast is not valid.
At line:1 char:1
+ Get-ItemProperty -Path @('HKLM:\Software\Wow6432Node\Microsoft\Window ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-ItemProperty], InvalidCastException
    + FullyQualifiedErrorId : System.InvalidCastException,Microsoft.PowerShell.Commands.GetItemPropertyCommand
@dtgm dtgm changed the title netbeans 8.0.2 corrupts enumeration of the registry netbeans corrupts enumeration of the registry Jan 22, 2016
@dtgm dtgm added the bug label Jan 22, 2016
@dtgm
Copy link
Owner Author

dtgm commented Jan 22, 2016

@dtgm
Copy link
Owner Author

dtgm commented Jan 22, 2016

System.InvalidCastException

internal posh bug where Get-ItemProperty fails when reading a REG_DWORD value which contains binary data

http://connect.microsoft.com/PowerShell/feedbackdetail/view/801007/get-itemproperty-specified-cast-is-not-valid-error-when-reg-dword-value-has-binary-data

@dtgm
Copy link
Owner Author

dtgm commented Feb 20, 2016

email exchange

rubendijkstra123 2016-01-09 13:28 UTC:

Hello Maintainers of the NetBeans Chocolatey Package. I am a NetBeans user, and would love to use this package the next time I have to install it.
I do however have a few questions:

  • Is it possible for the cinst call to pass a different installation directory to the installer?
  • When do you usually update the packaged NetBeans version? (We're now at NetBeans 8.1 already)

dtgm 2016-02-11 12:24 UTC:

Sorry for the delay.

  1. Currently it is not possible to pass a different installation directory for this package, but could probably easily be added to the package if you'd like to contribute.
  2. Packages I maintain typically get updated within a day of new releases. However this package is currently on hold as there are some issues with Netbeans installer. See netbeans corrupts enumeration of the registry #92 and let me know if you have a solution.

comfreek 2016-02-12 17:01 UTC:

dtgm:
Yeah, I’ve already encountered this nasty PowerShell bug, but haven’t found a solution either. Maybe going low-level and using C# or even WinAPI functions could be workarounds.

rubendijkstra123 2016-02-12 17:49 UTC:

this doesn't seem like an issue with powershell reading a value, but the netbeans jnicall writing a value.
So in the low-level layer is the problem, so i agree that something low level should fix it.
I haven't yet delved into the actual format of the registry, so don't know from the top of my head how to fix it retroactively.

@ComFreek
Copy link

ComFreek commented Nov 13, 2016

I cannot reproduce the problem anymore with the latest version in my repository: https://github.com/ComFreek/chocolatey-packages/tree/4e2580583507921b4a06dc4a7c97737cdf1a538d
@dtgm Could you please verify this? In case it is resolved, I could push an update to Chocolatey.org. I'd like to make sure it works this time because last time co-maintainer 'Fallen' pushed an update, it was rejected with the reason being this open issue.

EDIT: I've made another change, please use the commit version as per the updated URI above.

@tunisiano187
Copy link
Contributor

@gep13 the version of netbeans as changed since this, and i don't think it's still relevant.
The current maintainer is @ComFreek and i've created the PR #570 for this.

Have a nice day

@gep13
Copy link
Collaborator

gep13 commented Oct 27, 2020

@tunisiano187 sounds like a plan!

@gep13 gep13 closed this as completed Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants