如何检查Windows用户是否可以安装应用程序?或者 Windows 计算机是域的成员吗?
我正在我们公司内部使用的应用程序中重新实现自动更新机制。 旧系统使用基于 .exe 的安装程序,我必须将其替换为可以在 Windows 域中工作的基于 .msi 的安装程序。我已经做到了这一点并且效果很好。
我们总部的大部分用户都是windows域的成员,但也有很多远程用户不在域中。对于域中的用户,我们自动分发更新。远程用户应使用应用程序内置的自动更新机制。
所以,问题是: 如何检查Windows用户是否可以在他的机器上安装应用程序? 或者 如何检查运行Windows的计算机是否是域的成员?
(我使用Borland C++ 6进行开发)
I am re-implementing auto-update mechanism in an application for internal use in our company.
The old system used .exe based installers, which I had to replace with .msi based installer which can work in a Windows Domain. This I have done and works well.
Most of users in our headquarter are members of windows domain, but there are many users in remote locations which are not in the domain. For the users in domain we distribute updates automaticly. The remote users shoud use the auto-update mechanism build into the application.
So, the question is:
How to check if windows user can install applications on his machine?
or
How to check if a computer runing windows is a member of a domain?
(I use Borland C++ 6 for development)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果用户不允许/无法安装,为什么不简单地运行 .msi 并让它报告自己的错误呢?检查当前用户的凭据并不真正可靠,特别是当您考虑 UAC 时,这将允许用户有机会临时登录具有域权限的提升帐户来运行 .msi(如果需要)。
Why not simply run the .msi and let it report its own errors if the user is not allowed/capable of installing? Checking the current user's credentials is not really reliable, especially when you take UAC into account, which would allow the user a chance to temporary log into an elevated account with domain privileges to run the .msi if it requires that.