Page 1 of 1

Methods/Techniques to install empty folders

Posted: Mon Jan 25, 2010 3:56 pm
by ScottMuc
In our installer we wish to install upwards of 50 empty folders. The app breaks if these folders don't exist, and if they have dummy files. Unfortunately we are dependent on code which has these constraints.

I don't want to create 50 Create Folder statements because that means updating the installer just because someone created a new folder that needs to be part of the build.

Currently, We run a script that populates all these empty folders with 'dummy.tmp'. Once these folders have been extracted I would like to remove all of these files. At what point during the install can this be done and how?

I've tried using DELETE FILES RECURSIVE %TARGETDIR%\\SomePath\\*.tmp but the files still exist after installation.

Thank you for your assistance.

Posted: Tue Jan 26, 2010 8:59 am
by MichaelNesmith
Ensure Delete Files Recursive is called after the call to Apply Install.

Posted: Tue Jan 26, 2010 11:29 am
by ScottMuc
Thank you! I'll give that a shot. I sort of got thrown into the InstallAware side of our project so there's a lot of learning as I go right now.

Posted: Tue Jan 26, 2010 1:55 pm
by ScottMuc
Hi Michael,

I'm afraid DELETE FILES RECURSIVE doesn't behave the way that I would like. It's definitely running now.

Unfortunately the installer removes the folder along with the dummy file!

My exact command is:
Recursively Delete Files $TARGETDIR$\\dummy

If I have a tree like:

Code: Select all

\\A
  \\B
     dummy
  \\C
     dummy
  \\D
     usefulfile.xml
It will delete folders B and C (which I want to keep)

Posted: Wed Jan 27, 2010 4:04 pm
by ScottMuc
I got around this issue by using Run Program and execute cmd.exe /C del /S .\\dummy in $TARGETDIR$