gpt4 book ai didi

installation - 为什么 Chocolatey 不将软件包安装到 `C:\Program Files\` 中?

转载 作者:行者123 更新时间:2023-12-04 02:14:55 25 4
gpt4 key购买 nike

根据 Windows 安装规则,程序应安装到C:\Program Files (64 位程序/x86-64)或 C:\Program Files (x86) (32 位程序/x86)。程序被复制到包含供应商名称和程序名称的子文件夹中。

但是为什么 Chocolatey 不将软件包安装到 C:\Program Files\<Vendor>\<Program>\ ?

10. Apps must install to the correct folders by default
Users should have a consistent and secure experience with the default installation location of files, while maintaining the option to install an app in the location of their choice. It is also necessary to store app data in the correct location to allow several people to use the same computer without corrupting or overwriting each other's data and settings. Windows provides specific locations in the file system to store programs and software components, shared app data, and app data specific to a user

10.1 Your app must be installed in the Program Files folder by default
For native 32-bit and 64-bit apps in %ProgramFiles%, and %ProgramFiles(x86)% for 32-bit apps running on x64. User data or app data must never be stored in this location because of the security permissions configured for this folder.



来源: Certification requirements for Windows desktop apps
版本:10(2015 年 7 月 29 日)

最佳答案

这取决于您的 Chocolatey 版本、设置和软件包本身。

To start, see Tools vs Applications and Chocolatey's distinction ( https://github.com/chocolatey/chocolatey/wiki/ChocolateyFAQs at the bottom).

If the package does not use a native installer (a tool), it depends on if the package author has used the bin_root concept that is up and coming in a future version.

For example, SysInternals will go to c:/sysinternals right now unless you have a defined $env:chocolatey_bin_root variable. The concept in the code will change as well as right now this requires it to be a subfolder of the system drive and I don't see us developing the final feature with that limitation.

If the package doesn't have that concept yet, one can always ask the package author to incorporate it.

If the package uses a native installer (an application), one can use installArgs to pass arguments to the native installer (https://github.com/chocolatey/chocolatey/wiki/CommandsInstall) and tell it the directory to install the application to. This does require you to know what you need to pass to the native installer. If you want your applications in a custom directory, there is an assumption that you are already an advanced user so it is expected that you would know what to pass the installer if you were doing a silent install.



稍微转述自: https://groups.google.com/forum/#!msg/chocolatey/uucAz8GxebA/HEPAKp69d90J

还有,

NOTICE: As of 0.9.8.24, Chocolatey's default install location is C:\ProgramData\Chocolatey

This reduces the attack surface on a local installation of chocolatey and limits who can make changes to the directory.



来源: https://github.com/chocolatey/chocolatey/wiki/DefaultChocolateyInstallReasoning

从个人经验来看,我可以证明这个概念是一道极好的防线(如果配置、使用和理解正确的话)。

PS:
正如您已经在答案中添加的那样,从技术上讲,要求是 %ProgramFiles%%ProgramFiles(x86)%环境变量(适用时)。
例如, %ProgramFiles(x86)%也可以指向 P:\Software\Programs\x86\ (而不是 C:\Program Files (x86)\ )。
显然有很多遗留软件(现在(重新)打包)从未使用过 <vendor>路径名中的部分。

希望这有帮助!

关于installation - 为什么 Chocolatey 不将软件包安装到 `C:\Program Files\` 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32594832/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com