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

Handle "strg + c" during installation are no trapped #3338

Closed
5 tasks done
timmjd opened this issue Sep 29, 2023 · 1 comment
Closed
5 tasks done

Handle "strg + c" during installation are no trapped #3338

timmjd opened this issue Sep 29, 2023 · 1 comment

Comments

@timmjd
Copy link

timmjd commented Sep 29, 2023

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

If a user does install a package choco install whatever and during the installation presses strg + c, the current chocolateyInstall.ps1 gets aborted. Sadly the overall installation gets not aborted, it seems only the context of the chocolateyInstall.ps1 is stopped but the Chocolatey core continues it's logic. As a result, the package will be listed as installed package - even so we stopped the actual installation and the package gets not finished.

To work aground this, we would need to react on the strg + c event and manually set the install state to failed (Set-PowerShellExitCode).

There might be a global way to solve this by registering a trap for this to be implemented inside the Chocolatey core where the chocolateyInstall.ps1 etc. scripts gets called and bypassing the state change from uninstalled to installed - so as a result aborting the installation with strg + c will not result in an installed package.

What is Expected?

If I abort the installed by strg + c and the package instalaltion was not finished, the package installation should be aborted or as a result, the package should be in state of not installed.

How Did You Get This To Happen?

  1. choco install whatever
  2. Hit strg + c to interrupte the installer
  3. Type choco list and you will see that whatever was installed successfully

System Details

  • Operating System: Windows 11
  • Windows PowerShell version: 5.1
  • Chocolatey CLI Version: 2.2.2
  • Chocolatey Licensed Extension version: -
  • Chocolatey License type: -
  • Terminal/Emulator: cmd / powershell

Installed Packages

-

Output Log

-

Additional Context

No response

@timmjd timmjd added the Bug label Sep 29, 2023
@pauby
Copy link
Member

pauby commented Sep 29, 2023

This is a duplicate of #619

@pauby pauby closed this as not planned Won't fix, can't repro, duplicate, stale Sep 29, 2023
@pauby pauby added Duplicate Issue and removed Bug labels Sep 29, 2023
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

2 participants