我应该将应用程序安装到哪个目标文件夹而不需要 uac 提升?
我有一个应用程序,我正在为其安装程序。假设我希望安装不需要提升,并且我希望应用程序本身永远不需要提升,并且我希望应用程序的更新程序(内置)永远不需要提升,我应该将应用程序安装到哪里?
注意事项:
- 此申请未签名。
- 如果每个用户都必须在他们的个人资料下单独安装它,我没问题。
- 我可以在安装中使用注册表并实现相同的目标吗?
- 它所做的唯一写入是设置/配置文件。
- .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:
- This application is not signed.
- I am okay if each user has to install it separately under their profile.
- Can I use the registry in the install and accomplish the same goal?
- The only writes it makes are to setttings/configuration files.
- .NET 4 app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
常见的选择是由
SHGetFolderPath(CSIDL_LOCAL_APPDATA)
(Win2K 及更高版本)或SHGetKnownFolderPath(FOLDERID_LocalAppData)
(Vista 及更高版本)返回的本地 appdata 文件夹。返回的路径类似于:
创建公司是正常的名称和应用程序文件夹位于此处,因此您将得到如下路径:
“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) orSHGetKnownFolderPath(FOLDERID_LocalAppData)
(Vista and later).This returned path is something like:
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)
您的问题被标记为 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.