简体   繁体   English

如何在没有管理权限的情况下为我的应用程序实现自动更新

[英]How to implement Auto-Updates for my Application without Administration Rights

I maintain a large Windows C++ Application that installs with nullsoft nsis . 我维护着一个大型Windows C ++应用程序,该应用程序与nullsoft nsis一起安装。 Installation is quick and simple (less than 1 minute). 安装快速简便(不到1分钟)。

Some users in large companies do not have administration privileges and they have to order costly 3rd party services to update their installation. 大型公司中的某些用户没有管理特权,因此必须订购昂贵的第三方服务才能更新其安装。 Therefore some of them only update once a year, while we ship every month and sometimes fix important bugs etc. 因此,其中一些仅每年更新一次,而我们每个月都会发货,有时还会修复重要的错误等。

So we are thinking about automatic updates that do not require elevated administration rights. 因此,我们正在考虑不需要提升管理权限的自动更新。 Mozilla and Adobe do this as well as others. Mozilla和Adobe以及其他公司也可以做到这一点。 As far as i can see an the Mozilla XULRunner site they install a service which then in turn can run a update without forcing the user to enter a administration password. 据我所看到的Mozilla XULRunner网站,他们安装了一项服务,该服务随后可以运行更新而不会强迫用户输入管理密码。 I also found Googles Omaha but it is not clear about the administrator privileges ("Support for restricted user environments; for example, users without administrator privileges "..."This requires the user has administrator privileges."). 我还找到了Google的Omaha,但尚不清楚管理员权限(“支持受限的用户环境;例如,没有管理员权限的用户“ ...”,这要求该用户具有管理员权限。”)。

So far i have not found exact answers to these questions: 到目前为止,我还没有找到这些问题的确切答案:

  • What steps do we have to take in order to establish such a mechanism? 为了建立这样的机制,我们必须采取什么步骤?
  • Can we keep on with nsis? 我们可以继续使用nsis吗?
  • What server infrastructure is requested? 请求什么服务器基础架构?

Your application should check for updates on your server/website and get the download link. 您的应用程序应在服务器/网站上检查更新,并获得下载链接。 This should be pretty easy if you maintain a text file/page with fixed hyperlink. 如果您维护带有固定超链接的文本文件/页面,这应该非常容易。 This hyperlink can be hard-coded in your application. 此超链接可以在您的应用程序中进行硬编码。 If it detects a version newer than the current version then download the files. 如果它检测到的版本比当前版本新,请下载文件。 Along with these files there should be instructions for which files to replace and Which files are to be added at what location, etc. 除了这些文件之外,还应该指示替换哪些文件以及要在什么位置添加哪些文件等。

Now whether or not you need admin privileges depends on where you need to place the updated files. 现在,是否需要管理员权限取决于您放置更新文件的位置。 If the target folder has some restrictions then it would be difficult to update in the same session. 如果目标文件夹有一些限制,那么将很难在同一会话中进行更新。 So you may have to launch a dummy exe which asks the user for admin privileges during startup. 因此,您可能必须启动虚拟exe,该虚拟exe在启动过程中向用户询问管理员权限。 Now you can copy the updated files to your desired location without much pain. 现在,您可以轻松地将更新的文件复制到所需的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM