View forum topic
List of forum topicsSubject: How to Check if a Directory Exists?
Hi
In the "Create Folders" step I would like to check to see if a folder exists before performing an action but it is not clear to me what to put in the condition.
I tried direxist(#setuppath#\Dbf) but received an error saying that keywords could not be used so I wondered if anyone could show an example using a hard coded directory name and one using predefined variables.
Thanks,
Simon
You can specify If Condition as
direxist( macrox_do("#setuppath#\\Dbf") )
or negation
!direxist( macrox_do("#setuppath#\\Dbf") )
Also, you can use 'If Statement' command
Comparison Type: Directory Exists
Value: #setuppath#\Dbf
and insert other commands into it.
I entered:
!#setuppath#\Dbf
in the If Condition and the compiler does not complain but is it actually checking that the Dbf in the setup path does not exists? Is this what you meant by the 'If Statement'?
If you use 'If condition' parameter then
direxist( macrox_do("#setuppath#\\Dbf") )
or
!direxist( macrox_do("#setuppath#\\Dbf") )
There are a lot of commands in the CreateInstall.
'If Statement' command allows you to insert commands into it which are executed if the its condition is true.
Hi,
There is a command to check any directory, for e.g. c:\PRogram Files or c:\Program Files (x86) ?
Thanks
There are 'If Statement' and 'Check' commands. They allows you to check if a directory or a file exists.
Everywhere you can specify a variable like #progfiles#\my folder or the full path like c:\my folder\my subfolder.
January 16, 2025 Installer CreateInstall 8.11.1 was released.
June 19, 2024 Installer CreateInstall 8.11.0 was released. read more
November 13, 2022 Installer CreateInstall 8.10.1 was released.
May 21, 2022 Installer CreateInstall 8.10.0 was released.
September 25, 2021 Installer CreateInstall 8.9.0 was released.
July 15, 2021 Installer CreateInstall 8.8.1 was released.