Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

How to remove the installed folder (not [INSTALLDIR]) during uninstall (Windows Installer Editor)

Updated: 02 Jul 2010 | 15 comments
Gary Koay's picture
0 0 Votes
Login to vote

 Hi All,
need help from you all, may i know how to set to remove the installed folder during uninstall operation.
The directory mentioned here is not the default installing folder  [INSTALLDIR].

Thanks!

discussion Filed Under:

Comments

EdT's picture
22
Feb
2010
0 Votes 0
Login to vote

Your question makes no sense

If you install an MSI, and the user chooses a different folder to the default, then the uninstall will still remove the installed folder.
So perhaps you are asking something else? Are you asking how to remove a folder created by the execution of the application, that is not actually "installed" by the MSI ?

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Gary Koay's picture
22
Feb
2010
0 Votes 0
Login to vote

i have more than 1 installed folder

Hi EdT,

Actually the packaging that i need to build need to configure more than 1 installation directories therefore MSI done now during uninstall is just remove the [INSTALLDIR] folder and did not remove other installation directories.

Bro, if you're not cleared with my explanation kindly ping me again.

Thanks a lot!

EdT's picture
23
Feb
2010
2 Votes +2
Login to vote

Add content to the RemoveFile table

From the Installation Expert/ File wizard, you can add files to the project, then you can select the files and choose the option to delete them. In the option you can select whether to delete on install, uninstall or both.
This should tackle any content that is not getting removed during uninstall.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Dell Packager's picture
23
Feb
2010
0 Votes 0
Login to vote

There are 2 reasons for the

There are 2 reasons for the file/folders not getting uninstalled, if there are any files created in that folder during the runtime, try to add *.* to remove file table during install and uninstall.

check if there are any process running which are holding these file (files in use).

Gary Koay's picture
23
Feb
2010
0 Votes 0
Login to vote

Thanks for the Solution from EdT but facing another concern

Hi EdT,
thanks for your guidances as it was able to remove the directory now but i'm still facing the problem when it has some sub-directories inside, it still unable to be removed......

any advice that could helps me on?

Thanks!

VBScab's picture
24
Feb
2010
1 Vote +1
Login to vote

For Pete's sake...

...Google for 'windows installer RemoveFile table'. The first hit will the MSDN article. Read and inwardly digest. Pay particular attention to its use of the word 'empty'.

Then, revise your knowledge about DOS, in particular about removing folders with content.

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

EdT's picture
24
Feb
2010
1 Vote +1
Login to vote

To summarise

VBScab is correct in his usually subtle way.

If you have a tree of files and directories, you need to delete the content in exactly the same way as you would from a DOS prompt. If you know the entire structure you need to remove, then you need to include it in your RemoveFile table folder by folder.
From my observation, the RemoveFile table works from the top down, so you need to organise the entries so that the files at the bottom of the directory tree appear first, then the folders.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Gary Koay's picture
24
Feb
2010
0 Votes 0
Login to vote

if the sub-folder structure is dynamic type

  Hi VBScab & EdT,

firstly thanks for your advices and i have gone through your suggestions already and still failed to get any solution.....

My this directory will keeping the application's temporary files therefore do not have the fixed structure that will be declared therefore maybe need your further advice on this as i'm still testing with your useful suggestions......

Thanks a lot!

EdT's picture
25
Feb
2010
0 Votes 0
Login to vote

Then use a custom action

There are plenty of "Deltree" vbscripts to be found by googling. Use one of these to nuke your folders by running it as a custom action, with a condition of REMOVE="ALL" so that it runs only on uninstall.
You can also consider using wildcard characters in your RemoveFile table entries for removing all files in a folder. That will work too, but if you have an unknown folder structure then a vbscript as above is really the best solution.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Dell Packager's picture
05
Mar
2010
0 Votes 0
Login to vote

I did found the same issue

I did found the same issue with some applications. i had used the remove file table, as well as wise script custom action to cleanup the files, make sure that you are not deleting any files related/required for the user. in some cases if the application is still running the background such as quick launch it will not remove those folder are files and some times folders are created on the fly, if that is the case add them to the create folder table in that way they get uninstall during uninstall.

milindsm's picture
17
Mar
2010
0 Votes 0
Login to vote

VBScript way fails on vista

I have written a VBScript CA to recursively delete the files/folders. But it fails on Vista (I guess due to UAC). Can I know where should I place this CA in sequence table so that it will run in elevated mode??

AngelD's picture
18
Mar
2010
1 Vote +1
Login to vote

You need to sequence any

You need to sequence any custom action that are making system changes in deferred execution.

Evilweasel's picture
01
Jul
2010
0 Votes 0
Login to vote

I have a similar problem :I

I have a similar problem :I am trying to make a checkbox on a dialog  during the uninstalation that asks the user if to delete a directory directory and it's content.  So if the checkbox is checked the folder should be deleted . if it is not checked the folder should remain on the machine.  Any ideea how can i do it ?
I am using Wise instalation studio 7.0

VBScab's picture
01
Jul
2010
0 Votes 0
Login to vote

IIRC...

...all the information you need is in the help file. Hit F1 in the Dialog Editor.

Don't know why 'x' happened? Want to know why 'y' happened? Use ProcMon and it will tell you.
Think about using http://www.google.com before posting.

EdT's picture
02
Jul
2010
0 Votes 0
Login to vote

How you do it depends on

How you do it depends on whether the directory and its content is part of the original installation or not. If it is part of the original installation, then it is going to get removed during uninstall regardless of your dialog.
However, I recommend you open a new thread with this issue.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.