Jump to content

-detect download is finished and close program...


Recommended Posts

Okay, I'm managing 4 classrooms for a computer school in Norway.

I'm in the ending stages of making a automated reinstall of every computer but I only have one "major" issue left,

I thought I might be able to solve it with AutoIt.

This is how my setup works:

Computer boots

NT Dual boot screen - Choose reinstall computer

A BartPE .iso file, located in C:\WINDOWS, starts up (bootdisk based on windows 2003 sp1)

The .iso file loads in to ram and starts up a mini version of windows

A network configuration tool starts up and is automated using AutoIT

Ghost starts up and transfers the image automaticly and reboots when it's done

The image is based on sysprep and a automated mini-setup starts up

At the end of the setup a bat file is called which maps a drive to the server, and calls another .bat file located on the server

This .bat file starts up uTorrent on the local machines (for transfering Microsoft courseware and minimize the load on the server)

The courseware is a compressed and a call to WinRAR automaticly extracts all data after it has been downloaded

The computer logs in automaticly the first time

utorrent found on www.utorrent.com is my current problem

1. It comes with a Messagebox saying This is freeware... and you have to push OK to proceed. Which I've solved with the following script :-) (I made it my self!! :) )

Run("C:\Program Files\utorrent\utorrent.exe /directory C:\temp t:\2277c.torrent")
WinWaitActive("µTorrent")
Send("{ENTER}")

And now to my problem (Thank you for bearing with me :( )

The program starts to download ~3 GB of data, and when it is completed i want to close the program.

I've taken a screenshot of the GUI, under Status it changes from Downloading to Seeding when it is completed.

This is what I get from the window:

Press CTRL-ALT-F to pause the display.

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: µTorrent 1.5

Class: µTorrent4823DF041B09

Size: X: 88 Y: 116 W: 578 H: 319

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 406 Y: 231

Cursor ID: 2

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFFFF Dec: 16777215

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 113 Y: 34 W: 457 H: 108

Control ID: 27

ClassNameNN: SysListView321

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

(1):

(2):

(3):

(4): DHT: 265 nodes

(5): D: 0.0 kB/s (total: 1.6 GB)

(6): U: 0.0 kB/s (total: 1.9 MB)

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

<Search Here>

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

What can I do to find out when it is completed? I noticed the statusbar text now, I might be able to check against the D: x.x kB/s to see when it is completed.

Can anyone help me out with either some directions/examples or if you can help me making the code. I will look more into AutoIt - this is an awesome tool!

Regards

aryx

Link to comment
Share on other sites

1

i noticed it has a very inhanced config / pref dialog

http://www.utorrent.com/screenshots/utorrent5.png

there are no settings not notify or close when complete??

2

if there is only one file to download.. maybe you could use

InetGet

--------------------------------------------------------------------------------

Downloads a file from the internet using the http or ftp protocol.

InetGet ( "URL" [,"filename" [, reload [, background]]] )

see help file

3

you can check the "Control Commands" in help for reading the SysListView321

example

Run("explorer ::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}")
WinWait("Scheduled Tasks","")
$CLVItem = ControlListView("Scheduled Tasks","","SysListView321","FindItem","PROFILE_CLEANUP")
ControlListView("Scheduled Tasks","","SysListView321","SelectClear")
ControlListView("Scheduled Tasks","","SysListView321","Select",$CLVItem)
ControlListView("Scheduled Tasks","","SysListView321","Select",$CLVItem)

good luck

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

1

i noticed it has a very inhanced config / pref dialog

http://www.utorrent.com/screenshots/utorrent5.png

there are no settings not notify or close when complete??

2

if there is only one file to download.. maybe you could use

InetGet

--------------------------------------------------------------------------------

Downloads a file from the internet using the http or ftp protocol.

InetGet ( "URL" [,"filename" [, reload [, background]]] )

see help file

3

you can check the "Control Commands" in help for reading the SysListView321

example

Run("explorer ::{D6277990-4C6A-11CF-8D87-00AA0060F5BF}")
WinWait("Scheduled Tasks","")
$CLVItem = ControlListView("Scheduled Tasks","","SysListView321","FindItem","PROFILE_CLEANUP")
ControlListView("Scheduled Tasks","","SysListView321","SelectClear")
ControlListView("Scheduled Tasks","","SysListView321","Select",$CLVItem)
ControlListView("Scheduled Tasks","","SysListView321","Select",$CLVItem)

good luck

8)

Yes, it is only one file i need to download.

1. It is one option for completed files and that is to move the finished file to a specified directory. So I guess one approch is to check a directory once every 30 secounds and check if the file is completed.

2. I'm using uTorrent to download the file to minimize the stress on the server. uTorrent is a program that lets clients download a file from a server and at the same time share it with the other clients. The load is greatly reduced by using this program.

So this option can't be used :-)

3.

This might be what I'm looking for, if I can read the data under the "Done" Column when it has reached 100.0 %

Link to comment
Share on other sites

Why don't you just add the original courseware to the Ghost images in the first place? Somehow I don't think that torrent transfer is the most effective way to get those file to all the machines, even with swarming technology.

Link to comment
Share on other sites

Why don't you just add the original courseware to the Ghost images in the first place? Somehow I don't think that torrent transfer is the most effective way to get those file to all the machines, even with swarming technology.

We have maaaany courses, each course is around ~5 GB of courseware data, if I wanted to make one image for each course it would take up lots and lots of data.

I compress them down to 2-3 GB, and let's say the ghost image is around 2 GB.

If I have 100 courses it would be 7 GB pr course (incl image) and have a total of 700 GB.

If I have 100 courses compressed to 2,5 GB it will be 250 GB + original image 252 GB.

see the diffrence?

I'm using utorrent to transfer the corseware because:

I have 50 computers, if they all connected to one server and started downloading at the same time it would take forever to download the courseware data.

When I'm using utorrent, they download some data from the server, and share it with the other clients, that way they download some parts of the file and share with the others.

And the download time is greatly reduced.

You see? :)

Link to comment
Share on other sites

From my vague memories of actually reading the Ghost Corporate Edition manuals all the way through, a few years ago, I recollect something like a simulcast broadcast environment where the server puts out a sequence of packets which the slave Ghost units all wait and listen and receive at the same time from the server and assemble their images locally. If any are corrupted or missed, it fixes that up later, otherwise the entire image only gets transmitted once across the network - a far smaller amount of traffic than what the handshaking any torrent software would involve. In a live corporate environment such as an university, that can make a substantial difference to existing users if you are rebuilding an entire classroom at once, and the transmit time doesn't increase exponentially based on the number of units being rebuilt - the more the better.

Come to think of it, Ghost compresses images as well, and takes care of the little foibles like changing the numbers so each machine is unique on the network when they reboot, etc. Designed by network administrators for use by network administrators.

It is worth contacting Symantec and evaluating the package - it has paid for itself thousands of times over in my experience - the right tool for the job you are describing!

(I've been using Ghost since before Symantec purchased it, when it was just a small NZ startup)

Link to comment
Share on other sites

  • 3 weeks later...

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