目前正计划为.NET应用程序制作安装过程我为非管理员用户销售更顺畅(读取:“可能”),我偶然发现了Google Chrome和Microsoft SkyDrive等应用程序:
它们似乎没有安装到通常的“Program Files”文件夹中,而是安装到当前用户的“Local Application Data”文件夹中。
由于此文件夹是基于每个用户的,因此它对于当前用户是可写的,并且不需要管理权限来写入。
我已经设法更改我的NSIS设置以正常工作并安装到此文件夹中,但我仍然不确定这是否是一个好的做法,可能有缺点。
我的问题是:
您是否有关于为何要安装或不安装到“本地应用程序数据”文件夹的建议?
(我希望这个问题与编程有关,足以保存在这里)
Currently planning on making the installation process for a .NET application I'm selling smoother (read: "possible") for non-administrator users, I stumbled upon applications like Google Chrome and Microsoft SkyDrive:
They seem to not install into the usual "Program Files" folder, but instead into the "Local Application Data" folder of the current user.
Since this folder is on a per-user-basis, it is writable for the current user and no administrative permissions are required to write into.
I've managed to change my NSIS setup to work correctly and install into this folder, but I'm still unsure whether this is good practice and might have drawbacks or not.
My question is:
Do you have any recommendations on why to install or not to install into the "Local Application Data" folder?
(I do hope this question is programming-related enough to be kept here)
最满意答案
从您的问题中不清楚,但您应该在$ LocalAppdata \ Programs中安装该程序,而不仅仅是$ LocalAppData(Win7中的FOLDERID_UserProgramFiles常量)
我知道我喜欢可以作为非管理员安装的应用程序,至少你知道应用程序不需要驱动程序或者它以其他方式与机器配置混淆。
有些人喜欢在机器范围内进行安装,并且在NSIS中为用户提供此选项并不难:
RequestExecutionLevel highest 如果用户不是admin( UserInfo插件),添加带有两个单选按钮(Just Me和All Users)的自定义页面并使机器范围内的选项变灰 根据安装模式设置$Instdir和SetShellVarContext 使用SHCTX作为注册表HKEY一些IT人员/域管理员可能不高兴,如果他们的用户可以安装东西,这是我能想到的唯一负面因素,但他们应该正确锁定系统,如果他们认为这是一个问题恕我直言...
It was not clear from your question but you should install the program in $LocalAppdata\Programs and not just $LocalAppData (FOLDERID_UserProgramFiles constant in Win7)
I know I like apps that can install as non-admin, at least you know the app does not require a driver or that it messes with the machine configuration in other ways.
Some people prefer to do a machine-wide install and giving the user this option is not that hard in NSIS:
RequestExecutionLevel highest Add a custom page with two radio buttons (Just Me and All Users) and gray out the machine-wide choice if user is not admin (UserInfo plugin) Set $Instdir and SetShellVarContext based on install mode Use SHCTX as the registry HKEYSome IT people/domain admins might not be happy if their users can install stuff, that is the only negative I can think of but they should lock down the system properly if they think it is a problem IMHO...
更多推荐
发布评论