Implement app update orchestration (T-402)

This commit is contained in:
ila
2026-07-19 21:39:33 +08:00
parent fda52a57ca
commit 339beaa9b3
19 changed files with 1095 additions and 11 deletions
@@ -3,11 +3,13 @@
package windows
import (
"context"
"errors"
"fmt"
"os/exec"
"path/filepath"
"strings"
"time"
"unsafe"
"golang.org/x/sys/windows"
@@ -49,6 +51,12 @@ func (platform) IsRunning(_ string, entrypoint string) (bool, error) {
})
}
func (target platform) WaitForExit(ctx context.Context, appID, entrypoint string, timeout time.Duration) error {
return waitForExit(ctx, timeout, func() (bool, error) {
return target.IsRunning(appID, entrypoint)
}, systemExitWaitClock{})
}
func (platform) Start(command launch.Command) (int, error) {
if !filepath.IsAbs(command.Entrypoint) || !filepath.IsAbs(command.WorkingDirectory) {
return 0, fmt.Errorf("launch command must contain absolute paths")