Inno Setup refuses to set permissions of some files

Nils Guillermin

I am writing an Inno Setup script that needs to add/modify permissions to certain files. However, it is setting permissions on some files and not other. Relevant code:

[Files]
Source: "K:\user\Odin\Installer Files\C_Odin\*"; DestDir: "{sd}\Odin"; Flags: ignoreversion recursesubdirs createallsubdirs

// CODE OF INTEREST STARTS HERE
Source: "K:\user\Odin\Installer Files\C_Odin\PDOXUSRS.NET"; DestDir: "{sd}\Odin"; Permissions: users-modify
Source: "K:\user\Odin\Installer Files\Data\PDOXUSRS.NET"; DestDir: "{sd}\Odin\Data"; Permissions: users-modify
Source: "K:\user\Odin\Installer Files\Data\Users.DB"; DestDir: "{sd}\Odin\Data"; Permissions: users-modify

The permissions on the first file are set correctly, the second two are not. Any insight is greatly appreciated

Ran the setup executable with /LOG, found this in there.

2016-07-22 16:45:12.502   -- File entry --
2016-07-22 16:45:12.502   Dest filename: C:\Odin\WorkStn.cfg
2016-07-22 16:45:12.502   Time stamp of our file: 2016-07-22 16:19:28.000
2016-07-22 16:45:12.502   Dest file exists.
2016-07-22 16:45:12.502   Time stamp of existing file: 2016-07-22 16:19:28.000
2016-07-22 16:45:12.502   Version of our file: (none)
2016-07-22 16:45:12.518   Version of existing file: (none)
2016-07-22 16:45:12.518   Installing the file.
2016-07-22 16:45:12.518   Successfully installed the file.
2016-07-22 16:45:12.518   Setting permissions on file: C:\Odin\WorkStn.cfg
2016-07-22 16:45:12.518   -- File entry --
2016-07-22 16:45:12.518   Dest filename: C:\Odin\Data\PDOXUSRS.NET
2016-07-22 16:45:12.518   Time stamp of our file: 2016-07-22 12:04:28.000
2016-07-22 16:45:12.518   Installing the file.
2016-07-22 16:45:12.518   Creating directory: C:\Odin\Data
2016-07-22 16:45:12.518   Successfully installed the file.
2016-07-22 16:45:12.518   Setting permissions on file: C:\Odin\Data\PDOXUSRS.NET
2016-07-22 16:45:12.518   -- File entry --

Full log https://gist.github.com/nguillermin/d814a14f68db8ebba1720a3af2f42a54

Martin Prikryl

The log file shows that both files are installed twice.

It's clear why the first file is installed twice. The first time by the wildcard entry, the second time by the explicit entry. The wildcard entry without the Permissions attribute is before the explicit entry with Permissions attribute, so the second installation with the permissions overwrite the first installation without permissions.

But you didn't show us the second entry that installs the problematic file. So we do not know what it is like, nor if it is before or after the entry with the Permissions attribute.


Anyway, note it's wrong to have two entries installing the same file.

It does not work like the two entries are somehow merged. The file is actually installed twice, and the attributes of the first entry are lost. You should exclude the file that have a specific entry from the wildcard entry like:

Source: "K:\user\Odin\Installer Files\C_Odin\*"; Excludes: "PDOXUSRS.NET"; \
    DestDir: "{sd}\Odin"; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "K:\user\Odin\Installer Files\C_Odin\PDOXUSRS.NET"; \
    DestDir: "{sd}\Odin"; Permissions: users-modify

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Inno Setup - How to set permissions of installation folder

From Dev

Prevent Inno Setup deleting some files on uninstall

From Dev

Copying hidden files in Inno Setup

From Dev

Inno Setup Set TInputQueryWizardPage Height

From Dev

Set permissions for files

From Dev

Signing files using Inno Setup with the signonce flag

From Dev

Should Inno Setup delete old files on Update?

From Dev

Inno Setup – zip local files prior to an update

From Dev

How to support thousands of files using Inno Setup?

From Dev

Sign all exe files on Inno Setup Installation

From Dev

Create ZIP files from within Inno Setup

From Dev

Compile Inno Setup script (.iss files) with Maven?

From Dev

Should Inno Setup delete old files on Update?

From Dev

Inno Setup Set Password based on external information

From Dev

Inno Setup - Integer or Set/Range wildcard?

From Dev

Set Windows file version for a setup file created by Inno Setup

From Dev

Inno setup throws error "No Files Found Matching" Even tough files are there

From Dev

In Inno Setup, how do I center some text in the window?

From Dev

How to set default set of permissions for files in cpanel

From Java

Inno Setup can't find image files using mask on AppVeyor

From Dev

Inno Setup Iterate over [Files] section in Pascal code

From Dev

Inno Setup Loop through files and register each .NET dll

From Java

How to catch the error message of bat file for deleting files in Inno Setup?

From Dev

Inno Setup - How to skip files depending on radio button

From Dev

Is it safe to use .islu translation files in Inno Setup for all languages?

From Dev

Inno Setup Copy Files and Folders to an Existing Zip File

From Dev

Inno Setup Avoiding exceptions in ExtractTemporaryFiles when no matching files are found

From Dev

Adding additional files to an Inno based setup for a Netbeans application

From Dev

Inno-setup pack all files in a folder exept for 1 file

Related Related

  1. 1

    Inno Setup - How to set permissions of installation folder

  2. 2

    Prevent Inno Setup deleting some files on uninstall

  3. 3

    Copying hidden files in Inno Setup

  4. 4

    Inno Setup Set TInputQueryWizardPage Height

  5. 5

    Set permissions for files

  6. 6

    Signing files using Inno Setup with the signonce flag

  7. 7

    Should Inno Setup delete old files on Update?

  8. 8

    Inno Setup – zip local files prior to an update

  9. 9

    How to support thousands of files using Inno Setup?

  10. 10

    Sign all exe files on Inno Setup Installation

  11. 11

    Create ZIP files from within Inno Setup

  12. 12

    Compile Inno Setup script (.iss files) with Maven?

  13. 13

    Should Inno Setup delete old files on Update?

  14. 14

    Inno Setup Set Password based on external information

  15. 15

    Inno Setup - Integer or Set/Range wildcard?

  16. 16

    Set Windows file version for a setup file created by Inno Setup

  17. 17

    Inno setup throws error "No Files Found Matching" Even tough files are there

  18. 18

    In Inno Setup, how do I center some text in the window?

  19. 19

    How to set default set of permissions for files in cpanel

  20. 20

    Inno Setup can't find image files using mask on AppVeyor

  21. 21

    Inno Setup Iterate over [Files] section in Pascal code

  22. 22

    Inno Setup Loop through files and register each .NET dll

  23. 23

    How to catch the error message of bat file for deleting files in Inno Setup?

  24. 24

    Inno Setup - How to skip files depending on radio button

  25. 25

    Is it safe to use .islu translation files in Inno Setup for all languages?

  26. 26

    Inno Setup Copy Files and Folders to an Existing Zip File

  27. 27

    Inno Setup Avoiding exceptions in ExtractTemporaryFiles when no matching files are found

  28. 28

    Adding additional files to an Inno based setup for a Netbeans application

  29. 29

    Inno-setup pack all files in a folder exept for 1 file

HotTag

Archive