Skip to content

Commit

Permalink
Stop GoToWindow before upgrading
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrondeau committed May 17, 2017
1 parent 5da43f2 commit d89373a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Binary file added TODO.md
Binary file not shown.
17 changes: 9 additions & 8 deletions chocolatey/tools/chocolateybeforemodify.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# This runs in 0.9.10+ before upgrade and uninstall.
# Use this file to do things like stop services prior to upgrade or uninstall.
# NOTE: It is an anti-pattern to call chocolateyUninstall.ps1 from here. If you
# need to uninstall an MSI prior to upgrade, put the functionality in this
# file without calling the uninstall script. Make it idempotent in the
# uninstall script so that it doesn't fail when it is already uninstalled.
# NOTE: For upgrades - like the uninstall script, this script always runs from
# the currently installed version, not from the new upgraded package version.
$Running = Get-Process GoToWindow -ErrorAction SilentlyContinue

if ($Running)
{
Write-Host "Stopping GoToWindow running instances."
foreach($Process in $Running)
{
Stop-Process $Process
}
}

0 comments on commit d89373a

Please sign in to comment.