/build/static/layout/Breadcrumb_cap_w.png

Cleanup during uninstall

I have written a custom action in VBScript that recursively deletes the sub-folders under TARGETDIR during uninstall. Unfortunately, it is failing due to permission issues on Vista. I have specified CA type as '6'. Also tried with '3078' (3072+6) but no luck.

The reason behind having such CA is to delete those folders (and files in those folders) that were created by the application and NOT during the installation. e.g LOGS folder to store logs etc.

0 Comments   [ + ] Show comments

Answers (9)

Posted by: cygan 14 years ago
Fifth Degree Brown Belt
0
just out of interest can you not use the removefile table
Posted by: anonymous_9363 14 years ago
Red Belt
0
Ah...an incomplete capture or failure to run the application after a test installation, to check for precisely that activity.

Anyway, as pointed out, just add the folder(s) to the RemoveFile table.
Posted by: milindsm 14 years ago
Blue Belt
0
Hello,

RemoveFile table will remove files and empty folders but what about the folders that are not empty...!!???
Posted by: cygan 14 years ago
Fifth Degree Brown Belt
0
ORIGINAL: milindsm

Hello,

RemoveFile table will remove files and empty folders but what about the folders that are not empty...!!???



read the sdk on the removefile table

enter the files only to be removed (these files will exist in a folder)

setting the filename column to null will remove empty folders

and don't forget your installmode flag
Posted by: milindsm 14 years ago
Blue Belt
0
setting the filename column to null will remove empty folders


But what about non-empty folders??? I have to empty them before deletion. And these non-empty folders can have even more sub-folders in-turn.

Moreover, I am not aware of folder names as the folder created due to application execution can have name something like Folder_Name_Timestamp
Posted by: thugz888 14 years ago
Senior Yellow Belt
0
try using tool suh as installrite it will help you determine what folder is being created during runtime
Posted by: milindsm 14 years ago
Blue Belt
0
BTW, I am not even able to remove an empty folder. This is how my RemoveFile table looks like

FileKey : Cleaner
Component_ : Some component key from Component table
FileName : left blank (I hope keeping it blank makes it null)
DirProperty : INSTALLDIR
InstallMode : 2

I have created a dummy folder called "[font="courier new"]Empty" at [font="courier new"]"C:\Program Files\Application Name\"
FYI, OS is Vista.
Posted by: anonymous_9363 14 years ago
Red Belt
0
the folder created due to application execution can have name something like Folder_Name_Timestamp
Only now we get this information?!? If you are unable to determine the folder names, you cannot use the RemoveFile table. You need to go back to your script.

So, back to square one...what "permission issues" are you having? If it's simply 'Access denied', you will need to permission the parent folder so that the uninstalling user has rights to delete files and folders AND ensure that permissions for sub-folders are inherited from the parent.
Posted by: milindsm 14 years ago
Blue Belt
0
I got it...!!!! Thanks all for your help!!! here's what i did...

  1. Created a CA (immediate execution say CA1) with TYPE 51 and Target [TARGETDIR]. Source name should be same as that of the custom action (say CA2) that will actually cleanup the folders and files created by the application during execution.
  2. Placed this CA before InstallInitialize with condition REMOVE="ALL".
  3. Created CA2 (Deferred) with type 3078 (3072+6).
  4. Placed it InstallExecute and before InstallFinalize with condition as REMOVE=”ALL”.
  5. Of course VBScript is anyway there in Binary table that will recursively delete the folder tree starting from the leaf node.
Now everything is working fine. Thanks again for your help. If you see any probable failure in this, please let me know..!!!
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