lens icon indicating copy to clipboard operation
lens copied to clipboard

Unable to install or uninstall Lens on Windows

Open craph opened this issue 1 year ago • 21 comments

Describe the bug I'm unable to install latest version of Lens

To Reproduce Steps to reproduce the behavior:

  1. Download the latest version from the official website for windows
  2. Double click to install it.

Expected behavior I must be able to install Lens

Screenshots image

Environment (please complete the following information):

  • Lens Version: 5.5.4-latest.20220609.2
  • OS: Windows 10 pro
  • Installation method (e.g. snap or AppImage in Linux): .exe

craph avatar Jul 25 '22 12:07 craph

First I try to update from a previous version it was impossible. So I uninstall the old one and try to install the latest one but it doesn't work

craph avatar Jul 25 '22 13:07 craph

it doesn't work

Do you mean that installing the new version fails after manually uninstalling the previous version?

From the screenshot it seems like there is a running instance of Lens somewhere. Are you installing for single user or for all users?

Nokel81 avatar Jul 25 '22 13:07 Nokel81

Yes, I run the uninstall script from C:\users\{username}\AppData\Local\Programs\Lens after that I restarted my laptop and I have clear all the related folder of Lens in roaming folder too. Then I ran the latest installer and I choose the option single user.

craph avatar Jul 25 '22 13:07 craph

how the installer is checking if Lens is running or not ?

craph avatar Jul 25 '22 13:07 craph

If I change the directory name where Lens is installed the installation works. (I have rename Lens to Lens2 for the directory)

BUT after that if I try to uninstall it again I can't and the uninstaller says : "Lens cannot be closed. Please close it manually and click Retry to continue" image image image

craph avatar Jul 25 '22 14:07 craph

That sounds like the tray icon is still running. Did you run Lens between the installing and uninstalling in the new location?

Nokel81 avatar Jul 25 '22 15:07 Nokel81

That sounds like the tray icon is still running. Did you run Lens between the installing and uninstalling in the new location?

Yes I just launched it after the installation. And I closed it just after. I can't see any process running on the machine and I'm unable to uninstall it. I can't see any tray icon running

Where is the code of the installer / uninstaller ? to check what is it looking for

craph avatar Jul 25 '22 15:07 craph

@Nokel81, @aleksfront Can you tell me what the installer / uninstaller does to check if Lens is running or not ? Even if with admin right I'm unable to uninstall it

Is it possible that it's an issue with the nsis uninstaller ? or maybe due to Crowdstrike that block something ?

craph avatar Jul 26 '22 05:07 craph

@Nokel81 is it possible to have any advice / help about this ?

craph avatar Jul 26 '22 13:07 craph

What is Crowdstrike?

I cannot reproduce this on my windows machine, even if I leave Lens running the "OK" button on the "Lens is still running. Click OK to close" dialogue works and the uninstall process continues and succeeds.

Nokel81 avatar Jul 26 '22 13:07 Nokel81

Crowdstrike is an EDR I'am unable to install or uninstall Lens. How should I proceed ? It looks like Crowdstrike doesn't like NSIS binary : https://www.crowdstrike.com/blog/blurring-of-commodity-and-targeted-attack-malware/ And in the NSIS site we can see that Crowdstrike is listed. https://nsis.sourceforge.io/NSIS_False_Positives

I think you should sign your application to possibly avoid false positive. Or may be not use nsis and switch to msi for the Windows packaging and sign the application too.

craph avatar Jul 26 '22 14:07 craph

I encountered this when trying to install Lens 6.0.0 alpha version (for any user) on top of Lens 5.5.4 (for any user). I had to manually uninstall Lens 5.5.4 first (using uninstaller in C:\Program Files\Lens) @craph did you check there also in case you had previously installed Lens for any user?

jim-docker avatar Jul 26 '22 16:07 jim-docker

I encountered this when trying to install Lens 6.0.0 alpha version (for any user) on top of Lens 5.5.4 (for any user). I had to manually uninstall Lens 5.5.4 first (using uninstaller in C:\Program Files\Lens) @craph did you check there also in case you had previously installed Lens for any user?

Hello @jim-docker I have only installed Lens for my user. And in C:\Program Files I don't have any folder called Lens

I can install and uninstall correctly the version 4.2.4 (old version I found on my laptop) But now with the latest version I'm unable to uninstall it

craph avatar Jul 26 '22 16:07 craph

I tried to remove all the files and registry keys about Lens manually to try to reinstall it just after and it's the same problem. It always says that Lens is running and should be closed first but it can't close it successfully. image

craph avatar Jul 26 '22 18:07 craph

It looks like my issue is like this : https://github.com/electron-userland/electron-builder/issues/6865

craph avatar Jul 27 '22 05:07 craph

I also tried to build it locally from the source of version 5.5.4 but I have this error when I run npm run build:win :

npm run build:win

> [email protected] build:win
> yarn run compile && electron-builder --win --dir

yarn run v1.22.19
$ env NODE_ENV=production concurrently yarn:compile:*
ERROR env: CreateProcessA
Done in 0.13s.
  • electron-builder  version=23.0.3 os=10.0.19042
  • loaded configuration  file=package.json ("build" field)
  • writing effective config  file=dist\builder-effective-config.yaml
  • rebuilding native dependencies  [email protected] platform=win32 arch=x64
  • packaging       platform=win32 arch=x64 electron=14.2.9 appOutDir=dist\win-unpacked
  • file source doesn't exist  from=C:\Users\myuser\Downloads\lens-5.5.4\locales
  • file source doesn't exist  from=C:\Users\myuser\Downloads\lens-5.5.4\binaries\client\windows\x64\kubectl.exe
  • file source doesn't exist  from=C:\Users\myuser\Downloads\lens-5.5.4\binaries\client\windows\x64\lens-k8s-proxy.exe
  • file source doesn't exist  from=C:\Users\myuser\Downloads\lens-5.5.4\binaries\client\windows\x64\helm.exe
  ⨯ Application entry file "static\build\main.js" in the "C:\Users\myuser\Downloads\lens-5.5.4\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration.  failedTask=build stackTrace=Error: Application entry file "static\build\main.js" in the "C:\Users\myuser\Downloads\lens-5.5.4\dist\win-unpacked\resources\app.asar" does not exist. Seems like a wrong configuration.
    at error (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:7:12)
    at Object.checkFileInArchive (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:31:11)
    at WinPackager.checkFileInPackage (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\platformPackager.ts:503:7)
    at WinPackager.sanityCheckPackage (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\platformPackager.ts:551:5)
    at WinPackager.doPack (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\platformPackager.ts:312:5)
    at WinPackager.pack (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\platformPackager.ts:136:5)
    at Packager.doBuild (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\packager.ts:441:9)
    at Object.executeFinally (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\builder-util\src\promise.ts:12:14)
    at Packager._build (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\packager.ts:376:31)
    at Packager.build (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\app-builder-lib\src\packager.ts:337:12)
    at Object.executeFinally (C:\Users\myuser\Downloads\lens-5.5.4\node_modules\builder-util\src\promise.ts:12:14)

craph avatar Jul 27 '22 08:07 craph

I tried to remove all the files and registry keys about Lens manually to try to reinstall it just after and it's the same problem. It always says that Lens is running and should be closed first but it can't close it successfully. image

If I ran process monitor at the same time, I can see cmd.exe spawn like this :

tasklist /FI "USERNAME eq %USERNAME%" /FI "IMAGENAME eq Lens.exe" | find "Lens.exe"

In process monitor I can see the command is success. If I run it manually the command return nothing. And if I click ok to close Lens it runs

taskkill /im "Lens.exe" /fi "PID ne 13124" /fi "USERNAME eq %USERNAME%"

I have no idea why the installer tells me that Lens is running.

craph avatar Jul 27 '22 09:07 craph

@jim-docker , @Nokel81 This is really weird, I finally installed Lens by selecting install for Anyone who uses this computer (all users) and after that, if I try to uninstall it from the control panel it doesn't work and it's the same if I try from C:\Program Files\Lens... I don't know how to do ? :( image

craph avatar Jul 27 '22 11:07 craph

It looks like my issue is like this : electron-userland/electron-builder#6865

You may be right here. Do you have another process running with Lens in its name? I may have had OpenLens running when I encountered this issue. There was also this comment on that issue:

Interestingly if right clicking on the .exe installer and selecting Run as administrator this issue does not come up. So not sure if this is a signing issue? I do not currently have any signing implemented for windows, but will try this.

Did you try install/uninstall running as admin?

jim-docker avatar Jul 27 '22 13:07 jim-docker

@jim-docker I have nothing running with Lens in its name. And I also tried to install/uninstall with admin rights. It's the same... Nothing works 😢 as I said previously with an old installer everything works fine (version 4.2.4)

craph avatar Jul 27 '22 13:07 craph

@jim-docker , @Nokel81 I just found a workaround to uninstall correctly the latest version 5.5.4 and this confirm that there are an issue with electron-builder and nsis. I have installed "only for my user" the version 4.2.4 of Lens. And then I run the unintaller of the version 4.2.4. In the uninstaller Window, I choose the option to uninstall Lens for all users (because the version 5.5.4 was installed for all users of my machine) this option refers to C:\Program Files\Lens and the uninstall process works correctly.

I think you have to check the version and fixes of electron-builder / nsis version to check if there are some issue with antivirus or EDR tools like Crowdstrike

craph avatar Jul 27 '22 15:07 craph

Closing because we are now using the updated version of electron-builder

Nokel81 avatar Aug 05 '22 13:08 Nokel81