我应该将应用程序安装到哪个目标文件夹而不需要 uac 提升?

发布于 2024-12-23 15:34:46 字数 262 浏览 3 评论 0原文

我有一个应用程序,我正在为其安装程序。假设我希望安装不需要提升,并且我希望应用程序本身永远不需要提升,并且我希望应用程序的更新程序(内置)永远不需要提升,我应该将应用程序安装到哪里?

注意事项:

  1. 此申请未签名。
  2. 如果每个用户都必须在他们的个人资料下单独安装它,我没问题。
  3. 我可以在安装中使用注册表并实现相同的目标吗?
  4. 它所做的唯一写入是设置/配置文件。
  5. .NET 4 应用程序。

I have an app and I am working on the installer for it. Assuming that I want the installation to not require elevation and I want the application itself to never require elevation and I want the updater for the application (which is build in) to never require elevation where should I install the application to?

Caveats:

  1. This application is not signed.
  2. I am okay if each user has to install it separately under their profile.
  3. Can I use the registry in the install and accomplish the same goal?
  4. The only writes it makes are to setttings/configuration files.
  5. .NET 4 app.

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

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

发布评论

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

评论(2

山色无中 2024-12-30 15:34:46

常见的选择是由 SHGetFolderPath(CSIDL_LOCAL_APPDATA)(Win2K 及更高版本)或 SHGetKnownFolderPath(FOLDERID_LocalAppData)(Vista 及更高版本)返回的本地 appdata 文件夹。

返回的路径类似于:

  • “C:\Users\arx\AppData\Local”(Vista 及更高版本)
  • “C:\Documents and Settings\arx\Local Settings\Application Data”(Vista 之前)

创建公司是正常的名称和应用程序文件夹位于此处,因此您将得到如下路径:

“C:\Users\arx\AppData\Local\BlahSoft\BlahApplication”

更新

如果您想要来自 .Net 的此路径您需要Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

A common choice is the local appdata folder returned by SHGetFolderPath(CSIDL_LOCAL_APPDATA) (Win2K and later) or SHGetKnownFolderPath(FOLDERID_LocalAppData) (Vista and later).

This returned path is something like:

  • "C:\Users\arx\AppData\Local" (Vista and later)
  • "C:\Documents and Settings\arx\Local Settings\Application Data" (pre-Vista)

It's normal to create company name and application folders under here, so you'll finish up with a path like:

"C:\Users\arx\AppData\Local\BlahSoft\BlahApplication"

Update

If you want this path from .Net you need Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)

尾戒 2024-12-30 15:34:46

您的问题被标记为 WIX 和 .NET;两者对于已知文件夹路径具有不同的语法。用于获取当前用户应用程序文件夹的 .NET 命令是 Environment.GetFolderPath(Environment.SpecialFolder.Programs)

如果您想安装到 WIX 路径,它具有每个已知文件夹的预定义属性; [ProgramFilesFolder] 是 32 位应用程序文件夹,[ProgramFiles64Folder] 是 64 位文件夹。

Your question is tagged both WIX and .NET; the two have different syntaxes for known-folder paths. The .NET command to get the current user application folder is Environment.GetFolderPath(Environment.SpecialFolder.Programs).

If you want to install to a WIX path, it has predefined properties for each known folder; [ProgramFilesFolder] is to the 32-bit application folder and [ProgramFiles64Folder] is to the 64-bit folder.

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