Jump to content

Download links


 Share

Recommended Posts

Hey all just a quick question

Is there a way to wildcard a download link e.g.

http://download.avgfree.com/filedir/inst/avg_free_x86_all_2011_1153a3218.exe

thats the link but it changes constanly as they update so if i specify it in my script as soon as they change revision it wont download

The code i use is

$URL = "http://download.avgfree.com/filedir/inst/avg_free_x86_all_2011_1120a3152.exe"
    $file = @ScriptDir & "\file_includes\install\install_avg_32.exe"
    InetGet($URL , $file, 1, 0)

As you can see it has changed since my origanl script

I have tried

All i get is file not found, is there a way around this?
Link to comment
Share on other sites

Probably might want to analyse the webpage, to see where the link is, the latest version will most likely be in the same place order of tags, or something. Or maybe a regexp pattern to read the source of the page.

If I'm not mistaken, I think I have seen some code for exactly this knocking around the forum too, try refining your search.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Thats a usefull looking program thanks engjcowi

Ill have a play with it

Thats pretty much what im trying to achieve within autoit that when i start an install it checks on the net updates the file where necessary then silent installs, i guessing i could use this to maintain the stock of programs and just install from the autoit file

Thanks

Link to comment
Share on other sites

Hi

Im pretty sure the new version has the ability to perform installs but if you prefer using autoit and writing your own program as i do then i have a few tips for you.

If i remember rightly when you load ketarin on a new pc it forgets what links you had and you then have to load up the xml file that you export from the main program when you have loaded in all your links. There are some command line switches which if you look on ketarins wiki site it has them there along with alot of other great info. the forums are great for getting templates etc...

You can use dos commands within the program to unzip or extract if they are rar or zip files. i just used 7z.exe and 7z.dll in the main directory with ketarin and it then extracts (with my commands for each file) to the correct directory. I also use portable files and let autoit unzip them to the temp directory then run and delete them when finished. I also created a paf installer/extractor for portableapps.com files as they are a pain lol.

If you need any other help just PM me. Ive included a screenshot of my prog.

P.S i havent got a way yet to silent install adaware and a few other progs yet such as silverlight however a site called ninite will create you an installer that will download the latest version there and then and install it quietly then you can use autoit to get the handle and close the window. Another great program designed for helping with installs is WPI. it can be found at wpiw.net i think.

Thanks

Jamie

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

Hi it was just what the doctor ordered for some reason on my main pc it remembers the links so i can just update my pendrive when im at home.

so i have it ripping down the files and changing the names another thing i wanted.

I am using the autoit frontend for it that im making with buttons to call the product i need installing, with some multi buttons for differnet packs that we need for new pc,s.

It would have been nice to do it all in Autoit but im not much of a coder so it simplifys things a heck of a lot.

many thanks for the links

Jez

Link to comment
Share on other sites

Hi Chimera

I was wondering if you would post some screen shots of you front end. Im interested in Gui design and like seeing what other people come up with. Ive posted a few of mine for you to see. Its far from finished but got most of my stuff working.

Jamie

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

Man Alive , if i can get mine within a 10th of that ill be happy..

lol mine looks like ive been making with a hammer and chisel :graduated:

Its very early days for mine and some of the bits like getting msconfig to work from a button dont seem to work on mine but first i gotta finish tying all the buttons to their tasks

Jez

Link to comment
Share on other sites

It looks good. My gui has evolved alot over time. Yours will too. Colour is important and adding a few pics helps the look. Im still not happy with mine yet lol. If you have any suggestions pls let me know. Ill send u my msconfig code if u like? Whats on ur other tabs?

Mine is focused primarily on automation. I think (out of the checkboxes) i only have 2 where the user has to do something once start button is pressed. Im currently on my iphone in work so will message you better tomorrow.

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

Mine is a tech only gui

It evolved over time with the cmd image below then i finally started with autoit because i could only go so far with cmd.

And at least with this im using windows against itself to show the things in a better way, and also up the level of the tool.

I want in this one stuff like registry removal of certain virus / toolbar elements and auto msconfig removal like adobe reader for eg.

I love the way yours greys out the stuff if the program isnt installed

Im assuming thats to do with

If Not Fileexists GUICtrlSetState($hchkbx,$GUI_DISABLE)
or something similar.

In the small pc shop i work in we use the tool for a "Multi" install of about 8 programs on a new pc and different pack for virus removal and serviceing, one of the lads does some overclocking and tweaking so he has some of the tools on second tab and then the rest is drivers for laptops etc.

Its quite straight forward really

but it saves us hours of time as its all silent installs etc

The other tool i have is a backup tool but that is in the wings waiting to written.

The msconfig issue, i tried run / shell execute /comspec and it wont start msconfig i wondered if it was windows 7 issue but i havent had time to run it down yet

Jez

Edited by Chimaera
Link to comment
Share on other sites

Hi

Your program looks good. For some of the things you want i would suggest looking at this or search for autoclean. This is the autoclean program link created by nerdfencer. Its an awesome program. I messaged him and asked to use some of his source which i think he owuld let you use anyway as its released in this thread. it helped me learn ALOT and i used it as a starting basis for my own program. It will show you some of the things you wish to do such as creating a restore point, backing up the registry, removing unwanted startup entries and lots more.

I have included an example for checking if ccleaner is installed and of it is then it disables the checkbox and also to see if office 2007 install files are contianed with my install prog and if they arent then disable that too. You can also use this for buttons etc..

;office 2007 check for install files
If FileExists(@ScriptDir & "\office2007\setup.exe") Then
    GUICtrlSetState($checkbox64, $GUI_enable)
Else
    GUICtrlSetState($checkbox64, $GUI_disable)
EndIf
;ccleaner check to see if already installed
If FileExists(@ProgramFilesDir & "\ccleaner\ccleaner.exe") Then
    GUICtrlSetState($checkbox15, $GUI_disable)
Else
    GUICtrlSetState($checkbox15, $GUI_enable)
EndIf

Below is my code for msconfig. use as you like. Ive not encountered any issues so far and ive tried on each OS. if you do please let me know.

Func msconfigClick()
    If @OSVersion == "WIN_XP" Or @OSVersion == "WIN_2003" Then
        RunWait(@WindowsDir & "\PChealth\helpctr\binaries\msconfig.exe")
    ElseIf @OSVersion == "WIN_VISTA" Or @OSVersion == "WIN_7" Or @OSVersion == "WIN_2008" Then
        RunWait(@SystemDir & '\msconfig.exe')
        ProcessWaitClose('msconfig.exe')
        RegDelete("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "MSConfig")
    EndIf
EndFunc   ;==>msconfigClick

Just out of curiosity what other things do you want backing up?

Right as for the avg thing if you still want to do it within your program, here is some example code below that extracts a link from a website. Goto the website and save it then open it in a text editor and search for what the code is searching for and you will see how it works and how you can do it with AVG. Just one request, when you do it would you send it to me pls?

getisohunt("http://isohunt.com/torrent_details/225857453/the+switch?tab=summary")

func getisohunt($Linktoget)
;This below section is for ISOHUNT test but also proof of concept as it can be done on this page to download too. See the section below for the code
    ;to work kickasstorrents, i dont know if i have an issue with my pc but i cannot download anything from here even by going
    ;to the site and manually donwloading

    $fileisohunt = FileOpen("c:\isohuntlink.txt", 1) ; this is the file where the link will be written to
    If $fileisohunt = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
    EndIf

    $line = _INetGetSource($linktoget)
    ;$temp = _StringBetween($line, 'href="http://isohunt.com/download/', '.torrent')
    $temp = _StringBetween($line, 'href="/download/', '.torrent')
    $temp2 = _ArrayToString($temp)
    $temp3 = "http://isohunt.com/download/" & $temp2 & ".torrent"
    MsgBox(0, "The Link is:", $temp3)
    FileWriteLine($fileisohunt, $linktoget & @CRLF) ;writes the webpage then
    FileWriteLine($fileisohunt, $temp3 & @CRLF) ; the link to the torrent so you know where it came from
    InetGet($temp3, "c:\" & "Isohunt.torrent") ; this will download the torrent to the c:
    ;InetGet("http://isohunt.com/download/225857453/the+switch.torrent", "c:\" & "test.torrent") ; this will download the torrent to the c:
    FileClose($fileisohunt)


endfunc

I hope this has been helpful. I have some other suggestions for you. Do you have an email? PM me and ill send you some stuff.

jamie

Drunken Frat-Boy Monkey Garbage

Link to comment
Share on other sites

That looks good jamie but I have one suggestion for your download location in the getisohunt() function. Download your files to the last used download location instead of hard coding it to C:\. In my case that would be my desktop. To get the location (or to set it for future downloads) it's saved in the registry. For IE it would be

$sDownloadLocation = RegRead("HKCU\Software\Microsoft\Internet Explorer", "Download Directory")
If NOT StringRight($sDownloadLocation, 1) = "\" Then $sDownloadLocation &= "\"

You could even change that up a bit by using this

$sDownloadLocation = RegRead("HKCU\Software\Microsoft\Internet Explorer", "Download Directory") & "\isohunt\"

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I think the check for latest version of file then download latest then use to install, is a dead dog

To many problems with links changing which breaks the download chain etc etc,

It will require more than i can handle in code to achieve, im still a noob

with the program you gave me the link to i can have a saved list and it takes seconds to check so lots easier then i can concentrate on the making it work right from the gui

More time effective

Jez

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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