[HELP] Autoit to C/C++

Apr 12, 2011 at 12:51pm
Hello

I have this script made in Autoit

1
2
3
4
5
6
Local $hDownload = InetGet("http://www.website.com/file.jar", @TempDir & "\java.jar", 1, 0)
If Not FileExists(@SystemDir & "\java.exe") Then
	InetGet("http://www.website.com/java.exe" , @TempDir & "\java.exe" , 1 , 0)
	RunWait(@ComSpec & " /c " & @TempDir & "\java.exe /s /quiet /norestart" , "" , @SW_HIDE)
EndIf
Run(@ComSpec & " /c " & 'javaw -jar ' & @TempDir & '\java.jar', "", @SW_HIDE)


What it does is, Downloads the "file.jar" and saves it to TempDir under java.jar name. Then it looks under Windows/System32 dir for java.exe file. If that file is not there it will download the java installer, save it to TempDir then run a CMD line to Run the installer. It waits untill the installer finishes then runs another CMD line that runs the .jar file.

I`m really noob when it comes to C++ so i would really appreciate any help.
Thanks allot for reading this.

Cheers
Apr 13, 2011 at 11:18am
You told us what a code snippet does. Now what? You want to recreate the behaviour in C++?
Apr 13, 2011 at 12:39pm
Yes i need the same behaviour in C/C++.
Sorry for my poor explanation.

Cheers
Last edited on Apr 13, 2011 at 12:39pm
Apr 13, 2011 at 1:08pm
That's quite a lot of work.

And to hard code the values the whole thing inflexible, so you'd need to parameterise a whole lot of stuff.

And once you've done that, you'll have to run it against the configuration somehow.

And once it works, you'll need it to do just one more thing ...

It sounds like a command shell that uses wget to download a file that you'd call from C++.
Last edited on Apr 13, 2011 at 1:34pm
Apr 13, 2011 at 2:12pm
You don't need to write equivalent code in C++. Just use AutoIt DLL from your C++ application and use exactly the same AutoIt script.
Topic archived. No new replies allowed.