I'm working on a project with a SQLite database. It works fine in my Visual Studio project. When I try to deploy using Inno Setup the MyApp.exe cannot write (Read Only) the database file in the folder ProgramData.
If I run the setup by Right-Click > Run as Administrator the MyApp.exe is then capable of writing the database file.
So I added the admin permission using PrivilegesRequired=admin
But it still doesn’t work.
I can't figure-out:
- Why MyApp.exe cannot write a file in
ProgramData
except running the setup as Admin? - Why this
PrivilegesRequired=admin
code doesn't work?
My Operating System is Windows 10 and I'm logged in as the admin. My Inno Setup compiler version is 5.6.1.
[Setup]
PrivilegesRequired=admin
[Files]
Source: "{#SourceFolder}MyApp.exe"; DestDir: "{app}"
Source: "{#SourceFolder}Database.db"; DestDir: "{commonappdata}\MyApp"; Flags: ignoreversion
I can give to MyApp.exe to admin permission in C# code, but still need to work this app in a non-admin account