Car Posted June 2, 2020 Posted June 2, 2020 The download page rotates, and the downloaded file is never exactly the same, hence why i cant use InetGet This is my script so far: #include <IE.au3> MsgBox ( $MB_OK, "Processing", "The program is being downloaded, please be patient. Click OK to continue.") Dim $sKey = 'HKCU\Software\Microsoft\Internet Explorer\New Windows' RegWrite($sKey, 'PopupMgr', 'REG_SZ', 'no') ; Turn off Local $oIE = _IECreate("DOWNLOADPAGE.COM", 1, 0, 0) _IELoadWait($oIE) Local $oButtons = _IETagNameGetCollection($oIE, "Button") For $oButton In $oButtons _IEAction($oButton, 'click') Sleep(10000) Send("{TAB 1}") Sleep(750) Send("{ENTER 1}") Sleep(5000) if ProcessExists("iexplore.exe") Then ProcessClose("iexplore.exe") EndIf MsgBox ( $MB_OK, "Setup", "Please complete the setup.") Exit Next #RequireAdmin Let me explain. First a message pops up telling the user that the program is being installed Then we change a regedit key that disables the blocking of pop ups in Internet Explorer (when the button is clicked, a new tab appears and IE blocks that as a pop-up). Then we create a hidden IE page that goes to the main download page. Then we find all the buttons Then we click the button which then opens a new tab, which makes the IE window visible (I want it to remain invisible). Then we wait 10 seconds for the file to get downloaded Then there is a message that pops up asking if we want to run the file, or save it. (Looks like this: https://prnt.sc/ssbppz) Then we click TAB, selecting the run option And then we click enter which opens the program. After 5 seconds IE is closed And then we get a message saying please complete the setup, while the setup is running. I am very bad at AutoIt so I'm sorry if there was something bad in this code. Let me explain my issues: 1. IE becomes visible when clicking the button, which opens a new tab. I would like it to be invisible at all times. 2. Waiting 10 seconds for a file to download is not really good, cause some PCs are really fast, and some are extremely slow. 3. If the user never have used IE before using this script, they will get a window asking them if they want to use recommended settings, and then a new tab will open showcasing Edge. (Looks like this: https://prnt.sc/ssbpy1) 4. Using TAB and Enter to select run to run the application is not very convenient. Since I want IE to be hidden at all times, I dont even think TAB and Enter is going to do anything. 5. If a computer is slow and takes time opening the file, after 5 seconds IE gets closed, which also stops it from opening the file. 6. The message that pops up in the end asking the user to complete the setup, is behind the setup, since the setup appears in front. Possible fixes to the problems: 1. Tell IE to always stay invisible, even when a new tab is opened. I have seen people putting IE inside a GUI window or something and then hiding that GUI window, but I never understood how it worked. 2. A code that automatically selects the run option when a file gets downloaded. . Either that, or change a regedit key that automatically starts a program when it gets downloaded from IE. 3. Either simply open IE hidden, and then close it again after a few seconds. Or somehow disable that window and close the tab. But we first must find out if the user has used IE before. 4. See number 2. 5. I dont think the file has the same file name either, might have some things in common. So maybe something like: if a process exists that includes this: "setupman" then close IE. So when the program is opened, IE closes. 6. Either telling the message box to be in front, or maybe have the message box appear to one of the sides. There are a few more problems with my code. This is what im trying to achieve: The user opens the file, gets a message saying "The file is being downloaded please wait", but there is no button to press. When the file has been downloaded, the message disappears and the program runs and the user gets a message saying "Please complete the setup". When the setup is completed the user gets another message saying "Thanks for completing the setup" (or something along those lines). It would also be a possibility to run the setup hidden, and the script simply clicks the buttons in secret. Again, I cant use InetGet, as the download file is never hosted at the same place. It rotates every hour or so.
Danp2 Posted June 2, 2020 Posted June 2, 2020 You've done a good job at omitting the name of the application that you want to download / install. Care to elaborate? 🤨 Latest Webdriver UDF Release Webdriver Wiki FAQs
Car Posted June 2, 2020 Author Posted June 2, 2020 (edited) 46 minutes ago, Danp2 said: You've done a good job at omitting the name of the application that you want to download / install. Care to elaborate? 🤨 Oh yeah, sorry about that. It's just that it's a little hard to explain. So you know sometimes when you install a software, in the setup you get asked if you also want to include this other software (they are paying for that to be there), and most of the time we decline and say no to that. Well that's sort of what I am doing here. I am in this PPI network (Pay-Per-Install), and I make Youtube videos showcasing different types of software. Like a FPS booster, or maybe like a Minecraft Texture Pack. I take these programs or files and host them on the PPI Networks servers. For other to install them they need to go to their website and click install, and then go through a setup which asks if they want to include these other programs as well. Of course they are able to decline them all, although then I make very little. And when they are done with that setup, they get the file that I first uploaded. I don't make much with this, but it's currently what I earn most from. I keep getting comments saying that they have difficulties navigating the website, and there are lots of ads and pop ups there, the problem is that I am not allowed to host the setup file on places like Mega.nz. I don't know why, but when I asked they said something about, that if I uploaded the file on Mega.nz it would be impossible for them to know if I was downloading my own file over and over again to make profit, cause when a user downloads the file from their website, and then go through the setup, they see that the IP is the same and that verifies a legit download. Sounds kinda weird, but I guess. I thought it would be better if I hosted a script on Mega.nz, so people don't need to see those pop ups and ads. I am pretty sure I am not doing anything illegal (EDIT: I use "pretty" too much. I am 100% sure this is not illegal). I don't think they make a lot from those ads, cause I make nothing from them at least. Most of the income come from the setup, and I am not trying to scam the network or anything, I am pretty sure this script would get them more downloads, which I think the network would be happy for. Edited June 2, 2020 by Car I wasn't clear enough
Danp2 Posted June 2, 2020 Posted June 2, 2020 4 minutes ago, Car said: I am pretty sure I am not doing anything illegal Let's press pause for a moment and let one of the Mods review this. Latest Webdriver UDF Release Webdriver Wiki FAQs
Developers Jos Posted June 2, 2020 Developers Posted June 2, 2020 (edited) Welcome to the AutoIt forum. Unfortunately you appear to have missed the Forum rules on your way in. Please read them now. See you soon with a legitimate question I hope. The Moderation team ps. In case I've misunderstood the purpose then PM me with a proper explanation and, when legitimate, we will reopen the thread. Edited June 2, 2020 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts