Community Forums
Page 1 of 2 12 LastLast
Results 1 to 5 of 8

Thread: Delete(FilePath\*.*) not working

  1. #1
    Join Date
    May 2011
    Posts
    71

    Delete(FilePath\*.*) not working

    Hello Friends,

    I want to delete all the files (irrespective of the names or types) in a folder.
    Delete(FilePath\*.*) not working. It returns the error - file not found.
    whereas the files are present in the folder.

    Any help how can i delete all the files inside the folder.
    [NOTE: I DONT WANT TO DELETE ANY SUB DIRECTORIES INSIDE THE FOLDER, JUST THE FILES]

    Thanks

  2. #2
    chad.petersen Guest
    Have you considered using the RemoveFiles table? I always try to use native MSI capabilities whenever possible, and only extend using Custom Actions if there is no other good way.

    I assume someone wrote this Delete function. It doesn't seem to be one that is built in to InstallScript language as far as I can tell.

    There is a DeleteFile built in that I can see. Even here, Flexera recommends using the RemoveFiles table if possible.

    Project: In a Basic MSI or InstallScript MSI project, this functionality might be better achieved by using the native Windows Installer RemoveFiles action. For more information, see the Windows Installer Help.

    http://helpnet.installshield.com/ins...DeleteFile.htm

    Chad

  3. #3
    Join Date
    May 2011
    Posts
    71
    Quote Originally Posted by chad.petersen View Post
    Have you considered using the RemoveFiles table? I always try to use native MSI capabilities whenever possible, and only extend using Custom Actions if there is no other good way.

    I assume someone wrote this Delete function. It doesn't seem to be one that is built in to InstallScript language as far as I can tell.

    There is a DeleteFile built in that I can see. Even here, Flexera recommends using the RemoveFiles table if possible.

    Project: In a Basic MSI or InstallScript MSI project, this functionality might be better achieved by using the native Windows Installer RemoveFiles action. For more information, see the Windows Installer Help.

    http://helpnet.installshield.com/ins...DeleteFile.htm

    Chad
    Hi, Thanks for the response
    I cannot use the Remove file table as i dont know the file names or types as there could be any no. of files of any name or type.
    Yes, i am using the inbuilt Delete file method.

  4. #4
    chad.petersen Guest
    You should be able to use *.* in the RemoveFiles table. Have you tried that? I use it and it seems to do exactly what one would expect.

    Chad

  5. #5
    Join Date
    May 2011
    Posts
    71
    Quote Originally Posted by chad.petersen View Post
    You should be able to use *.* in the RemoveFiles table. Have you tried that? I use it and it seems to do exactly what one would expect.

    Chad
    Thanks, i didnt knew about that. BUT its a suite installer and it doesnt have a RemoveFiles table.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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