From d6f8ac08b3fd0fad79732ea49bc84ce79ea0ca93 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 8 Aug 2024 10:13:33 +0200 Subject: [PATCH] msg --- windows-installer.hta | 52 +++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/windows-installer.hta b/windows-installer.hta index 0e4a2af..83be5ca 100644 --- a/windows-installer.hta +++ b/windows-installer.hta @@ -45,7 +45,7 @@ Sub Window_OnLoad window.moveTo (intHorizontal - X) / 2, (intVertical - Y) / 2 ' centre it 'txtName.value=objNetwork.UserName - txtHost.focus + txtPort.focus wcRegPath = "HKLM\SYSTEM\CurrentControlSet\Services\WebClient\Parameters\" @@ -60,7 +60,7 @@ Sub Window_OnLoad End Sub -Sub btnConfigure_OnClick +Sub btnStart_OnClick StartWSL @@ -75,7 +75,12 @@ Sub btnConfigure_OnClick Exit Sub End If - MsgBox "TEST STARTED",64,"DONE" + 'MsgBox "TEST STARTED",64,"DONE" +End Sub + +Sub btnOpen_OnClick + + MsgBox "Open",64,"DONE" End Sub Sub ShowOutput(objExec) @@ -103,6 +108,20 @@ Sub ShowOutput(objExec) End Sub +Sub Delay(seconds) + ' Simulate a delay by using a busy loop for the specified seconds + Dim start, now + start = Timer + + Do + now = Timer + ' Loop until the specified number of seconds has passed + If now - start >= seconds Then Exit Do + ' Reset start if midnight is crossed + If now < start Then start = now + Loop +End Sub + Sub StartWSL() 'WSL = "wsl.exe --user root --exec docker ps > C:\Users\wslresult.txt" @@ -121,30 +140,25 @@ Sub StartWSL() MsgBox (Err.number & "-" & err.Description) else MsgBox "Framework scheduler has started" - WSL = "wsl.exe --user root --exec docker logs framework-scheduler" + WSL = "wsl.exe --user root --exec docker logs framework-scheduler"i + + iterationCount = 0 + maxIterations = 12 ' Run for 1 minute (12 iterations of 5 seconds each) + Do + iterationCount = iterationCount + 1 Set objExec = objShell.Exec(WSL) ShowOutput(objExec) MsgBox "Please wait" 'Delay 5 + If iterationCount >= maxIterations Then + MsgBox "Max iterations reached, stopping script." + Exit Do + End If Loop End If End Sub -Sub Delay(seconds) - ' Simulate a delay by using a busy loop for the specified seconds - Dim start, now - start = Timer - - Do - now = Timer - ' Loop until the specified number of seconds has passed - If now - start >= seconds Then Exit Do - ' Reset start if midnight is crossed - If now < start Then start = now - Loop -End Sub - Sub MapDrive(DriveLetter,DrivePath) If objFSO.DriveExists(DriveLetter) Then objNetwork.RemoveNetworkDrive DriveLetter,true @@ -261,7 +275,7 @@ End Sub    -