techahold / rustdeskinstall

Easy install Script for Rustdesk
MIT License
371 stars 113 forks source link

Script seems to freeze and won't continue until rustdesk.exe is ended #47

Closed dudefoxlive closed 1 year ago

dudefoxlive commented 1 year ago

When using the script it gets stuck and I have to manually end rustdesk.exe to get it to continue. Adding taskkill /f /im rustdesk.exe after line 33 seems to fix the issue. Also on a side note Rustdesk in the script is outdated. Latest version is 1.2.1

dudefoxlive commented 1 year ago

Welp Scratch what I said. Adding the taskkill command doesn't work. Still gets stuck.

dinger1986 commented 1 year ago

Can you PR any fixes? If not I'll need to look at this after the weekend

knut32 commented 1 year ago

Same problem here. :(

dinger1986 commented 1 year ago

Feel free to PR fixes, I need to look at it again and probably simplify it

knut32 commented 1 year ago

Hi,

tested it with following code from line 33 and it works:

Start-Process "rustdesk.exe" -argumentlist "--silent-install"

  $Start = Get-Date
$Duration = New-TimeSpan -Seconds 30
$End = $Start + $Duration
Do{
    Start-Sleep -Seconds 1
    $DisplayTime = New-TimeSpan -Start $(Get-Date) -End $End
    $Time = "{0:D2}:{1:D2}" -f ($DisplayTime.Minutes),  ($DisplayTime.Seconds)
    Write-Progress $Time 
}
While((Get-date) -lt $End)

Only issue is the rustdesk service doesn't start until reebooting.

dinger1986 commented 1 year ago

If you can PR changes please I’ll accept them.

dinger1986 commented 1 year ago

sorry so what you mean is change this line https://github.com/techahold/rustdeskinstall/blob/5f7fdb85a0d0c13638e3323355cfcaff9f053494/WindowsAgentAIOInstall.ps1#L33 to this

Start-Process "rustdesk.exe" -argumentlist "--silent-install"

  $Start = Get-Date
$Duration = New-TimeSpan -Seconds 30
$End = $Start + $Duration
Do{
    Start-Sleep -Seconds 1
    $DisplayTime = New-TimeSpan -Start $(Get-Date) -End $End
    $Time = "{0:D2}:{1:D2}" -f ($DisplayTime.Minutes),  ($DisplayTime.Seconds)
    Write-Progress $Time 
}
While((Get-date) -lt $End)

for the service not starting can you not start the service with "net start"? I cant test it this week with windows unfortunately

dinger1986 commented 1 year ago

should be fixed now