Powershell と WASP を使用して、サービスの削除と再インストールを自動化しようとしています。
サービスがインストールされていない場合、「Windows インストーラー」ダイアログ、「このアクションは現在インストールされている製品に対してのみ有効です」、および「OK」ボタンが表示されます。
Powershell と WASP は、「Windows インストーラー」のタイトルバーと「OK」ボタンを検出できます。
$intCountdownSeconds=5
do {
start-sleep -s 1
$intCountdownSeconds--
} until ((select-window -title $strWindowsInstallerTitlebar | select-control -title "ok*" -recurse) -or ($intCountdownSeconds -le 0))
おそらくGetWindowText()関数を使用して、ダイアログの「このアクションは有効です...」部分を検出することは可能ですか? これは私がこれまでに得たのと同じくらい近いです:
select-window -title "windows installer" | select-control | get-member
TypeName: Huddled.Wasp.Control
Name MemberType Definition
---- ---------- ----------
...
GetWindowText Method string GetWindowText()
...