Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Syntax problem with XCopyFile


2 replies to this topic

itchy

itchy
  • Members
  • 4 posts

Posted 26 October 2001 - 13:01

Hello,
I am trying to copy the entire contents of the CD my installer will sit on (sub directories and all) to the installation directory using a custom action calling a simple script. The script only has one line of code which calls XCopyFile.

The help files led me to believe that the following would do what I wanted:

XCopyFile( SRCDIR ^ "*.*" ,"" ,INCLUDE_SUBDIR);

However SRCDIR ^ "*.*" seems to be interpreted as * - i.e. copy everything from the currently selected folder.

Can anyone tell me what I am doing wrong?

Thanks


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 26 October 2001 - 18:06

Insert a MessageBox to make sure SRCDIR has the appropriate value. You may need to call MsiGetProperty to get SOURCEDIR.

itchy

itchy
  • Members
  • 4 posts

Posted 30 October 2001 - 18:56

Thanks for that. MSIGetProperty was the clue I needed.
The other requirement was to use the ResolveSource action earlier in the sequence  than my custom action.

In case anyone is interested I ended up writing the following code:

function CopyAll(hMSI)  

STRING svSource[257];
NUMBER nBuffer;    

begin  
  nBuffer = 257;
  MsiGetProperty( hMSI, "SOURCEDIR", svSource, nBuffer);      
  MessageBox (svSource ^ , WARNING);
  nBuffer = XCopyFile( svSource ^ "*.*" ,"",INCLUDE_SUBDIR);
 if (nBuffer < 0) then
 MessageBox ("Unable to copy CD-ROM files to target directory. Ensure that the disk is not full and that you have administrator privilages on this computer"  , WARNING);
 endif;
end;