Page 1 of 1

How do you Copy files from Support files

Posted: Tue Jul 03, 2007 1:46 am
by get101
I have files that contain country specific information. For example, sUS.dbf is for the USA.

I put all these country specific files under Support files. During installation the appropriate one is copied to $TARGETDIR$, and its name changed.

This code is above the Apply Install line.

Code: Select all

 Delete Files $TARGETDIR$\\sa.dbf (when installing)
          Copy Local Files $SUPPORTDIR$\\sUS.dbf to $TARGETDIR$\\sa.dbf
         


The problem is that this does not work. Can you help me understand where I have gone wrong?

Posted: Tue Jul 03, 2007 3:39 am
by MichaelNesmith
It's probably Delete Files that's interfering (remember, all purple [MSI] commands apply simultaneously when Apply Install is called, not before).

So you can call DeleteFilesA in kernel32.dll using Call DLL Function to immediately delete the file in question, without going through MSI for that one.

Posted: Wed Jul 04, 2007 5:38 pm
by get101
Thanks for the reply. That helped me resolve it.

Question: if a file of the same name already exists, is there a way to get the Copy File to overwrite the existing file?