Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inno Setup - How to set permissions of installation folder

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

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

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

like image 760
Marian Pavel Avatar asked Jan 11 '16 09:01

Marian Pavel


People also ask

How do I use Inno installer?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.

Does Inno Setup work on Linux?

You're in luck: It's possible to run Inno Setup anywhere that Docker runs (including Linux and macOS), and even have a passable experience writing your setup script.

Who invented Inno?

Kevin Gundersen - Founder - Inno Supps | LinkedIn.

What is Inno Setup file?

Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997. Inno Setup. Screenshot of the Inno Setup IDE running on Windows 7. Developer(s)


1 Answers

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

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

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

Though it is not a good practice.

  • 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).

    See also Application does not work when installed with Inno Setup.

  • In your specific case, you better run the database creation process as the Administrator (e.g. using the runascurrentuser flag).
like image 109
Martin Prikryl Avatar answered Nov 08 '22 00:11

Martin Prikryl