Inno setup - 将应用程序安装到程序文件,允许不以管理员身份运行

发布于 2024-08-29 22:57:58 字数 777 浏览 3 评论 0原文

我的安装程序将应用程序安装到“Program files\MyApp”,应用程序运行时会更改此位置中的文件。在 Vista 上,默认情况下这会引发 UAC 问题。

我希望用户能够运行 MyApp,而无需在每次运行应用程序时都被管理员或与 UAC 屏幕冲突。如果他们必须通过 UAC 才能安装应用程序,那也可以,但仍然不是最佳选择。

我以为我已经设置了这个,但它不起作用:

[Setup]
PrivilegesRequired=admin
AppName=My App
AppVerName=My App 1.0
DefaultDirName={pf}\MyApp
DefaultGroupName=MyApp
UninstallDisplayIcon={app}\bin\MyApp.ico
OutputDir=..\Installer
ChangesAssociations=yes

[Dirs]
Name: "{app}\"; Permissions: everyone-modify
Name: "{app}\redist"; Flags: deleteafterinstall;

具体来说,我认为 Name: "{app}\";权限:Everyone-modify 将允许普通用户运行它,从而删除 Program Files\MyApp 上的 UAC 保护。

我随机选择一些值,有人可以建议一些更改吗?同样,目标是一旦安装,非管理员帐户中的普通用户就可以运行它,即使文件保存在程序文件中,而无需 UAC 启动。其次,安装本身不应该太疯狂......单一提示输入管理员密码或 UAC 授权。

My installer installs the app to "Program files\MyApp", the app when running changes files within this location. On Vista, by default this brings up UAC issues.

I want users to be able to run MyApp without being admisn or fighting the UAC screen everytime they run the app. If they have to get through UAC to install the app, that's OK though still not optimal.

I thought I had this set up, but it's not working:

[Setup]
PrivilegesRequired=admin
AppName=My App
AppVerName=My App 1.0
DefaultDirName={pf}\MyApp
DefaultGroupName=MyApp
UninstallDisplayIcon={app}\bin\MyApp.ico
OutputDir=..\Installer
ChangesAssociations=yes

[Dirs]
Name: "{app}\"; Permissions: everyone-modify
Name: "{app}\redist"; Flags: deleteafterinstall;

Specifically I thought Name: "{app}\"; Permissions: everyone-modify would let normal users run it, removing UAC protection on Program Files\MyApp.

I am picking at values a bit by random, can anyone suggest some changes? Again, the aim is that once installed, normal users in non-admin accounts can run it even though files are saved in Program Files, without UAC kicking in. As a secondary thing, the installation itself should not be too crazy... a single prompt for admin password or UAC authorization.

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

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

发布评论

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

评论(2

暗恋未遂 2024-09-05 22:57:58

不要安装在 {pf} 下。相反,应安装到用户可写入的位置(例如,{localappdata})。
http://www.kinook.com/blog2/inno-setup.html

Don't install under {pf}. Instead, install to a user-writeable location (for instance, {localappdata}).
http://www.kinook.com/blog2/inno-setup.html

梦冥 2024-09-05 22:57:58

您应该更改您的应用程序,以便将共享数据保存在其他文件夹中。

向任何用户授予对 PF 中包含可执行代码(exe、dll 等)的文件夹的写入权限是一个安全问题(邪恶的用户可以修改 exe 文件并等待管理员运行它)

或者您可以将文件存储在以下子文件夹中PF 并且只授予对其的写访问权限,这样您的可执行文件是安全的。

You should change your app so that is saves shared data in some other folder.

Granting write permissions for any user to a folder in PF that contains executable code (exe,dll's etc) is a security issue (Evil user could modify exe file and wait for admin to run it)

Alernativly you could store the files in a subfolder in PF and only grant write access to it, that way your executables are safe.

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