Inno Setup - How to set full permission on a folde

2020-02-23 08:21发布

My kit created with Inno Setup installs my application in C:\Program Files\MyApp.

When my application starts, it tries to create new log files in C:\Program Files\MyApp\logs\ but it fails.

In my Inno script i have the following settings:

[Dirs]
Name: "{app}";

[Files]
Source: logs\*; DestDir: {app}\logs\; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full

This gives full permissions on all files inside logs folder, but not on the folder itself. So, when my application tries to create a new log file inside that folder, it fails.

How can i set full permissions on the folder as well, not only on the existing files in it?

2条回答
何必那么认真
2楼-- · 2020-02-23 09:03

Simply using the following code works for me and I think it is more secured:

[Dirs]
Name: "{app}\logs"; Permissions: users-full
查看更多
爷的心禁止访问
3楼-- · 2020-02-23 09:17

Setting permissions for logs folder under [Dirs] section worked for me:

[Dirs]
Name: "{app}"; 
Name: "{app}\logs"; Permissions: everyone-full

[Files]
Source: logs\*; DestDir: {app}\logs\; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-full

But, as in this post, i'm not sure if it's the proper way to do it.

查看更多
登录 后发表回答