Inno Setup-如何设置安装文件夹的权限 [英] Inno Setup - How to set permissions of installation folder

查看:1690
本文介绍了Inno Setup-如何设置安装文件夹的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Inno Setup创建我的应用程序的安装程序.

I am using Inno Setup to create an installer of my application.

在第一次运行时,我的应用程序正在创建一个SQLite数据库,但是当用户没有修改安装文件夹的权限时,它无法实现.

On the first run my application is creating an SQLite database but it can't achieve that while the user doesn't have the permission of modify the installation folder.

我设法设置了文件权限:

I managed to set permissions of files:

[Files]
Source: "D:\....\***.jar"; DestDir: "{app}"; Flags: ignoreversion; Permissions: users-full
Source: "D:\....\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;\
    Permissions: users-full

但这无济于事,因为我需要安装文件夹的完全用户权限,例如:C:\Program Files\InstallationFolder

But that doesn't help because I need full users permission on installation folder, for example: C:\Program Files\InstallationFolder

推荐答案

[Files]节条目的Permissions参数仅适用于已安装的文件,不适用于隐式创建的目录.

The Permissions parameter of the [Files] section entry applies to the installed files only, not to the implicitly created directories.

要更改文件夹的权限,请在 [Dirs]部分中使用显式条目表示{app}:

To change permissions of a folder, use an explicit entry in the [Dirs] section for the {app}:

[Dirs]
Name: {app}; Permissions: users-full


尽管这不是一个好习惯.

  • 通常,Windows应用程序不要求对其文件夹具有写权限.这违反了Windows准则.应用程序应将数据写入用户配置文件文件夹(C:\Users\username\AppData)或公共数据文件夹(C:\ProgramData).

  • In general, Windows applications shall not require write permissions to their folder. That's against Windows guidelines. The application should write data to a user profile folder (C:\Users\username\AppData) or to a common data folder (C:\ProgramData).

另请参见通过Inno Setup安装后应用程序无法正常工作.

这篇关于Inno Setup-如何设置安装文件夹的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆