Windows 7 中的可执行文件应该安装到哪里?

发布于 2024-09-15 15:13:17 字数 176 浏览 2 评论 0原文

我目前正在开发我的应用程序安装程序,我想知道可执行文件应安装在 Windows 7 中的何处。

如果我以管理员身份安装,我的可执行文件将放置在 C:\Program Files 中。

如果我以普通用户身份安装我的产品,可执行文件应该放在哪里?

提前致谢。

I'm currently working on my applications installer and I'm wondering where the executable files should be installed to in Windows 7.

If I'm installing as admin my executables files get put in C:\Program Files.

If I install my product as a normal user where should the executables be put?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

飘落散花 2024-09-22 15:13:17

您使用哪个安装程序?

MSI 以提升的权限运行。您可以将应用程序安装在程序文件文件夹中

Which installer are you using?

MSI runs in elevated privileges. You can install your application in program files folder

千柳 2024-09-22 15:13:17

将文件放入用户文件夹中。

这意味着该应用程序仅可供该用户使用。

Put the files in the user folder.

This will mean that the application is only available to that user.

青衫负雪 2024-09-22 15:13:17

您可能应该将其存储在 AppData 目录中,正如我看到您在回复 @ChrisF 时提到的那样。请记住,用户可以移动此目录,因此我不会明确指出它。您可以获取一个仅适用于登录用户的环境变量,即 %AppData%

请记住,将其放入 %AppData%/Roaming 会在同一域上的多台计算机上跟踪用户,而 %AppData%/Local 将仅保留在一台计算机上。

You should probably store that in the AppData directry, as I saw you mention in reply to @ChrisF. Remember that the user can move this directory though, so I wouldn't point to it explicitly. There is an environment variable that you can grab, that only applies to the logged-in user, which is %AppData%.

Keep in mind that putting it in %AppData%/Roaming would follow the user across multiple machines on the same Domain and %AppData%/Local would just stay on the one machine.

泛泛之交 2024-09-22 15:13:17

可执行文件应位于 Program Files 下,其确切位置可能因安装而异。这意味着设置应该以提升的速度运行。如果 InnoSetup 生成 .msi 文件,它们将请求提升。如果它创建一个名为 setup.exe 的文件,它也会请求提升。如果由于某种原因 exe 有不同的名称,例如 GetStarted.exe,那么您应该手动创建一个外部清单 (GetStarted.exe.manifest) 并放入 requestExecutionLevel 的 requireAdministrator 中,这将确保您的安装程序请求提升。

无论它如何请求提升,如果执行安装的用户是管理员(例如您),他们只需单击同意即可。如果他们不是管理员,则需要获得管理员的同意。之后安装程序将能够写入程序文件。

如果非管理员能够安装应用程序对您来说很重要,那么请将可执行文件放在用户配置文件下 - 但这不是我的第一选择。对程序文件的保护意味着,如果您将应用程序安装到受保护的区域,用户不太可能发现自己的应用程序副本混乱。

The executables should be under Program Files, who's precise location may vary from installation to installation. This means that the setup should run elevated. If InnoSetup makes .msi files, they will request elevation. If it makes a file called setup.exe, it will also request elevation. If for some reason the exe has a different name, like GetStarted.exe, then you should hand create an external manifest (GetStarted.exe.manifest) and put in requireAdministrator for the requestedExecutionLevel which will ensure your installer requests elevation.

Regardless of how it requests elevation, if the user doing the install is an admin (eg you) they will just have to click consent. If they are not an admin they will need to get an admin to consent for them. After that the installer will be able to write to Program Files.

If it's important to you that non admins be able to install the app then have the executables go under the users profile - but that would not be my first choice. The protection given to Program Files means that users are less likely to find themselves with messed up copies of your application if you install it to the protected area.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文