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

(notepadplusplus.install) shim misses the mark #1198

Closed
thendarion opened this issue Jan 16, 2019 · 10 comments
Closed

(notepadplusplus.install) shim misses the mark #1198

thendarion opened this issue Jan 16, 2019 · 10 comments

Comments

@thendarion
Copy link

notepadplusplus.install messes up the install directory, so it creates a shim that points to nowhere.
this doesn't happen on a fresh system but when it has (or maybe previously had?) notepad++ installed.

Expected Behavior

notepadplusplus.install finds the install location of notepad++.exe and creates the shim accordingly

Current Behavior

Installing 32-bit notepadplusplus.install...
notepadplusplus.install has been installed.
VERBOSE: Trying local and machine (x32 & x64) Uninstall keys
VERBOSE: Retrieving all uninstall registry keys
VERBOSE: Found 0 keys, aborting this method
VERBOSE: Trying Program Files with 2 levels depth: C:\Program Files C:\Program Files\*\* C:\Program Files (x86) C:\Program Files (x86)\*\*
VERBOSE: Trying native commands on PATH
VERBOSE: Trying Registry: \SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
VERBOSE: No location found
WARNING: Can't find notepadplusplus.install install location
 ShimGen has successfully created a shim for npp.7.6.2.Installer.x64.exe
 The install of notepadplusplus.install was successful.
  Software installed as 'exe', install location is likely default.

I found this in my registry

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe]
@="C:\\NPP\\notepad++.exe"

so I don't know why Trying Registry: \SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths did not pick it up.

However, the order is wrong.

Trying Program Files with 2 levels depth: C:\Program Files C:\Program Files\*\* C:\Program Files (x86) C:\Program Files (x86)\*\* picks up any leftover Notepad++ folders from previous installations.

Trying native commands on PATH picks up any leftover shims in chocolatey\bin.

Steps to Reproduce (for bugs)

  1. install NPP from a non-chocolatey source to a non-standard folder (like c:\NPP)
  2. install NPP through chocolatey

Context

trying to install NPP where the system has or had NPP already

Your Environment

Chocolatey v0.10.11
notepadplusplus.install 7.6.2

@AdmiringWorm
Copy link
Member

Thank you for opening this issue, as I mentioned on the disqus forum I plan to look into this. (Hopefully sometime this week).

@AdmiringWorm
Copy link
Member

Seems like the changes needed is necessary to be done in the chocolatey-core.extension dependency, as such we'll need to fix it there first before we can update the package.

While changing the order when we're checking the App Path registy settings, it's unlikely we'll change that right now. However, because of the name Notepad++ a fix is needed when checking the uninstall part of the registry, which also is something that will fix the issue you're seeing.

@majkinetor
Copy link
Contributor

After the WARNING, the script exits, so what creates the shim ?

@AdmiringWorm
Copy link
Member

@majkinetor seems like choco itself is creating the shim for the installer.
The script returns before the installer gets removed.

I missed that initially as my focus was really on why the package couldn't find the installation path.

@majkinetor
Copy link
Contributor

Yes looks like a bug in choco.

@AdmiringWorm
Copy link
Member

No, not in choco. The bug is actually in the package.

We are trying to get the install location on line 17,
if there is no install location, the package returns on line 18.
However the code for removing the installers is on line 23 which the script never gets to if the install location isn't found.

There is also the problem with the installation directory not being found though.

@majkinetor
Copy link
Contributor

You are right - the line that deletes the file is usually not at the end of the script but immediately after Install-Chocolatey***.

@majkinetor
Copy link
Contributor

majkinetor commented Oct 22, 2019

install NPP from a non-chocolatey source to a non-standard folder (like c:\NPP)
install NPP through chocolatey

Reviewing this, I don't think this issue deserves more time. I encountered this behavior number of times with other packages too. Pre-existing installations on custom locations can sometimes mess up things. This concrete problem is related to symbols in executable name (#784) and thus is IMO something we can live with, especially as it can't be resolved quickly and benefit is very small.

I think we should close this.

@thendarion
Copy link
Author

yes, it is a very niche issue :D

is it worth providing a workaround for in the documentation?

@majkinetor
Copy link
Contributor

majkinetor commented Oct 22, 2019

Yeah, I will close this and add note in the chocolatey core extension.

In case anybody wants to work on this, feel free to reopen.

Thanks.

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

3 participants