chtof / chocolatey-packages

Apache License 2.0
12 stars 36 forks source link

Launchyqt fails to upgrade if it's already open #68

Closed pauby closed 2 years ago

pauby commented 2 years ago

If Launchyqt is running then it will fail to upgrade:

launchyqt v3.1.3 [Approved]
launchyqt package files upgrade completed. Performing other installation steps.
ERROR: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot remove item C:\ProgramData\chocolatey\lib\launchyqt\tools\Launchy-3.1.1-win-x86\skins\Default\spinner.gif: The process cannot access the file 'spinner.gif' because it is being used by another process.
The upgrade of launchyqt was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\launchyqt\tools\chocolateyinstall.ps1'.
 See log for details.

Need to have a chocolateyBedforeModify.ps1 to kill the running launchyqt process.

chtof commented 2 years ago

Corrected, under review.

pauby commented 2 years ago

Thank you for moving so quickly on that!

The code to stop the process should be in the chocolateyBeforeModify.ps1 not in the separate install and uninstall scripts. I also believe the code you used will throw an exception if the process is not running which might cause Chocolatey to fail the install (haven't tested that).