/build/static/layout/Breadcrumb_cap_w.png

Delete files/folders created by the software

Hello.

I'm using InstallShield, and I want to know how to make the msi delete the folders created by the installed software. By default, the msi uninstalls only the files that it installs. All the other files created are treated as user data, so it doesn't remove them during uninstallaiton. So how can I make the msi remove all the files and folders?

Thank you.

0 Comments   [ + ] Show comments

Answers (6)

Posted by: nmi 19 years ago
Orange Belt
0
By design, the MSI will only remove folders it installs. If you think about it, there is no way that the MSI could know what folders and files are created by something external to it.

One course of action is to create a custom action which executes a batch file that removes the files/folders when you do an uninstall. Of course, you need to know what folders/files are created by the application to do this.

nmi
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
You need to use the 'RemoveFile' table.

Below is an example of this that will delete all the files in the 'Data' folder and then delete the 'Data' folder itself when the 'myComponent001' is uninstalled:

FileKey Component FileName DirProperty InstallMode

FileKey001 myComponent001 * Data 2
FileKey002 myComponent001 Data 2


Got it? Make sense?

[8D] Keep cool [8D]
Posted by: totoymola 19 years ago
Orange Belt
0
By design, the MSI will only remove folders it installs. If you think about it, there is no way that the MSI could know what folders and files are created by something external to it.

One course of action is to create a custom action which executes a batch file that removes the files/folders when you do an uninstall. Of course, you need to know what folders/files are created by the application to do this.


Yes, I know that, and I'm completely aware of the folders that the software creates. I was thinking of making a custom action to execute during uninstallation, but I don't know how to schedule it. I know how to schedule a custom action during installation, but not during uninstall. How do you do that?

You need to use the 'RemoveFile' table.

Below is an example of this that will delete all the files in the 'Data' folder and then delete the 'Data' folder itself when the 'myComponent001' is uninstalled:

FileKey Component FileName DirProperty InstallMode

FileKey001 myComponent001 * Data 2
FileKey002 myComponent001 Data 2



Got it? Make sense?

Hmm.. Not really.. As you can see, I'm a newbie (I hate to admit it, but it's true). Could you give me a more detailed explanation about that? It looks interesting.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
OK, the first thing to deleting a folder on uninstallation of the application is to delete all the files within the folder first (if the folder is not empty, the MSI can't delete the folder.)

eg: FileKey001 myComponent001 * Data 2

Then, once the folder is empty you can then delete the folder.

eg: FileKey002 myComponent001 Data 2



For you to implement this in your MSI, you need to find out two things: a component, and the Directory name in the Directory table.

I hope I've explained things better this time. Let me know...
Posted by: totoymola 19 years ago
Orange Belt
0
Thank you for your reply, Mr B. However, I don't think I can do that with my setup. The software that I'm trying to repackage creates files in the %appdata% folder on first run. So I don't think it's in the components of my msi.

What I was trying to do is run an exe that will do this

RD /Q /S "%APPDATA%\My_App"

How can I schedule it to run on uninstall? I searched MSDN library and saw the REMOVE property. But I don't understand it's use. Do I have to schedule the exe and simply add the REMOVE=ALL condition? Will that make the custom action to run during uninstallation?

Thank you.
Posted by: brenthunter2005 19 years ago
Fifth Degree Brown Belt
0
[8D]

Ahhhh, that makes it a little bit more difficult.

Because the files are stored in the users profile, it is really needed to be deleted on uninstallation?

If so, what I would probably use is an ActiveSetup script. On uninstallation, I would write the neccessary registry keys so that when any other user logs onto the computer this ActiveSetup will run and delete the files/folders.

ActiveSetup is already explained on this site, so do a search.
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