-1

my application includes a db and users will be able to add data to the db via a GUI. So I need to give authorization to the user to modify the db. I tried all options from this post but authorization is still not allowed. Here, this is an illustration of what I try to achieve (get Permissions for Modify checked in the "Allow" column):

enter image description here

Here my current code:

#define MyAppName "aaa"
#define MyAppVersion "1.0"
#define MyAppExeName "aaa.exe"

[Setup]
AppId={{...-...-...-...-...}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputDir=C:\...\output
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Dirs]
Name: "{app}\Logs"; Permissions: everyone-modify

[Files]
Source: "C:\...\aaa.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\list_files\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Permissions: everyone-modify
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

How can I give database access to the user through the creation process of the setup? Thank you

H. Dave
  • 549
  • 3
  • 9
  • 26

1 Answers1

0
[Files]
Source: "C:\...\aaa.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\...\folder_files\*"; DestDir: "{localappdata}\name_application\folder_files\"; Flags: ignoreversion recursesubdirs createallsubdirs
H. Dave
  • 549
  • 3
  • 9
  • 26
  • Do not grant all users write access to *Program Files* folder! That's a hack, not a solution. See also [Application does not work when installed with Inno Setup](https://stackoverflow.com/q/44333839/850848). – Martin Prikryl May 07 '18 at 17:16
  • Thanks for your comment. As I said, I am a novice and maybe my following question can be basic: I understand that I have to put my `db` in the `AppData\Local` folder but my `exe` has to be in the `Program Files` folder or it can be located in the `AppData\Local` folder with the `db` ? – H. Dave May 08 '18 at 01:06
  • If the application is to be used by all users of the machine, it should be in `Program Files`. If it is to be used by the user that installed it only, it can be in `AppData\Local`. – Martin Prikryl May 08 '18 at 06:37
  • Based on Martin Prikryl's comment, I switched the `DestDir` for `{localappdata}` instead of `{app}` – H. Dave May 10 '18 at 00:21