[英]How can I run a win32 gui program from cygwin ssh?
I have an (nsis) installer that I am running in silent mode. 我有一个以静默方式运行的(nsis)安装程序。 I'd like to run it via ssh so that I can automatically run our test suite against the installed codebase.
我想通过ssh运行它,以便可以针对已安装的代码库自动运行测试套件。 Unfortunately when I run the program it just starts and sits there and doesn't actually do anything.
不幸的是,当我运行程序时,它只是启动并坐在那里,实际上并没有执行任何操作。
My guess is that this is somehow due to windows services (which ssh is in this case) cannot interact with the desktop. 我的猜测是,这是由于Windows服务(在本例中为ssh)无法与桌面进行交互所致。 So even though the installer is silent it allocates some object or something and blocks forever.
因此,即使安装程序处于静默状态,它也会分配一些对象或东西并永远阻止。
How can I force the installer to run? 如何强制安装程序运行? Note that it is silent and should not ask for any user input.
请注意,它是静默的,不应要求任何用户输入。 Is there a way I can say, "run this on a desktop" or something?
有什么办法可以说“在桌面上运行”吗?
Try using PsExec from Sysinternals. 尝试使用Sysinternals中的PsExec 。 If you're going to be executing it on the remote machine through ssh, make sure to run it once from the desktop so you can accept the license terms.
如果要通过ssh在远程计算机上执行它,请确保从桌面运行一次,以便您接受许可条款。
Something like PsExec.exe -i -s "full path to program" args
should work. 像
PsExec.exe -i -s "full path to program" args
应该起作用。 -i
runs the program in interactive mode on the desktop, and -s
runs it under the "system" user so you don't have to punch in user credentials. -i
在桌面上以交互方式运行该程序,而-s
在“系统”用户下运行该程序,因此您无需输入用户凭据。
I had a similar problem trying to launch an interactive program on my 64 bit win 7 machine. 尝试在64位win 7机器上启动交互式程序时,我遇到了类似的问题。
Machines intending to launch programs remotely: Win 8, Ubuntu 打算远程启动程序的机器:Win 8,Ubuntu
Machine running cygwin sshd: win 7 机器运行cygwin sshd:Win 7
Cygwin sshd is owned by "cyg_server" and not a local user, so I could not check the box "allow service to interact with desktop" (although I heard that checkbox doesn't work anyway). Cygwin sshd由“ cyg_server”拥有,而不是本地用户,因此我无法选中“允许服务与桌面交互”框(尽管我听说此复选框仍然无法正常工作)。
I solved this problem in a very ugly unelegant way. 我以一种非常丑陋,毫无意义的方式解决了这个问题。 I used tmux, which is now available on cygwin.
我使用了tmux,现在可以在cygwin上使用。 On the win7 box I launch a tmux session called "launcher" on bootup.
在win7机器上,我在启动时启动了一个名为“ launcher”的tmux会话。
Later, when I ssh in from another box I send commands to the tmux session. 稍后,当我从另一个盒子中插入时,我将命令发送到tmux会话。 The tmux session is a local user, so it will launch programs interactively.
tmux会话是本地用户,因此它将以交互方式启动程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.