FAQ
Let's say you have to install some program on a number of machines
(pcs and macs) - msoffice, adobe acrobat reader, norton antivirus,
etc. It's easy enough to have a python script start an install
program, but does python have any interface to allow you to
automatically run through an install program?

What I'm thinking would be needed is a kind of keyboard and mouse
entry macro recorder. For example, on 1st screen of install program,
press enter, 2nd screen, click on customize button, etc. The python
script would need to focus attention on the install program window and
send keystrokes and mouse clicks to it. Anyone have experience with
this? Any pointers to which modules I should look at? Or is there a
better way to run through install programs?

Thanks for any suggestions or ideas on what I should be looking at...

Search Discussions

  • Cameron Laird at Aug 1, 2001 at 11:42 pm
    In article <6b954971.0108011515.355c33a2 at posting.google.com>,
    Bela Evans wrote:
    Let's say you have to install some program on a number of machines
    (pcs and macs) - msoffice, adobe acrobat reader, norton antivirus,
    etc. It's easy enough to have a python script start an install
    program, but does python have any interface to allow you to
    automatically run through an install program?

    What I'm thinking would be needed is a kind of keyboard and mouse
    entry macro recorder. For example, on 1st screen of install program,
    press enter, 2nd screen, click on customize button, etc. The python
    script would need to focus attention on the install program window and
    send keystrokes and mouse clicks to it. Anyone have experience with
    this? Any pointers to which modules I should look at? Or is there a
    better way to run through install programs?

    Thanks for any suggestions or ideas on what I should be looking at...
    Excellent question!

    But the only answer I know is a depressing one. Install
    programs seem to be particularly backward in their script-
    ability (although uninstalls might be worse). Perhaps
    things have improved in the last few years; all it should
    take is minimal COM exposure. I would think the install
    vendors would want such for their *own* testing. I've
    rarely penetrated their armor, though.
    --

    Cameron Laird <claird at NeoSoft.com>
    Business: http://www.Phaseit.net
    Personal: http://starbase.neosoft.com/~claird/home.html
  • David Bolen at Aug 2, 2001 at 12:13 am

    bevans at wested.org (Bela Evans) writes:

    What I'm thinking would be needed is a kind of keyboard and mouse
    entry macro recorder. For example, on 1st screen of install program,
    press enter, 2nd screen, click on customize button, etc. The python
    script would need to focus attention on the install program window and
    send keystrokes and mouse clicks to it. Anyone have experience with
    this? Any pointers to which modules I should look at? Or is there a
    better way to run through install programs?
    You should be able to automate your way with FindWindow/SendMessage
    and a few other Win32 API functions that are wrapped by the win32all
    package, but to be honest, it's probably easier to just use an
    existing macro utility.

    There are some commercial ones, but there is also Scriptit (Microsoft,
    not sure of URL) and AutoIt (http://www.hiddensoft.com/AutoIt), the
    latter of which we use. It's a separate executable, but we have
    Python scripts that dynamically write the AutoIt scripts and then run
    AutoIt on them via popen(). Works just fine for those cases where
    there's no other convenient API.

    Any GUI automation is a little risky in case something goes wrong or
    the GUI becomes ambiguous, so you have to look at specific cases that
    you need to automate. And some things are annoyingly un-automatable,
    such as when you find VB apps that have no window text that you can
    search for or key off of.

    I had communicated with the AutoIt author a while back offering to
    write a Python wrapper if he'd expose source but he declined. He was
    in theory going to provide a DLL (which could be wrapped without
    source) with his new C++ rewrite version but I haven't seen that
    released yet. AutoIt does have an ActiveX control, so if you don't
    mind ensuring it's registered, you should be able to automate it
    through win32com.

    But even as a standalone it works just fine for what we needed.

    --
    -- David
    --
    /-----------------------------------------------------------------------\
    \ David Bolen \ E-mail: db3l at fitlinxx.com /
    FitLinxx, Inc. \ Phone: (203) 708-5192 |
    / 860 Canal Street, Stamford, CT 06902 \ Fax: (203) 316-5150 \
    \-----------------------------------------------------------------------/
  • Dennis Voss at Aug 5, 2001 at 3:52 pm

    Bela Evans wrote:
    Let's say you have to install some program on a number of machines
    (pcs and macs) - msoffice, adobe acrobat reader, norton antivirus,
    etc. It's easy enough to have a python script start an install
    program, but does python have any interface to allow you to
    automatically run through an install program?

    What I'm thinking would be needed is a kind of keyboard and mouse
    entry macro recorder. For example, on 1st screen of install program,
    press enter, 2nd screen, click on customize button, etc. The python
    script would need to focus attention on the install program window and
    send keystrokes and mouse clicks to it. Anyone have experience with
    this? Any pointers to which modules I should look at? Or is there a
    better way to run through install programs?

    Thanks for any suggestions or ideas on what I should be looking at...
    Some (if not all) setup programs do support an automatic install (defaults)
    with a special command line switch.
    This goes for Windows machines. You should also be able to use some
    Microsoft thingie. Your task is pretty common among NT Admins.

    This situration is different on Macs however. But if I remember that
    correctly, you can simply copy the folder !

    Dennis

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedAug 1, '01 at 11:15p
activeAug 5, '01 at 3:52p
posts4
users4
websitepython.org

People

Translate

site design / logo © 2022 Grokbase