软件安装自动化

2024-05-23 17:37:14 发布

您现在位置:Python中文网/ 问答频道 /正文

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


Tags: 用户信息软件过程windows员工java中心
3条回答

{a1}也可以用来自动安装GUIs。在

如果您想在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)")

因为解决方案显然是在讨论Windows/MSI

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

原文如下

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

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

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

如果使用拉式解决方案,请安装一个从特定资源中提取的日常作业,然后可以将系统转换为拉式解决方案(这通常会使管理更容易一些)。在

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

相关问题 更多 >