简体   繁体   English

我如何从cygwin ssh运行win32 gui程序?

[英]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.

相关问题 如何在不显示Win32 GUI程序的控制台窗口的情况下执行子控制台程序? - How to execute child console programs without showing the console window from the Win32 GUI program? 如何从另一个C ++ win32控制台应用程序调用C ++ Win32 DLL - How Can I call a C++ Win32 DLL from another C++ win32 Console Application 我怎么知道窗口是否属于我的程序? 仅使用win32 - How can I know if a window belongs to my program? Using win32 only 从头开始编写Win32安装程序 - Program win32 installer from scratch 如何在特定的本地时间运行Delphi Win32应用程序? - How can I run a Delphi Win32 application with a specific local time? 如何设置Win32对话框的大小(以像素为单位)? - How can I set the size of a Win32 dialog in pixels? 如何在 Win32 中用一行连接 2 个文本框? - How can I connect 2 text boxes with a line in Win32? 如何在Win32中自定义选项卡控件的外观? - How can I customize the appearance of the tab control in Win32? 在Win32中删除子文件夹本身之前,如何从文件夹和子文件夹中删除文件? - How can I delete files from folders and subfolders before deleting the subfolders themselves in Win32? 如何从C代码(Win32)生成RFC1123 Date字符串 - How can I generate an RFC1123 Date string, from C code (Win32)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM