This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Delete(FilePath\*.*) not working
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
08:28 AM
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
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
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
10:25 AM
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/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefDeleteFile.htm
Chad
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/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefDeleteFile.htm
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
10:27 AM
chad.petersen wrote:
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/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefDeleteFile.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.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
10:31 AM
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
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
10:37 AM
chad.petersen wrote:
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. 🙂
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 29, 2017
10:46 AM
It would be nice if you told us what you were working with from the beginning. What a waste of my time.
Chad
Chad
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 10, 2017
02:09 PM
An entry in RemoveFiles requires a Component to be selected. Does that mean I need to create an entry for every single component? Anyway, I tried using the main install component in my entry. Tried to do delete *.* in the INSTALLDIR on uninstall but nothing seems to happen.
So I tried making a CA that occurs after RemoveFiles and I was able to successfully remove the subfolders that are preventing me from removing files from INSTALLDIR. I think the InstallExec Sequence is incorrect though - there still are several files left in the installation directory.
So I tried making a CA that occurs after RemoveFiles and I was able to successfully remove the subfolders that are preventing me from removing files from INSTALLDIR. I think the InstallExec Sequence is incorrect though - there still are several files left in the installation directory.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 10, 2017
06:18 PM
Try DeleteFile(szPath ^ "*.*");