在Windows批处理文件静默安装numpy.exe [英] install numpy.exe silently with batch file in windows
问题描述
我想创建一个批处理文件,帮助多个用户Windows共享驱动器上安装numpy的。基本上,用户不应该输入选项或全部执行任何操作(因为他们如果他们双击该numpy的可执行安装程序)。
I want to create a batch file that helps multiple users install numpy on a Windows shared drive. Basically, users should not have to input options or perform any actions at all (as they would if they double-clicked the numpy executable installer).
一个Python的安装已经present 。用户有只运行批处理文件,并安装numpy的到默认的Python \\ LIB \\站点包
位置。
A Python installation is already present. The users have to just run the batch file and install numpy into the default Python\Lib\site-packages
location.
我用下面的命令尝试:
numpy-1.6.1-win32-superpack-python2.7.exe /qn
numpy-1.6.1-win32-superpack-python2.7.exe /quiet
numpy-1.6.1-win32-superpack-python2.7.exe /passive
在所有的情况下,该批处理文件在同一目录中的可执行文件和那里的用户点击下一步一次又一次的图形窗口弹出。有没有一种方法来运行所有默认选项安装,并没有用户交互?
In all cases, the batch file is in the same directory as the executables and a graphical window pops up where the user has to click 'Next' again and again. Is there a way to run the install with ALL default options and not have user interaction?
推荐答案
这似乎是numpy的安装过程实际上是使两个安装程序中。外一种是NSIS,而内部是Python的distutils安装程序。所有NSIS安装有 / S
对于无提示安装,但是这种NSIS安装调用的distutils安装程序。
It seems like the numpy install process is actually make of two installers. The outer one is NSIS, while the inner is python's distutils installer. All NSIS installers have the /s
for silent installs, but this NSIS installer invokes the distutils installer.
不幸的是,似乎没有成为Distutils的安装程序的无声标志。我只看到两个明显的选择:
Unfortunately, there doesn't seem to be any silent flags for the distutils installer. I see only two obvious options:
- 编译numpy的自己,使它散发出MSI安装程序(因此,应该能够默默的安装)。使用
蟒蛇setup.py bdist_msi
。如果preFER,您可以使用生成NSIS封装 bdist_nsi 。 - 使用类似的AutoIt 以自动化的distutils安装程序。只需等待disutils窗口出现&安培;发送一系列的键盘快捷键来自动安装。
- compile numpy yourself and make it emit an msi installer (thus, should be able to silently be installed). Use
python setup.py bdist_msi
. If you prefer, you can generate an NSIS package using bdist_nsi. - Use something like AutoIt to automate the distutils installer. Simply wait for the disutils window to appear & send it a series of keyboard shortcuts to automate the install.
后者似乎是更实用的解决方案。您也可以尝试让蟒蛇开发者获得一个无声的标志进入的distutils安装...
The latter seems like the more practical solution. You could also try to get the python devs to get a silent flag into the distutils installer...
这篇关于在Windows批处理文件静默安装numpy.exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!