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

PFTW Copy command


3 replies to this topic

Blackdog

Blackdog
  • Full Members
  • 64 posts

Posted 04 February 2002 - 18:31

I have an IS6 script that is to copy a file only if it exists on the user's machine. If it does not exist, do nothing. I have this in my script be checking the existance of the file by IS (FILE_EXIST.....). I then specify SRCDIR (using SCRDISK + FOLDER location) and set my TARGETDIR. This works fine if the file does not exist (do nothing). If the file does exist,  I keep getting a Copy File error: Unspecified error occurred and displays the SRCDIR.
When in PFTW, how can I use SCRDIR or must I do this some other way?

(Edited by Blackdog at 5:55 pm on Feb. 4, 2002)


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 February 2002 - 21:24

SRCDIR will be the temporary folder where the pftw package was extracted to. If your file is outside the pftw package this won't work. You could put it in the Setup Files section of the IDE and access if from SUPPORTDIR instead.

Blackdog

Blackdog
  • Full Members
  • 64 posts

Posted 05 February 2002 - 15:41

Here is my code snipit. I have put the file xxxnsf31.exe into the Advanvced Disk 1 pane. I still get an unspecified error. So I must not have it right yet. Any suggestions?

Remember, I want to use PFTW and replace this file only if it exists.

nResult  = Is (FILE_EXISTS, svResultPath ^ "\\xxxsys\\xxxnsf\\xxxnsf31.exe");
if  nResult = 1 then // 1 = true, 0 = false
   SRCDIR = SUPPORTDIR;
   TARGETDIR = svResultPath ^ "\\xxxsys\\xxxnsf";
   nResult = CopyFile ("rlinsf31.exe", "xxxnsf31.exe");
   if   nResult < 0 then
        sFile = "xxxnsf31.exe";
        CopyFileError(nResult, sFile);
   endif;
endif;  

(Edited by Blackdog at 2:47 pm on Feb. 5, 2002)


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 06 February 2002 - 11:15

I'm sorry, my reply was misleading. If you put the file in Advanced->Disk1 then you use SRCDIR. If you put it in the language independent, orparting system independent, or nay of the dependent folders, you use SUPPORTDIR.