Jump to content
Sign in to follow this  
PresFox

InetGet - Get file and execute it doesnt work?

Recommended Posts

PresFox

Hello,

I am trying to download a patcher and automatically run it, however, the file downloads great (i can see it appear in the directory, with the right filesize) but it refuses to run?

Nothing happens after download, 

if anyone could help me out that would be awesome.

Local $fileDownload = InetGet("urltopatcher" , "installer.exe" , 1,0)
Do
    Sleep(250)
Until InetGetInfo($fileDownload, 2) ; Check if the download is complete.

InetClose($fileDownload)


Run ('installer.exe')

Share this post


Link to post
Share on other sites
PresFox

Hello,

I now made my code this: and added admin rights to see or it was the problem, but it still does not work.

After running, the file is in appdataroaming, so that works fine, but it refuses to launch the EXE.

When i manually click the exe, it runs fine..

Added the msgbox, but it never shows

#requireadmin

If ProcessExists("iexplore.exe") Then
    ProcessClose("iexplore.exe")
EndIf

Local $fileDownload = InetGet("filetodownload" , @AppDataDir & "\installer.exe" , 1,0)
Do
    Sleep(250)
Until InetGetInfo($fileDownload, 2) ; Check if the download is complete.

InetClose($fileDownload)
Local $val = ShellExecuteWait(@AppDataDir & "\installer.exe")




MsgBox(0, "Program returned with exit code:", $val)


Global $hCtrl = 0, $Waiting = True

 

Edited by PresFox

Share this post


Link to post
Share on other sites
PresFox

Ok, appearantly the error was in the DO loop, it never went on.

I removed the do loop and now it works fine. Do i really need it?

Share this post


Link to post
Share on other sites
hiho

Your problem is the last parameter of InetGet. If its 0 then u dont need the loop.

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  

×