You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chocolateybeforemodify.ps1 runs after backing up Chocolatey lib files, causing some unnecessary errors to occur when files are open. Changing it to run before the backup of the files will prevent this
example package: torchat
So I decided to do my first package utilizing chocolateybeforemodify.ps1 (Which I think is a great idea, but a non-intuitive filename.)
I moved my Stop-Process -processname stuff into chocolateybeforemodify.ps1 and my chocolateyuninstall.ps1 only has some Remove-Item commands to delete shortcuts.
It didn't make a difference; the directory still tried to be removed before chocolateybeforemodify.ps1 ran.
Here's the results:
C:\ChocolateyPackages\torchat>choco uninstall torchat Chocolatey v0.10.2
Uninstalling the following packages:
torchat
This is try 1/3. Retrying after 300 milliseconds. <- this is because the program EXE is still running.
Error converted to warning:
(5) Access is denied: [?\C:\ProgramData\chocolatey\lib-bkp\torchat]
This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:
(5) Access is denied: [?\C:\ProgramData\chocolatey\lib-bkp\torchat]
Maximum tries of 3 reached. Throwing error.
This is try 1/3. Retrying after 300 milliseconds.
Error converted to warning:
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
Maximum tries of 3 reached. Throwing error.
Error during backup (move phase):
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
There was an error accessing files. This could mean there is a
process locking the folder or files. Please make sure nothing is
running that would lock the files or folders in this directory prior
to upgrade. If the package fails to upgrade, this is likely the cause.
torchat v0.9.9.553 <- start of chocolateybeforemodify.ps1
Stopping tor process...
Stopping torchat process...
Skipping auto uninstaller - No registry snapshot. <- start of chocolateyuninstall.ps1
torchat has been successfully uninstalled.
Chocolatey uninstalled 1/1 packages. 0 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The text was updated successfully, but these errors were encountered:
For upgrades and uninstalls, there was an attempt to run other
operations ahead of the beforeModify script, which included removing a
rollback directory that may have been locking files for a service.
Instead ensure that before modify is the first physcial operation
attempted prior to upgrades and uninstall actions.
For uninstalls, ensure that the before modify action is passed through
as part of the actions to take prior to uninstall instead of waiting
for the regular means to come back to handle_package_uninstall.
linkback: https://groups.google.com/forum/#!topic/chocolatey/mrVxXzgyi2Y
chocolateybeforemodify.ps1 runs after backing up Chocolatey lib files, causing some unnecessary errors to occur when files are open. Changing it to run before the backup of the files will prevent this
example package: torchat
So I decided to do my first package utilizing chocolateybeforemodify.ps1 (Which I think is a great idea, but a non-intuitive filename.)
I moved my Stop-Process -processname stuff into chocolateybeforemodify.ps1 and my chocolateyuninstall.ps1 only has some Remove-Item commands to delete shortcuts.
It didn't make a difference; the directory still tried to be removed before chocolateybeforemodify.ps1 ran.
Here's the results:
C:\ChocolateyPackages\torchat>choco uninstall torchat
Chocolatey v0.10.2
Uninstalling the following packages:
torchat
This is try 1/3. Retrying after 300 milliseconds. <- this is because the program EXE is still running.
Error converted to warning:
(5) Access is denied: [?\C:\ProgramData\chocolatey\lib-bkp\torchat]
This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:
(5) Access is denied: [?\C:\ProgramData\chocolatey\lib-bkp\torchat]
Maximum tries of 3 reached. Throwing error.
This is try 1/3. Retrying after 300 milliseconds.
Error converted to warning:
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
This is try 2/3. Retrying after 400 milliseconds.
Error converted to warning:
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
Maximum tries of 3 reached. Throwing error.
Error during backup (move phase):
(32) The process cannot access the file because it is being used by another process: [?\C:\ProgramData\chocolatey\lib-bkp\torchat\tools\bin\torchat.exe]
There was an error accessing files. This could mean there is a
process locking the folder or files. Please make sure nothing is
running that would lock the files or folders in this directory prior
to upgrade. If the package fails to upgrade, this is likely the cause.
torchat v0.9.9.553 <- start of chocolateybeforemodify.ps1
Stopping tor process...
Stopping torchat process...
Skipping auto uninstaller - No registry snapshot. <- start of chocolateyuninstall.ps1
torchat has been successfully uninstalled.
Chocolatey uninstalled 1/1 packages. 0 packages failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The text was updated successfully, but these errors were encountered: