Jump to content
Sign in to follow this  
SleepyXtreme

_TooBigForForums

Recommended Posts

SleepyXtreme

;===============================================================================
;
; Function Name:   _DownloadAndInstall
; Description::    Downloads your program and opens it (For when you have exceeded your upload limit but still want to know how many downloads you have).
; Parameter(s):    $ProgramLocation - The location of the install file (on the internet, i.e. http://www.yadayadayada.com/program.exe)
;                  $ProgramName - The name of your program
; Requirement(s):  an Internet connection and a place to put a file online.
;                  
; Author(s):       SleepyXtreme
;
;===============================================================================
;



_DownloadAndInstall("AAST", "http://www.andrewshangout.com/aast/AASTInstall.exe")


Func _DownloadAndInstall($ProgramName, $ProgramLocation)

    $question = MsgBox(4, $ProgramName, "Would you like to download " &$ProgramName)
    if $question = 7 then Exit
    $ping = Ping("www.google.com")
    $retry = 0
    While 1
        If $ping = 0 Then
            $retry = MsgBox(5, $ProgramName, "Error! Please connect to the Internet and try again!                          ")
        EndIf
        If $retry = 4 Then
            Local $ping = Ping("www.google.com")
        EndIf
        If $retry = 2 Then
            Exit
        EndIf
        If $ping <> 0 Then ExitLoop
    WEnd
    If $ping <> 0 Then
        FileDelete(@TempDir & "/"& $ProgramName & ".exe")
        $size = InetGetSize($ProgramLocation)
        If $size = 0 Then
            MsgBox(0, $ProgramName, "The update server is temporarily unavailable. Please try again later.")
            Exit
        EndIf
        InetGet($ProgramLocation, @TempDir & "/"& $ProgramName & ".exe", 1, 1)
        
        While @InetGetActive
            TrayTip($ProgramName, "Downloading " &$ProgramName & ": Program: Bytes = " & @InetGetBytesRead, 10, 16)
            Sleep(50)
        WEnd
        TrayTip("", "", 0)
        TrayTip($ProgramName, "Downloading Complete", 10, 16)
        $question2 = MsgBox(4, $ProgramName, "Would you like to install " &$ProgramName)
        if $question2 = 7 then Exit
        sleep(2000)
        Run(@TempDir & "/"& $ProgramName & ".exe")
        Exit
        EndIf
EndFunc   ;==>_DownloadandInstall

I assumed this could be very useful for those who create many programs but still want to know how many people have downloaded their program.

Maybe a sticky :)?

Also, I'm not sure if this is a UDF since you would want to create an .exe with just this stuff

credits: Sleepyxtreme and RazerM(I used the pinging method in the beginning from one of his posts)

Edited by SleepyXtreme

Share this post


Link to post
Share on other sites
SleepyXtreme

awwwww not 1 reply?

Share this post


Link to post
Share on other sites
Generator

awwwww not 1 reply?

Downloads your program and opens it (For when you have exceeded your upload limit but still want to know how many downloads you have).

Explain bit more?

Share this post


Link to post
Share on other sites
McGod

My assusmption is that when you have a big program, he puts this script in place of it and when you download this and run it, it downloads the correct big file, allowing for the counter of the downloader.

Share this post


Link to post
Share on other sites
Richard Robertson

This is for when programs are released and not scripts I guess. I think it's better to release the source in AutoIt tags.

Share this post


Link to post
Share on other sites
SleepyXtreme

well people still upload their .au3 files so it can be used for source files as well.

and Chip is right on the money :).

I figured that if you work hard to produce something, ie a script, a program whatever, you want to know how much the community recognizes it. a measure of this is the amount of downloads your script/program has. And since the autoit forums limits you to a total of 1mb or less, i figured there's a vast majority of people who exceed this number who have to post links to their programs because they can't upload it. therefore, they can't see how many people have downloaded their program. However, if you use my script, you just put the file location in, either au3 or exe or zip, whatever, and people can download it and when they open it, it will download your program and still tally +1 to the download score.

Share this post


Link to post
Share on other sites
SleepyXtreme

ummmm valuator please explain. is that unlimited?

edit:

Wow, i've never noticed that section of the site before. You should make it more well known because i've been on the site for weeks and i think i've only seen it twice from someone else linking to it.

Maybe on the homepage under downloads, "here are some of the published examples of using AutoIt" or something

Edited by SleepyXtreme

Share this post


Link to post
Share on other sites
Valuater

ummmm valuator please explain. is that unlimited?

edit:

Wow, i've never noticed that section of the site before. You should make it more well known because i've been on the site for weeks and i think i've only seen it twice from someone else linking to it.

Maybe on the homepage under downloads, "here are some of the published examples of using AutoIt" or something

Sorry... I didn't know, that you didn't know, that I thought, that you thought that, that i figured, that you figured that....

never mind... just use it!!!!

lol

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
SleepyXtreme

Make it more well known!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Post a sticky about it, put it in the downloads section of the website, do something to spread the word!

:)

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  

×