软件安装自动化

时间:2011-08-24 15:40:19

标签: java python windows deployment installer

我在计算机软件安装中心工作 - 我们的用户运行Windows。某些软件很难为新员工安装。我想使用Python或Java自动设置软件。我应该如何在设置对话框中填写信息并自动完成设置过程?

3 个答案:

答案 0 :(得分:1)

我使用pywinauto来自动化GUI,这也适用于安装表单。

答案 1 :(得分:1)

----编辑解决方案显然是在谈论Windows / MSI ----

MSI支持在命令行上传递配置参数。了解更多。除非他们正在做一些真正异国情调的事情,或者他们以故意忽略参数的方式打包程序,您可能会发现最好的解决方案就是在链接安装期间将参数放在命令行上。

----原帖如下----

首先,您需要知道要在哪种系统上安装软件。

然后你需要选择该系统默认的包管理系统,在Windows上它是MSI,许多Linux系统使用RPM(有些使用deb)等。

然后你需要看一下远程安装。几乎每个现代包管理器都支持一种或另一种远程安装技术。根据软件包管理器的不同,这可能涉及推送解决方案(将带有配置信息的软件包放入目录或使用接口发送),而其他解决方案则通过拉式解决方案进行管理。

如果使用pull解决方案,请安装每日作业以从特定资源中提取,然后您可以将系统转换为拉动解决方案(这通常会使管理变得更容易)。

稍后,您可能希望查看更具包容性的解决方案,例如如何在安装过程中向基础软件安装附加软件。对于您打算支持的每个操作系统,它都是不同的。

答案 2 :(得分:0)

如果要在Windows上自动执行对话框完成,AutoIt是可行的方法。出色的文档和支持,强大但可读的脚本语言,支持自定义GUI创建和脚本编译等

以下是使用AutoIt的WinZip安装示例:

; 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)")