开发者

Inno setup - install app to Program Files, allow run not as admin

开发者 https://www.devze.com 2022-12-27 13:30 出处:网络
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.

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 wou开发者_Python百科ld 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.


Don't install under {pf}. Instead, install to a user-writeable location (for instance, {localappdata}).
http://www.kinook.com/blog/?p=53


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号