在Windows上,不需要管理员权限就可以安装到哪些标准位置? [英] On Windows, which standard locations can I install to without needing admin permissions?

查看:42
本文介绍了在Windows上,不需要管理员权限就可以安装到哪些标准位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序当前将文件写入其安装目录,这意味着程序文件"不是有效的选项(我知道这不是理想选择).但是我也希望安装程序(Inno)不需要管理员权限,即没有UAC;我认为Google Chrome可以做到这一点.

My application currently writes files to its installation directory which means Program Files isn't a valid option (I know this isn't ideal). But I would also prefer my installer (Inno) not to require admin rights i.e. no UAC; I think Google Chrome does this.

在记住这两个限制的情况下,默认使用哪个公共位置是合理的?

Which common location would make sense to default to with both these restrictions in mind?

推荐答案

如果您确实要制作不需要管理员权限的每用户安装程序,则要使用的正确设置是:

If you really want to make a per-user installer that does not require admin permissions, the correct settings to use are:

[Setup]
PrivilegesRequired=lowest
DefaultDirName={userpf}\YourAppName

请注意(解决了Glytzhkof的问题),这是本地文件夹,而不是漫游文件夹.如果要漫游设置,则仍然需要您的应用程序将其保留在 {userappdata} \ YourAppName 文件夹中(与您的语言等效).无论如何,用户都必须在打算使用该软件的每台计算机上分别安装该软件(但这通常是最好的选择).

Note that (addressing Glytzhkof's concerns) this is a local folder, not a roaming folder. If you want settings to roam then you will still need your application to keep them in (your language's equivalent of) the {userappdata}\YourAppName folder. Regardless, the user will have to separately install the software on each machine that they intend to use it on (but this is typically the best option anyway).

制作每个用户应用程序的一些缺点是:

Some of the downsides of making a per-user application are:

  1. 安装时不能使用管理员权限.特别是,这意味着您无法安装可能要在应用程序中使用的许多其他组件(运行时,库等).您也不能使用 regserver restartreplace 之类的功能.(这并不一定意味着您仍然不能使用这些组件,只是如果用户尚未安装这些组件,则麻烦会更大.)

  1. You cannot use admin permissions when installing. In particular this means that you cannot install many other components (runtimes, libraries, etc) that you might have wanted to use in your application. You also can't use features like regserver and restartreplace. (This doesn't necessarily mean that you cannot still use these components, just that it's a larger hassle if the user does not already have them installed.)

如果一台计算机上有多个用户(家庭和某些工作场所常见),那么他们将有重复的独立应用程序副本,每个用户都必须分别对其进行升级.这尤其使IT部门感到恼火,因为他们喜欢进行集中升级,如果您的应用很大,可能会浪费磁盘空间.

If a single machine has multiple users (common for families and in some workplaces) then they will have duplicate independent copies of your application, which have to be individually upgraded by each user. This particularly annoys IT departments as they prefer doing central upgrades, and if your app is large it may waste disk space.

如果您不想创建一个普通的基于 {pf} 的应用程序的原因仅仅是想变得懒惰并将设置文件存储在该程序的文件夹中,那么总体上来说可能会更好重新考虑这个决定.正确"做到这一点并不难.

If the reason you don't want to make a normal {pf} based application is simply that you want to be lazy and store settings files in the program's folder, then it's probably better overall to rethink this decision. It's not hard to do it "right".

这篇关于在Windows上,不需要管理员权限就可以安装到哪些标准位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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