+ Reply to Thread
Results 1 to 7 of 7

Thread: Locating existing file

  1. #1

    Default Locating existing file

    I am trying to determine if a file exists anywhere on a particular drive. Ideally I need to know if this file is anywhere on the installation machine. Have looked at "If File/Folder" and "Search for File" functions but both seem to require that the path be specified. Is there a way to find a file by simply supplying C: and the filename argument?

  2. #2
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Locating existing file

    Joe,

    The Search for File function allows you to search for a specific file in the local or network file system and places the location in a variable.

    If the function succeeds, the %_SB_ERRORCODE% return value is nonzero. If the function fails, the return value is zero.

    Does this help?

  3. #3

    Default Re: Locating existing file

    I must be be missing something.

    Search for File function
    Variable %FILEFOUND%
    Filename FMGMASTR.EXE
    Path to search: %DRIVE_LETTER_TO_TEST%\ (tried without \ also)
    Return List of all matches is ON

    Debugger shows %DRIVE_LETTER_TO_TEST% to contain D: from previous GetListItem function.

    After execution:
    %SB_ERRORCODE%= empty
    %FILEFOUND%= empty

    I know there are several occurances of the FMGMASTR.exe file on this drive.
    Attempted to send stripped down script but zip file is too large for submission as an attachment.

  4. #4
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Locating existing file

    Joe,

    I'll check this.

    BTW, what happens if you enter D:\ in "Path to search" (instead of %DRIVE_LETTER_TO_TEST%\)

    Thanks,

  5. #5
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Locating existing file

    Joe,

    Just checked this and it works fine here on our machines. I am using the following:

    Set Variable %DRIVELETTERTOTEST% to c:
    Set Variable %FILEFOUND% to ""
    Set Variable %FILEFOUND% to Search for File("FMGMASTR.EXE")
    Display Message Box "%FILEFOUND%\n\n%_SB_ERRORCODE%\n\n%DRIVELETTERTOT E..." -- ""

    FMGMASTR.EXE is in c:\general and the installer detected the file.

  6. #6

    Default Re: Locating existing file

    Friedrich:

    That works as advertised.

  7. #7
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: Locating existing file

    Could you please send me a demo script where it does not work? All our test scripts (with drive variables) work fine in build 1354.

    Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Editing an INI file - POST file installation
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 4
    Last Post: 09-21-2006, 05:34 AM
  2. Setting the installer/web update Version Info from a file
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 4
    Last Post: 08-23-2006, 07:59 AM
  3. Passing a variable to the Web Update file
    By NewsArchive in forum SetupBuilder - NNTP
    Replies: 13
    Last Post: 12-14-2005, 12:19 AM
  4. File Install problem in 5.1.1300
    By sphair in forum SetupBuilder
    Replies: 3
    Last Post: 11-03-2005, 05:57 AM

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •