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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
just out of interest can you not use the removefile table
Answered 03/17/2010 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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.
Answered 03/17/2010 by: VBScab
Red Belt

Please log in to comment
0
Hello,

RemoveFile table will remove files and empty folders but what about the folders that are not empty...!!???
Answered 03/17/2010 by: milindsm
Blue Belt

Please log in to comment
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
Answered 03/17/2010 by: cygan
Fifth Degree Brown Belt

Please log in to comment
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
Answered 03/17/2010 by: milindsm
Blue Belt

Please log in to comment
0
try using tool suh as installrite it will help you determine what folder is being created during runtime
Answered 03/17/2010 by: thugz888
Senior Yellow Belt

Please log in to comment
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.
Answered 03/18/2010 by: milindsm
Blue Belt

Please log in to comment
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.
Answered 03/18/2010 by: VBScab
Red Belt

Please log in to comment
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..!!!
Answered 03/18/2010 by: milindsm
Blue Belt

Please log in to comment
Answer this question or Comment on this question for clarity