Jump to content

[SOLVED] How to download exe from website?


Jason94
 Share

Recommended Posts

I have tried,
 

$RequestURL = "https://geeks3d.com/downloads/2020p/FurMark_1.23.0.0_Setup.exe"
$data = Round(InetGeatSize("https://geeks3d.com/downloads/2020p/FurMark_1.23.0.0_Setup.exe")/1024/1024,2)
Local $hDownload = InetGet("https://geeks3d.com/downloads/2020p/FurMark_1.23.0.0_Setup.exe", "FurMark_1.23.0.0_Setup.exe", 1, 1)
Do
    Sleep(2000)
    ToolTip(Round(InetGetInfo($hDownload,0)/1024/1024,2)&" MB OF "&$data&" MB") 
Until InetGetInfo($hDownload, 2)    ; Check if the download is complete.
Local $nBytes = InetGetInfo($hDownload, 0)
InetClose($hDownload)   ; Close the handle to release resourcs.
MsgBox(0, "", "Bytes read: " & $nBytes)

This link "https://geeks3d.com/dl/get/655" will directly get me an exe file that I require. Can someone enlighten me please.

It would be best to download the latest from Geeks3D, but any help would be appreciated!

Edited by Jason94
Link to comment
Share on other sites

4 hours ago, Jason94 said:

Can someone enlighten me please.

I don’t see how the script gets past this line:

$data = Round(InetGeatSize("https://geeks3d.com/downloads/2020p/FurMark_1.23.0.0_Setup.exe")/1024/1024,2)

unless you have a custom InetGeatSize() function defined somewhere...

Code hard, but don’t hard code...

Link to comment
Share on other sites

I tested with InetGet and it doesn't seem to be working. It is redirected to a download page instead of downloading the file.

Here a way to achieve what you want, it is a tad slower but you will get the requested file.

#include <IE.au3>
#include "..\BlockInput\BlockInputEx.au3"

Local $oIE = _IECreate("https://geeks3d.com/dl/show/655", 0, 0)
Sleep (2000)
Local $oButton = _IEGetObjById($oIE, "dlbutton")
Local $oObj = _IETagNameGetCollection($oButton, "a", 0)
ConsoleWrite ($oObj.innerText & @CRLF)
$oObj.click()

Sleep (1000)

Local $hWnd= _IEPropertyGet ($oIE, "hwnd")
Local $hCtrl = ControlGetHandle ($hWnd, "", "DirectUIHWND1")
ConsoleWrite ("Control = " & $hCtrl & @CRLF)
WinSetTrans ($hWnd, "", 0)

_BlockInput ($BI_DISABLE)
$oIE.visible = True
WinActivate ($hWnd)
Sleep (800)
ConsoleWrite (ControlSend ($hWnd, "", $hCtrl, "{F6}{TAB}") & @CRLF)
Sleep (800)
ControlSend ($hWnd, "", $hCtrl, "{ENTER}")
$oIE.visible = False
_BlockInput ($BI_ENABLE)

Sleep (8000) ; give enough time to complete the DL
_IEQuit ($oIE)

See my signature for the BlockInputEx UDF.

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...