Jump to content

RustDesk UDF


Go to solution Solved by BinaryBrother,

Recommended Posts

Posted (edited)

I freelance in misc. computer repair. <snip> I wanted an open-source solution, or at least something I could use that wasn't illegal to use without a license, like TeamViewer.

I found RustDesk and gave it a try, it's incredibly slow compared to TeamViewer (On my setup), but it'll get the job done. All it gave me for custom clients, was a PowerShell script that simply silent installed RustDesk and used my hosted server for the relay. I created a custom client in AutoIt and C# for the GUI (not included).

So... Here it is. You'll notice some oddities in the temp path. This is only one part of a larger project that I'm working on, and it's slightly customized for my specific needs.

_isInstalled() ; Tells whether it's installed.
_GetLocalVersion() ; Retrieves the local version, if installed.
_GetLatestVersion() ; Check github tags for latest version number.
_Deploy_RustDesk() ; Auto pulls from current online version.
_Run() ; Runs a program and returns console output.
_Set_RustDesk_Password()
_Get_RustDesk_ID()
_Download() ; Quick and dirty download with progress.
_DebugInit() ; Prepares log
_Debug($pData) ; Console output & Debug log to desktop.
_Error($pError) ; Handles all known errors.

I am really busy with some stuff in my personal life. This UDF was crafted for me, without the intention of sharing it. It has variables at certain locations that need to be tailored to your needs. I even included my primary payload for my customers.

 

ServiceWrapper.au3 WTS.au3 RD_Deploy.au3

Edited by BinaryBrother
Update

SIGNATURE_0X800007D NOT FOUND

Posted

It needs to be slightly modified to use the MSI, instead of the EXE installer. The MSI handles firing up the service, instead of having to do it manually.

This UDF is close enough for you guys to modify and use. I won't be maintaining unless interest is expressed.

SIGNATURE_0X800007D NOT FOUND

Posted
1 hour ago, BinaryBrother said:

I won't be maintaining unless interest is expressed.

Global $g_RustDesk_CallForSupportStr = "Please call (XXX)-XXX-XXXX for support!"

Func _RustDesk_CallForSupportStr($sStr = Default)
    If $sStr <> Default Then $g_RustDesk_CallForSupportStr = $sStr
    Return $g_RustDesk_CallForSupportStr
EndFunc   ;==>_RustDesk_CallForSupportStr

That is a better idea. Maybe go the extra mile and add a function just for that.

Making a UDF is a pain. In my case because I can hear the complains in my head and change the UDF to appease those in my mind. Shut up already !, am typing ! 🤪
But those ideas don't come to mind beforehand. Only after some exposure is that they pop-up.

In either case, if you maintain it, you'll be a better coder. Even if no one uses it, so, thanks for sharing and do keep it up.    :gathering: 

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

Yeah, I thought it was a pretty good foundation. I made a quick sc.exe "Service Control" wrapper, but if you use the MSI you don't need it.

And yeah, I could definitely throw the repeated text into a variable.

SIGNATURE_0X800007D NOT FOUND

Posted (edited)

I created the relay server myself and installed RustDesk using the auto install script via ps. It seems your UDF is not detecting it.

RD.png

Edited by Trong
https://vnc.my/WindowsAgentAIOInstall.ps1

Regards,
 

Posted

It's looking for a registry key to determine the local version, as per the PowerShell script provided, I used...

Global $g_RustDesk_RegPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\RustDesk"
Global $g_RustDesk_RegKey = "Version"

What value do you have at that location?

SIGNATURE_0X800007D NOT FOUND

  • Solution
Posted (edited)

I had a similar problem running the script under x86. Make sure you're running x64 through scite, or compile the scripts for x64 support.

I'm gonna update the UDF one more time, I have to remove all my personal info so it'll take me a second.

Edit: I shared my current working version in the first post. Just make sure you're running under an x64 atmosphere. You'll have to remove my personalizations, I don't have time right now but I still want to see you get this working.

To be clear, this is dirty. You'll have to do some housekeeping.

Also, you can try changing HKLM to HKLM64, if you're intent on running in an x86 environment.

And Kudos to you for accurately describing your issue with screenshots.

Final Edit: I did not account for using custom relays in this UDF. I only intended to Install/Update RustDesk and return the ID and Pass back to my server. And in my defense, the provided PowerShell script was horrid. Using sleeps to wait for services to start, etc. At least, my conversion actually checks for a running service, and attempts to start it if found or install it if it's missing. There's NO error checking in that PS script. Anywho... I've patched this together with a bottle of brandy and just got back from the ER over bronchitis. Ask me specifics and I'll try to detail things a bit better, but for now I'm just giving you what I have.

Edited by BinaryBrother
Warnings

SIGNATURE_0X800007D NOT FOUND

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...