Hi,
is there a possibility to remove complete folders ?
I can't find a function for deleting folders... like "delete files".
E.g. I need to delete a folder inside folder SHORTCUTFILES after a installation created a folder with links.
Since we don't want programs to create their own shortcuts on the clients uf our users, because we use a central shortcuts on a fileserver for which users are each permitted by Acitve Directory-Group...
The Installation itself is executed inside the project with the run program function, since no msi-package available of JDK 5.02 EE.
@Installaware: could be something for next version / Designrequest
Best Regards
Emu
delete folder function, only possible with vb-script ?
delete folder function, only possible with vb-script ?
Last edited by emu99 on Mon Feb 26, 2007 3:23 pm, edited 1 time in total.
workaround with vbs
i managed to create a workaround with a vbs which can take a parameter which holds the path + foldername and added the vbs under supportfiles...
so now i call run program with $WINSYSDIR$\\cscript.exe and parameter $SUPPORTDIR$\\removefolder.vbs $WINSYSDIR$test (as e.g. to delete folder test inside system32)
But i wonder why a such often used function like deletefolder is not inside the regular functions of installaware. Or I'm just blind and can't find it
removefolder.vbs:
On Error Resume Next
Set objArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
fldr = objArgs(0)
If fso.FolderExists(fldr) Then
fso.DeleteFolder fldr, True
End If
Set fso = Nothing
Set WshShell = Nothing
Set fso = Nothing
WScript.Quit(0)
so now i call run program with $WINSYSDIR$\\cscript.exe and parameter $SUPPORTDIR$\\removefolder.vbs $WINSYSDIR$test (as e.g. to delete folder test inside system32)
But i wonder why a such often used function like deletefolder is not inside the regular functions of installaware. Or I'm just blind and can't find it
removefolder.vbs:
On Error Resume Next
Set objArgs = WScript.Arguments
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
fldr = objArgs(0)
If fso.FolderExists(fldr) Then
fso.DeleteFolder fldr, True
End If
Set fso = Nothing
Set WshShell = Nothing
Set fso = Nothing
WScript.Quit(0)
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Delete Files Recursive, anyone?
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Use Call DLL Function on RemoveDirectoryA in kernel32.dll if you want to remove a folder that is already empty.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Re: delete folder function, only possible with vb-script ?
There should be a script command for this. I know that Windows Installer does it, it's not hard there, so this is just an oversight! Please add this feature!
Re: delete folder function, only possible with vb-script ?
The request for this feature has been noted.
In the mean time, to delete a folder, you'll need to:
Delete the contents of the folder:
Recursively Delete Files $path$\folder
Delete the (empty) folder:
Call DLL Function kernel32.dll->RemoveDirectoryA
In the mean time, to delete a folder, you'll need to:
Delete the contents of the folder:
Recursively Delete Files $path$\folder
Delete the (empty) folder:
Call DLL Function kernel32.dll->RemoveDirectoryA
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Re: delete folder function, only possible with vb-script ?
What's the status on this feature request? I uninstall my application and the TOMCAT folder left behind has a ton of EMPTY sub directories.
Re: delete folder function, only possible with vb-script ?
Chris,
For now, please use the workaround above.
For now, please use the workaround above.
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: delete folder function, only possible with vb-script ?
I appreciate the work around, but I'd like to check an alternate solution. Can you:
1) Recursively Delete Files "$path$\folder\*"
2) Recursively Delete Files "$path$\FileNameThatDoesNotExist.not"
Assumptions:
1) I want to delete all empty folders under $path$2) I'm confident that no files exist with the name given above
Thanks!
1) Recursively Delete Files "$path$\folder\*"
2) Recursively Delete Files "$path$\FileNameThatDoesNotExist.not"
Assumptions:
1) I want to delete all empty folders under $path$2) I'm confident that no files exist with the name given above
Thanks!
Re: delete folder function, only possible with vb-script ?
Hi,
How about you give it a try? Which version of IA are you using?
How about you give it a try? Which version of IA are you using?
Aviv Giladi
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
InstallAware Software
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Re: delete folder function, only possible with vb-script ?
I tested it out and everything seemed to work fine. We'll see how things go in a more complex environment, but I'm happy enough to go with it.
I'm using IA 12 Studio on Win 7.
Thanks,
I'm using IA 12 Studio on Win 7.
Thanks,
Who is online
Users browsing this forum: No registered users and 20 guests