Jump to content

How To run a script from a server


Recommended Posts

Hello to all AutoIt's users,

This is my problem : I've done a script which install many program such as (Izarc, openoffice, pdfcreator...) I've used the Run() fonction to run the setup in the current directory but in fact i'd like to run the setup from a server.

Is it possible to do a thing like : Run("http://www.exemple.com/setup/openoffice.exe") ? I've tried this but it doesn't work... xD

Pliz can anyone help me ?

Thanks.

Link to comment
Share on other sites

Hello to all AutoIt's users,

This is my problem : I've done a script which install many program such as (Izarc, openoffice, pdfcreator...) I've used the Run() fonction to run the setup in the current directory but in fact i'd like to run the setup from a server.

Is it possible to do a thing like : Run("http://www.exemple.com/setup/openoffice.exe") ? I've tried this but it doesn't work... xD

Pliz can anyone help me ?

Thanks.

Well thats a hard one to me. I'm not really sure if it can be done in that way (like in the download box in IE, you can open it sometimes.) My first port of call would be to look at InetGet. Download it the run it :shocked:. Also Have you tried Shellexecute. Don't know if it will make a difference, but all well...
Link to comment
Share on other sites

The good Mr. Brett called it, use InetGet():

; Pick a mirror from:  http://distribution.openoffice.org/mirrors/#mirrors
Global $SelectedMirror = "http://mirrors.ibiblio.org/pub/mirrors/openoffice/stable/2.2.0"

; Select filename of particular distribution version you want
Global $FileName = "OOo_2.2.0_Win32Intel_install_en-US.exe"

Global $URL = $SelectedMirror & "/" & $FileName
Global $OooInstaller = @ScriptDir & "\" & $FileName

$FileSize = InetGetSize($URL)
If $FileSize Then
    InetGet($URL, $OooInstaller, 1, 1)
    ProgressOn("OO.o Install: Downloading", $FileName, "", 100, 100)
    While @InetGetActive
        If @InetGetBytesRead = -1 Then
            MsgBox(16, "Error", "Error occured downloading: " & $URL)
            Exit
        EndIf
        $Percent = @InetGetBytesRead / $FileSize * 100
        ProgressSet($Percent, @InetGetBytesRead & "/" & $FileSize & " = " & $Percent & "%")
        Sleep(500)
    WEnd
Else
    MsgBox(16, "Error", "Error!  Could not get file size: " & $URL)
EndIf

Run($OooInstaller, @TempDir)

MsgBox(64, "OO.o Install", "Launched installer...")

:shocked:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
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
 Share

  • Recently Browsing   0 members

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