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

查看:32
本文介绍了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 FilesInstallationFolder

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

推荐答案

[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:UsersusernameAppData) 或公共数据文件夹 (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:UsersusernameAppData) or to a common data folder (C:ProgramData).

另请参阅使用 Inno Setup 安装时应用程序不起作用.

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

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