How to check for presence of a directory in Inno Setup preprocessor?

Uga Buga

What I am trying to do is:

#define SAMPLE_DOCS_ROOT "C:\SampleDocuments\"
#if CLIENT != ""
  #define SAMPLE_DOCS_CLIENT SAMPLE_DOCS_ROOT + "client\" + CLIENT
  #ifexist SAMPLE_DOCS_CLIENT
    #define SAMPLE_DOCS_PATH SAMPLE_DOCS_CLIENT + "\*"
  #endif
#endif

SAMPLE_DOCS_PATH never gets defined even though there is SAMPLE_DOCS_CLIENT folder.

It seems that the #ifexist ISPP directive does not accept absolute nor relative directory path, and only accepts file paths. Is there a way to check for the presence of a directory at compile time?

TLama

You need to use the DirExists function. The #ifexist directive can be used only for files. So write this instead:

#define SAMPLE_DOCS_ROOT "C:\SampleDocuments\"
#if CLIENT != ""
  #define SAMPLE_DOCS_CLIENT SAMPLE_DOCS_ROOT + "client\" + CLIENT
  #if DirExists(SAMPLE_DOCS_CLIENT)
    #define SAMPLE_DOCS_PATH SAMPLE_DOCS_CLIENT + "\*"
  #endif
#endif

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to check if port is usable in Inno Setup?

From Dev

How to check partition type in inno setup?

From Dev

How to check Internet connection using Inno Setup

From Dev

Include once capability in Inno Setup Preprocessor?

From Dev

How to check for the presence of a git repository in a directory using bash script

From Dev

Inno Setup second temporary directory

From Dev

How to check if an object is NULL in Inno Setup Pascal Script?

From Dev

Inno Setup: How to check if JRE is present and prompt to download if not?

From Dev

How to check 64/32-bit in Inno setup

From Dev

Inno Setup how to check if MSVCR100.dll exists on the system

From Dev

Inno setup: check for new updates

From Dev

Check System Architecture in Inno Setup

From Dev

Inno setup: check for new updates

From Dev

How to check the presence of a line in a string?

From Dev

how to check the presence of the element on the page?

From Dev

Inno Setup: List all file names in an directory

From Dev

Inno Setup: Color for modal and browse directory windows

From Dev

Inno Setup: Color for modal and browse directory windows

From Dev

Inno Setup get directory size including subdirectories

From Dev

Inno Setup: Check if component was previously downloaded

From Dev

Inno Setup check if a machine is joined to a Domain

From Dev

Inno Setup Check function for Dirs section

From Dev

Inno Setup: Check if component was previously downloaded

From Dev

Inno Setup Check additional (Windows Installer) mutex

From Dev

How to override functions in Inno Setup?

From Dev

How to split a string in Inno Setup

From Dev

how to refresh a page in inno setup

From Dev

How to extract a Inno Setup Installer

From Dev

Inno setup - how to change version in the setup hover?

Related Related

  1. 1

    How to check if port is usable in Inno Setup?

  2. 2

    How to check partition type in inno setup?

  3. 3

    How to check Internet connection using Inno Setup

  4. 4

    Include once capability in Inno Setup Preprocessor?

  5. 5

    How to check for the presence of a git repository in a directory using bash script

  6. 6

    Inno Setup second temporary directory

  7. 7

    How to check if an object is NULL in Inno Setup Pascal Script?

  8. 8

    Inno Setup: How to check if JRE is present and prompt to download if not?

  9. 9

    How to check 64/32-bit in Inno setup

  10. 10

    Inno Setup how to check if MSVCR100.dll exists on the system

  11. 11

    Inno setup: check for new updates

  12. 12

    Check System Architecture in Inno Setup

  13. 13

    Inno setup: check for new updates

  14. 14

    How to check the presence of a line in a string?

  15. 15

    how to check the presence of the element on the page?

  16. 16

    Inno Setup: List all file names in an directory

  17. 17

    Inno Setup: Color for modal and browse directory windows

  18. 18

    Inno Setup: Color for modal and browse directory windows

  19. 19

    Inno Setup get directory size including subdirectories

  20. 20

    Inno Setup: Check if component was previously downloaded

  21. 21

    Inno Setup check if a machine is joined to a Domain

  22. 22

    Inno Setup Check function for Dirs section

  23. 23

    Inno Setup: Check if component was previously downloaded

  24. 24

    Inno Setup Check additional (Windows Installer) mutex

  25. 25

    How to override functions in Inno Setup?

  26. 26

    How to split a string in Inno Setup

  27. 27

    how to refresh a page in inno setup

  28. 28

    How to extract a Inno Setup Installer

  29. 29

    Inno setup - how to change version in the setup hover?

HotTag

Archive