Sign in to follow this  
Followers 0
Chimaera

Igetnet dosent seem to work like it should

3 posts in this topic

Hey all ive been messing with a downloader for the latest version of a file i use at work trying to automate the update progress

This is what i have so far

Global $net_test
$net_test = Ping("www.google.com", 4000)


If $net_test = 0 Then
    MsgBox (0, "Connection Error", "        No Internet Connection Is Currently Available. ", 5)
Else
    InetGet("http://www.piriform.com/ccleaner/download/slim/downloadfile", "ccsetup236_slim.exe")
        If FileExists("ccsetup236_slim.exe") Then
            FileMove("ccsetup236_slim.exe", "tech_ccleaner.exe", 9)
                If FileExists("tech_ccleaner.exe") Then
                    RunWait("tech_ccleaner.exe /S")
        EndIf
    EndIf
EndIf

Now i tried going this way

$file = "http://www.signa5.com/LTSWA3/small.txt"
$save = @ScriptDir & "\Downloads\smallfile.txt"

;Download $file, save it to $save.  Force a reload (1) and make sure it waits until it is completed (0).
InetGet ($file, $save, 1, 0)

but i cant get the $file and $save working with the link in the earlier post which i believe is to do with the , and it not being joined the link was pulled from a post earlier by Valuator

http://www.autoitscript.com/forum/index.php?showtopic=120756

and is it possible to rename the file in the download?

And one more thought, is it possible to obtain the file by wildcard so it always gets the latest file? for eg. "ccsetup236_slim.exe" becomes "*.exe", then i never need worry about the files real name and just work with the renamed file so its consitent all the time.

And as to the rest of what ive done is there more efficient ways to write it, this is my first real attempt ;)

Chimaera

Share this post


Link to post
Share on other sites



$URL = "http://www.piriform.com/ccleaner/download/slim/downloadfile/"
$file = "Tech_ccleaner.exe"
InetGet ($URL , $file, 1, 0)
  If FileExists("tech_ccleaner.exe") Then
                    RunWait("tech_ccleaner.exe /S")
                EndIf
                exit


,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Share this post


Link to post
Share on other sites

Thanks for that iamthekey definatly more efficient...

One more question if i may to the masses

To isolate a section so it can be called from a button for eg (and i may not be using the right terminology here) should i use Func _Script_Name() and EndFunc to contain the bits i need like the script in the first post so it dosent run into the next thing in the list.

if i make a button i assume i have to use GUICtrlSetData or one of the similar ones for the trigger?, can it be tied to _Script_Name() or do i have to set a Func $func_title for it to aim to, then it runs everything within the Func / EndFunc.

Chimaera

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0