getaimeter 0.7.6 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/tray.ps1 +12 -1
package/package.json
CHANGED
package/tray.ps1
CHANGED
|
@@ -122,7 +122,18 @@ $checkUpdateItem.Add_Click({
|
|
|
122
122
|
[System.Windows.Forms.MessageBoxIcon]::Information
|
|
123
123
|
)
|
|
124
124
|
if ($result -eq [System.Windows.Forms.DialogResult]::Yes) {
|
|
125
|
-
|
|
125
|
+
# Update and auto-restart: stop watcher, update npm, restart watcher
|
|
126
|
+
$nodePath = (Get-Command node -ErrorAction SilentlyContinue).Source
|
|
127
|
+
$aimeter = (Get-Command aimeter -ErrorAction SilentlyContinue).Source
|
|
128
|
+
Start-Process "cmd.exe" -ArgumentList "/k echo Updating AIMeter... && npm install -g getaimeter@latest && echo. && echo Restarting watcher... && aimeter stop && timeout /t 2 /nobreak >nul && aimeter start && echo. && echo Updated to latest version! This window can be closed. && echo."
|
|
129
|
+
|
|
130
|
+
# Give the cmd window time to stop us, then exit this tray
|
|
131
|
+
Start-Sleep -Seconds 3
|
|
132
|
+
$tray.Visible = $false
|
|
133
|
+
$tray.Dispose()
|
|
134
|
+
$mutex.ReleaseMutex()
|
|
135
|
+
$mutex.Dispose()
|
|
136
|
+
[System.Windows.Forms.Application]::Exit()
|
|
126
137
|
}
|
|
127
138
|
} else {
|
|
128
139
|
[System.Windows.Forms.MessageBox]::Show(
|