PresFox Posted November 9, 2013 Posted November 9, 2013 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')
l3ill Posted November 9, 2013 Posted November 9, 2013 (edited) Hi PresFox, Your script might be having trouble finding your installer. Maybe updating the path info would help... Bill Shellexecute works better IMO on EXE files Edited November 9, 2013 by billo My Contributions... SnippetBrowser NewSciTE PathFinder Text File Manipulation FTP Connection Tester / INI File - Read, Write, Save & Load Example
PresFox Posted November 9, 2013 Author Posted November 9, 2013 (edited) 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 November 9, 2013 by PresFox
PresFox Posted November 9, 2013 Author Posted November 9, 2013 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?
hiho Posted November 9, 2013 Posted November 9, 2013 Your problem is the last parameter of InetGet. If its 0 then u dont need the loop.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now