Windows上带有参数的静默运行安装程序(.exe) [英] Silent run installer (.exe) with parameters on Windows

查看:942
本文介绍了Windows上带有参数的静默运行安装程序(.exe)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows安装文件(.exe),该文件用于安装软件.这是第三方可执行文件.在安装过程中,它需要某些值并具有UI. 我想以静默方式运行此setup.exe,而无需任何手动干预(即使是为了提供参数值). 在花了一些时间研究该方法之后,我觉得powershell应该可以帮助我满足我的要求. 谁能说出Powershell是适合此功能的工具,还是存在一种更好的工具来满足这一要求? 可以使用python来实现此要求吗?

I have a windows setup file (.exe), which is used to install a software. This is a third party executable. During installation, it expects certain values and has a UI. I want to run this setup .exe silently without any manual intervention (even for providing the parameter values). After spending some time googling about the approach, I feel powershell should be able to help me with my requirements. Can anyone suggest if powershell would be the right tool for this, or does a better tool exists to get this requirement? Can python be used to implement this requirement?

请注意:由于这是第三方可执行文件,因此我没有安装期间必须向UI提供值的参数的名称

Please note: Since this is a third party executable, I don't have the names of the parameters for which values must be provided to the UI during installation

谢谢

推荐答案

部署 :请注意,并非总是可以在完全控制的情况下静默运行setup.exe参数设置并具有可靠的静默运行.这取决于安装程序的设计方式.在这种情况下,我通常会采用重新包装的方式-下文对此进行了详细说明.

Deployment: Note that it is not always possible to run a setup.exe silently with full control of parameters and with reliable silent running. It depends on how the installer was designed. In these cases I normally resort to repackaging - some more detail below on this.

一些有关部署的一般提示:

Some general tips for dealing with deployment:

  1. 软件库提示 :也许尝试查找该软件,看看是否有人为静默安装和部署处理过该软件: https://www.itninja.com/software

  1. Software Library Tip: Maybe try to look up the software to see if others have dealt with it for silent installation and deployment: https://www.itninja.com/software

提取文件 :这是嵌入式MSI(Windows安装程序)文件还是旧式setup.exe?也许先尝试提取文件: 以编程方式提取内容InstallShield setup.exe (Installshield setup.exe文件).更详细的细节:

Extract Files: Is this an embedded MSI (Windows Installer) file or a legacy style setup.exe? Maybe try to extract the files first: Programmatically extract contents of InstallShield setup.exe (Installshield setup.exe files). More elaborate details:

  • How to run an installation in /silent mode with adjusted settings (extraction of non-Installshield setup.exe files - for example Advanced Installer or WiX setup.exe files)
  • Extract MSI from EXE

Setup.exe :仅为了完整性而添加.您可以在命令行中尝试 setup.exe /? setup.exe /help 或类似工具,以检查exe中的嵌入式帮助.

Setup.exe: Just adding for completeness. You can try setup.exe /? or setup.exe /help or similar at the command line to check for embedded help in the exe.


MSI转换 :如果在setup.exe中发现并嵌入了MSI文件,则可以以标准化方式自定义安装参数.此处的详细信息: 如何更好地利用MSI文件 .轻量级定制是通过命令行进行的,轻量级定制是通过 transforms 进行的.


MSI Transforms: If you discover and embedded MSI file in the setup.exe, then you can customize the installation parameters in a standardized way. details here: How to make better use of MSI files. Light weight customization is by command line, heavy weight customization via transforms.

旧版Setup.exe :旧版 setup.exe 通常是使用 NSIS 很少有其他非MSI设置创作工具.每个人都有自己的命令行怪癖.这是一些示例的旧资源: http://unattended.sourceforge.net/installers.php.

Legacy Setup.exe: Legacy setup.exe are often created with Inno Setup, NSIS, or a few other non-MSI setup authoring tools. Each with their own quirks for command line. Here is an old source for some samples: http://unattended.sourceforge.net/installers.php.

重新打包 :公司用户经常重新打包这些旧的setup.exe文件,并将其转换为 MSI App-V 软件包(或全新的 MSIX 格式).关于重新包装的主题,以及关于PowerShell和 Windows Installer PowerShell模块的可用性的文章: 如何使用Powershell来运行通过安装程序? .

Repackaging: Corporate users often repackage such legacy setup.exe files and turn them into MSI or App-V packages (or the brand new MSIX format). On the topic of repackaging and also a piece on PowerShell and the availability of Windows Installer PowerShell Modules: How can I use powershell to run through an installer?.

一些其他链接 :

Some Further Links:

  • How to create windows installer
  • System Administrator deployment tools, including repackaging tools

这篇关于Windows上带有参数的静默运行安装程序(.exe)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆