电源外壳 |将鼠标移至坐标并单击左键

发布于 2025-01-13 21:51:32 字数 266 浏览 7 评论 0原文

我正在设置一个非常旧的软件的自动部署。它太旧了,没有静默安装选项。我已经使用 ProcessExplorer 检查了安装程序,并确认字符串中没有静默开关。为了解决这个问题,我手动安装组件。

我的目标是让我的部署软件调用 PowerShell 脚本,该脚本调用安装程序,然后将鼠标移至下一个按钮,并像最终用户一样完成操作。我已经让部署软件执行准备步骤并调用程序安装程序。它将需要一些等待函数来考虑不同计算机之间的不同处理时间。它需要能够处理在具有不同尺寸屏幕的计算机上调用的脚本。

这可能吗?

I am setting up an automated deployment of a very old software. It's so old that there is no silent install option. I've checked the installer with ProcessExplorer and confirmed there were no silent switches in Strings. To get around this, I am installing the components manually.

My goal is to have my deployment software call a PowerShell script which calls the installer, then moves the mouse to the next button, and goes through the motions as an end-user would. I already have the deployment software performing the preparation steps, and calling the program installer. It will need some wait functions to account for different processing times among different computers. And it would need to be able to handle the script being called on computers with different sized screens.

Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪#恶を代价 2025-01-20 21:51:33

正如已经评论过的 - 使用鼠标并不那么容易,因为需要使其在不同的计算机上工作(屏幕尺寸......)。
如果需要 PowerShell,您可以尝试使用发送密钥:

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("%n{TAB}{ENTER}")

来源:发送密钥Powershell alt+n {TAB} {ENTER}

我知道软件部署工具(例如 baramundi)可能具有内置脚本功能来自动化类似的操作,但您可以构建自己的应用程序来帮助您随着您的安装。
使用 Autoit,如果您的安装程序兼容,您可以创建几乎无懈可击的安装程序。只需获取 Autoit,尝试是否可以使用“AutoIt Window Info”中的查找工具(尝试 x86 和 x64)。如果它可以直接“找到”您的按钮,您需要等待该窗口和该按钮,然后使用 controlClick 函数按下它: https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm

第三种方法 - 特别是对于旧软件的最佳解决方案 - 取决于安装您可以构建自己的安装程序。在某些情况下,复制必要的文件夹、文件和注册表项可能就足够了。对于其他情况,您可以使用 Procmon 监视安装过程并执行正常安装期间发生的其他操作。
https://learn.microsoft.com/en-us/sysinternals/downloads/过程监控
另外,在尝试和错误部署中使用 Procmon 对您来说可能就足够了。只需从工作客户端复制安装,尝试启动应用程序,阅读错误消息,并借助您在 procmom 中看到的发生/失败的操作来解决该问题。

As already commented - using a mouse won't be that easy with the requirement to make it work on different computers (screen size...).
If PowerShell is required, you might try to use send keys:

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("%n{TAB}{ENTER}")

Source: Send Keys in Powershell alt+n {TAB} {ENTER}

I know software deployment tools (baramundi for example) might have built-in scripting capabilities to automate something like that, but you can built your own application that helps you with your installation.
With Autoit you can create almost bulletproof installer if your installer is compatible. Just get Autoit, try if you can use the finder tool within "AutoIt Window Info" (try both x86 and x64). If it can directly "find" your buttons, you need you can wait for that window, and that button and then press it with controlClick function: https://www.autoitscript.com/autoit3/docs/functions/ControlClick.htm

Third way - the best solution especially for old software - depending on the installation routine you might build your own installer. In some cases, copying the necessary folder, files, and registry entries might be enough. For other cases you might monitor your installation process with Procmon and do the other things that happen during normal installation.
https://learn.microsoft.com/en-us/sysinternals/downloads/procmon
Also using Procmon in a try and error deployment might be enough for you. Just copy the installation from a working client try to start the application, read the error message, and solve that with the help of actions you see that happened/failed in procmom.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文