Software install automation
I work at a computer so开发者_如何学Goftware installation center - our users run Windows. Some of the software is difficult to install for new employees. I would like to automate the setup of software using either Python or Java. How should I fill in the information in the setup dialogs and moving through the setup process automatically?
---- Edited as the solution is obviously talking about Windows / MSI ----
MSI supports the passing of configuration parameters on the command line. Look into it. Unless they are doing something truly exotic, or they packaged the program in a way that purposefully ignores the parameters, you might find that the best solution is just to put the parameters on the command line during your chained install.
---- Original post follows ----
First, you need to know what kind of systems you are installing software on.
Then you need to select the package management system that is the default for that system, on Windows it is MSI, many Linux systems use RPM (some use deb), etc.
Then you need to look at remote installation. Nearly every modern package manager supports one technique or another of remote installation. Depending on the package manager, this might involve push solutions (drop the package with configuration information into a directory or send it using an interface), while others are managed with a pull solution.
If using a pull solution, install a daily job to pull from a specific resource, and then you can convert the system to a pull solution (which generally makes management a bit easier).
Later on, you may want to look at more inclusive solutions, such as how to install additions to base software during the installation process. Again it's different for each operating system you intend to support.
I used pywinauto to automate GUIs, which should also work well for installation forms.
If you want to automate dialog completions on Windows, AutoIt is the way to go. Excellent documentation and support, a powerful but readable scripting language, support for custom GUI creation and script compilation, etc
Here is an WinZip installation example with AutoIt:
; Run the winzip installer
Run("winzip90.exe")
; Initial Setup Screen
WinWaitActive("WinZip® 9.0 SR-1 Setup", "&Setup")
Send("!s")
; Install location
WinWaitActive("WinZip Setup", "into the following folder")
Send("{ENTER}")
; Features overview
WinWaitActive("WinZip Setup", "WinZip features include")
Send("!n")
; License agreement
WinWaitActive("License Agreement")
Send("!y")
; Quick start
WinWaitActive("WinZip Setup", "Quick Start Guide")
Send("!n")
; Choose interface
WinWaitActive("WinZip Setup", "switch between the two interfaces")
Send("!c")
Send("!n")
; Installation type (custom/express)
WinWaitActive("WinZip Setup", "&Express setup (recommended)")
Send("!e")
Send("!n")
; Select file associations
WinWaitActive("WinZip Setup", "WinZip needs to associate itself with your archives")
Send("!n")
; Completed installation screen
WinWaitActive("WinZip Setup", "Thank you for installing this evaluation version")
Send("{ENTER}")
; Wait for winzip to load then close it
WinWaitActive("WinZip (Evaluation Version)")
WinClose("WinZip (Evaluation Version)")
精彩评论