/build/static/layout/Breadcrumb_cap_w.png

Need a VB Script to delete a Rational folder

Hi
I face a problem while uninstalling Rational Rose Enterprise Package.
The Rational folder is not deleted.I used many sripts but all those scripts worked well outside the package when i insert this in the wise package the folder is not deleted.Can anyone solve this problem?Plz help me out with this.
Tell me if any custom action and in which sequence the script should be placed.
Thanks,[:(]

0 Comments   [ + ] Show comments

Answers (7)

Posted by: Inabus 17 years ago
Second Degree Green Belt
0
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
objFSO.DeleteFolder("C:\Test")

Also remember to set a condition on the custom action to "Installed" as you wouldnt want it to run when you install the application.

I would try setting this before InstallFinalise in the Execute sequance.

Paul
Posted by: aogilmor 17 years ago
9th Degree Black Belt
0
You may also want to look into the RemoveFile table so you don't have to mess with a script.

http://msdn2.microsoft.com/En-US/library/aa371201.aspx
Posted by: abcd123 17 years ago
Yellow Belt
0
Hi Paul,
Thanks for your reply.I tried your solution and aogilmor's solution but both the solutions did not wirk well inside the MSI.
Can you suggest any other solutions.In this one file inside one of the sub folder is deleted if we restart the system.
Posted by: nheim 17 years ago
10th Degree Black Belt
0
Hi abc,
you need to be a lot more specific, if really you want to get help.
Please post your script and the calling Custom Action.

How did you implement the solution with the RemoveFile table as Owen suggested?
That should work, but to make id rock solid, you have to recourse the folders from the deepest level and
create a line for each folder with a wildcard "*", which has the slightest possibility to contain leftovers after uninstall.
If a folder is not created by a main Installer action (directory or create folder table), you have to remove it also explicitly.
Hope, this gives yo some hints.
Regards, Nick
Posted by: anonymous_9363 17 years ago
Red Belt
0
Does the account running the MSI have appropriate rights to delete the folder? Does the folder have any attribute(s) set, like read-only or hidden?
Posted by: abcd123 17 years ago
Yellow Belt
0
Hi Nick
I used the following script to delete the folder
target = "C:\Program Files\Rational"
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FolderExists(target) Then
fso.DeleteFolder (target) (True)
End If
This script deleted some .dat files inside one sub folder and one dll file was there in another subfolder but that dll also got deleted when i rebooted the system.
After rebooting also all the subfolders remain.In this one subfolder contains another empty subfolder.
The sequence was Normal Execute Immediate\Deferred and i placed before InstallFinalize with the condition REMOVE="ALL".


In the RemoveFile table in the filekey column i gave "key1" and in the component column i gave one component related tho this application in the filename column i left it blank and in the Directory column i gave the Dir path from the directory table.

Could you just tell me little briefly how to delete the folder if it is not created in CreateFolder.

I got the MSI of the package and i created the MST.
Posted by: anonymous_9363 17 years ago
Red Belt
0
abcd123, aka abrindadevi (on the Altiris forum)

No, this script did NOT. It cannot be selective about which files it deletes. It will delete a folder and its sub-folders, period.

In a response to your post on the Altiris forum, I detailed the steps you need to follow to have Wise delete a folder. However, for the benefit of others, this is from WPS's help:
1. In Setup Editor, on the Components or Features tab, right-click a component or feature and select 'New > Remove File'

The "Remove File Details" dialog appears.

2. Complete the dialog:

- Directory

Specify the directory on the destination computer where the file is located or create a new subdirectory. To create a new subdirectory, select a directory and click 'New Folder'

- File Name

Specify the name of the file to be removed. You can use wildcards to select multiple files or you can check the 'All Files' check-box to select all files in the selected directory.

- Remove During

Specify when the file should be removed: during install, uninstall, or both install and uninstall.

3. Click OK.

The operation to remove a file from the destination computer appears, preceded by a red 'X'.

As EdT on that forum reminded us, if you use this method, you need to start at the bottom of the folder tree and do ALL the folders above individually.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ