从 PHP 启动客户端计算机上的文件?

发布于 2024-10-03 08:37:01 字数 140 浏览 6 评论 0原文

我编写了一个实用程序,需要安装密钥才能卸载,以确保只有授权用户才能卸载。登录我们的网站后,用户将看到一个卸载密钥,但我还想在客户端计算机上启动卸载向导。我知道这是可能的,因为我以前做过......只是不记得代码,也没有保存它。

预先感谢您的任何意见。

I have written a utility that requires an installation key for uninstallation to ensure that only authorized users are uninstalling. After logging in to our website, the user will be presented with a uninstallation key, but then I would like to also launch the uninstallation wizard on the clients computer. I know this is possible, as I've done it before... just don't remember the code, nor did I save it.

Thanks in advance for any input.

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

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

发布评论

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

评论(2

暮光沉寂 2024-10-10 08:37:01

PHP 运行在服务器端,对客户端没有任何控制权。出于安全原因,您也不能使用 JavaScript 来启动应用程序。

执行此操作的唯一方法是使用 ActiveX 控件或某种自定义浏览器插件。或者,如果您的卸载向导已在客户端上注册了某个协议处理程序(例如 myuninstall://),那么您可以使用 JavaScript 将用户重定向到该协议的 URL,然后该协议将启动你的程序。

PHP runs on the server-side and has no control over the client whatsoever. Neither can you use JavaScript to launch applications due to security reasons.

The only way you could do this is by using an ActiveX control or some kind of custom browser plugin. Or, if your uninstall wizard has registered some protocol handler on the client (say myuninstall://) then you could use JavaScript to redirect the user to a URL of this protocol, which will in turn then launch your program.

极致的悲 2024-10-10 08:37:01

假设使用 Windows,您可以告诉安装程序注册自定义 URL 协议 使用自定义卸载方案。然后,您的 php 应用程序可以使用自定义 URL 方案 (uninstall-my-product://12345678-ABCD) 呈现一个链接。

没有卸载程序的用户会看到“我不知道如何处理此协议”消息。安装了您的产品的用户将启动卸载程序。

您可以通过提供已注册的文件类型来打开卸载程序来完成类似的功能。

如果您使用的是商业安装程序,那么在这两种情况下,编写一个小启动器应用程序来运行卸载程序可能会更容易,而不是修改卸载程序本身。

Assuming Windows, you could tell your installer to register a custom URL protocol with a custom scheme for uninstallation. Then your php app could present a link using the custom URL scheme (uninstall-my-product://12345678-ABCD).

Users without your uninstaller would see an "i don't know what to do with this protocol" message. Users who had installed your product would launch the uninstall program.

You could accomplish a similar function by delivering a file type which was registered to open the uninstall program.

If you're using a commercial installation program, then in both cases it would probably be easier to write a little launcher application to run the uninstaller, rather than modifying the uninstaller itself.

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