27 lines
729 B
Go
27 lines
729 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"softbox.local/app-win7/platform/windows"
|
|
"softbox.local/core/updater"
|
|
)
|
|
|
|
func acknowledgeInternalUpdateHealth(arguments []string) (bool, error) {
|
|
if len(arguments) == 0 || arguments[0] != updater.InternalHealthFlag {
|
|
return false, nil
|
|
}
|
|
if len(arguments) != 2 {
|
|
return true, fmt.Errorf("%s requires exactly one internal request ID", updater.InternalHealthFlag)
|
|
}
|
|
executable, err := os.Executable()
|
|
if err != nil {
|
|
return true, fmt.Errorf("locate current executable: %w", err)
|
|
}
|
|
if err := updater.AcknowledgeHealthFromExecutable(executable, arguments[1], windows.New()); err != nil {
|
|
return true, fmt.Errorf("acknowledge self-update health: %w", err)
|
|
}
|
|
return true, nil
|
|
}
|