选择正确的Windows目录以安装软件并允许自动更新 [英] Choose right Windows directory to install software and allow auto-updates

查看:65
本文介绍了选择正确的Windows目录以安装软件并允许自动更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为Windows工具编写安装程序.由于我们的工具使用更新程序(wyUpdate),因此我们希望没有管理员权限的用户可以执行更新.将应用安装到哪个正确的目录?标准的C:\Program Files需要管理员权限,因此我们放弃了此选项.在网上阅读了一些内容之后,我们选择了AppData,即C:\Users\USERNAME\AppData\Local.

We are writing an installer for our Windows tool. As our tool uses an updater (wyUpdate) and we want that users WITHOUT Administator rights can performs updates. Which is the right directory to install the app to? The standard C:\Program Files requires Administrator rights, so we have discarded this option. After reading a bit on the Web, we have chosen AppData, i.e. C:\Users\USERNAME\AppData\Local.

这是最佳做法吗?还是应该使用其他目录?

Is this best practice? Or should we use another directory?

推荐答案

  • 如果不想让您的用户弄乱已安装的程序,则必须将其安装到需要管理员权限的文件夹中.

    • If you do not want to allow your users to mess with the installed program, you have to install it to a folder that needs Administrator privileges.

      要允许此类应用程序的自动更新,您需要开发/安装以管理员权限运行的服务,该服务将更新安装.这就是Windows Update,Mozilla维护服务,Google Chrome海拔服务,Adobe Acrobat更新服务和类似服务的作用.

      To allow an automatic update of such application, you need to develop/install a service that runs with Administrator privileges, which will update the installation. This is what Windows Update, Mozilla Maintenance Service, Google Chrome Elevation Service, Adobe Acrobat Update Service and similar services do.

      如果您不想实施一项服务,但希望该应用程序供计算机的所有用户使用,则需要将其安装到所有用户都可以访问的文件夹中,但并不需要需要管理员权限.例如,您可以使用C:\Users\Public.另请参见 Windows中是否存在非提升权限用户对其具有写访问权的共享文件夹?.您可以使用PUBLIC环境变量来解析该路径.

      If you do not want to implement a service, but you want the application to be used by all users of the machine, you need to install it to a folder that can be accessed by all users, yet does not need Administrator privileges. You can for example use C:\Users\Public. See also Is there a shared folder in Windows to which non-elevated users have write access?. You can use PUBLIC environment variable to resolve that path.

      如果该应用程序仅由一个用户使用,则可以使用C:\Users\Username\AppData\Local

      If the application is to be used by one user only, then you are ok with using C:\Users\Username\AppData\Local{userappdata} in Inno Setup.

      相关问题:在没有管理员特权的情况下使用.NET框架部署应用程序

      这篇关于选择正确的Windows目录以安装软件并允许自动更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆