Inno设置 - 如何设置安装文件夹

时间:2016-01-11 09:15:28

标签: permissions inno-setup

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

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

我设法设置了文件的权限:

[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

1 个答案:

答案 0 :(得分:11)

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

要更改文件夹的权限,请在{app} [Dirs] Name: {app}; Permissions: users-full 中使用显式条目:

C:\Users\username\AppData

虽然不是一个好习惯

  • 通常,Windows应用程序不需要对其文件夹具有写入权限。这违反了Windows指南。应用程序应将数据写入用户配置文件文件夹(C:\ProgramData)或公共数据文件夹(echo '<table id="item" >'; $row_max=($count_elements/4)+1; for($i=0;$i<=$row_max;$i++) { echo "<tr>"; $max=$x+4; for($w=$x;$w<$x+4;$w++) { if($x<$max && $w!=$count_elements) { echo '<td class="col1" style="width:125px;"><a href="product_viewcart.php?serial_no='.$serialNo[$w].'" target="parent.win"><img height="125" width="125s" src="data:image/jpeg;base64,'.base64_encode( $imageData[$w] ).'"/></a></td>'; echo '<td class="col2">'; echo '<a href="product_viewcart.php?serial_no='.$serialNo[$w].'" target="parent.win">'.$productname[$w].'</a>'; echo '<br>'; echo 'Rs. '; echo $productprice[$w]; echo '<br>'; echo '<br>'; echo '<input type="submit" class="button" name="add_submit" value="add item">'; echo '</td>'; $x=$x+1; } else break; } echo '</tr>'; } ?> )。

    另见[Dirs] section

  • 在特定情况下,您最好以管理员身份运行数据库创建过程(例如,使用Application does not work when installed with Inno Setup)。