PDA

View Full Version : What type of install cleans up "lint" after an uninstall, but creates no files



Dean H
03-12-2008, 10:10 AM
If I wanted to create an install that basically cleans up any remaining "lint" after uninstalling our product such as registry entries and entries in the ALLUSERSPROFILE directory, but installs no files, what type of project would I need to create?

DLee65
03-12-2008, 01:49 PM
First, if possible I would recommend authoring this in the original install package if possible instead of leaving this to an outside setup.

However, if modifying the original install is not an option then I would normally use a pure InstallScript setup because you will be able to customize what it should do and then make sure it does not leave a footprint in Add/Remove programs.

Dean H
03-12-2008, 02:47 PM
Dan,
The problem is that there are many files that are generated after the install in the ALLUSERSPROFILE that do not get uninstalled. I have tried using the Direct Editor, but if any of those directories have subfolders, it will not delete any of the files in those directories. Any idea how this could be accomplished?

DLee65
03-12-2008, 03:07 PM
If the app is generating the extra folders, then this should be a finite number of folders I would just author the folders in the directory table and add the file types generated to the remove files table.

If these are user created files and folders and you want to give the the user the option of cleaning up the files in a particular directory and all sub directories I would tend to use an InstallScript custom action - but I would only delete user created files only with the user's permission.


Dan,
The problem is that there are many files that are generated after the install in the ALLUSERSPROFILE that do not get uninstalled. I have tried using the Direct Editor, but if any of those directories have subfolders, it will not delete any of the files in those directories. Any idea how this could be accomplished?

alegerlotz
03-12-2008, 03:25 PM
If the app is generating the extra folders, then this should be a finite number of folders I would just author the folders in the directory table and add the file types generated to the remove files table.

If these are user created files and folders and you want to give the the user the option of cleaning up the files in a particular directory and all sub directories I would tend to use an InstallScript custom action - but I would only delete user created files only with the user's permission.

I agree with Dan, this is what I've done in my latest Basic MSI and its working great.

I did have to author a custom action to cleanup one file and some of a directory structure because of the way the RemoveFiles list is created... Basically, the list of files and folders on the system seems to get read at or before the InstallInitialize Action. I have a service that gets shut down in the StopServices action, and part of that service's shut down is that it finalizes an open file and converts it to another type and changes the name. To work around this, I wrote a custom action to cleanup that file and the directories above it in the structure (if they don't have any user created files in them). I fire that action after RemoveFiles, deferred in System Context and its good to go.

-Al

Dean H
03-12-2008, 03:39 PM
The subfolders are generated by the install and contain intermediate files. When the application is started, additional files are generated form the intermediate files in the subfolders with different file extensions. I thought I read somewhere that if files are created, but not originally installed by the installation, and if they reside in a subfolder that they can't be removed using the RemoveFiles. The folders already reside in the Directory, and I have added them to RemoveFiles, but they never get deleted. However, the files in the root folder are deleted

DLee65
03-12-2008, 03:42 PM
That is not true. I have used the RemoveFile table to handle files that are generated by the app during runtime but that do not contain any user data. None of theses files were installed by the setup. I have also used the approach above to remove files from a folder that the application is generating at runtime if a user downloads information from the internet.

alegerlotz
03-13-2008, 06:24 AM
The subfolders are generated by the install and contain intermediate files. When the application is started, additional files are generated form the intermediate files in the subfolders with different file extensions. I thought I read somewhere that if files are created, but not originally installed by the installation, and if they reside in a subfolder that they can't be removed using the RemoveFiles. The folders already reside in the Directory, and I have added them to RemoveFiles, but they never get deleted. However, the files in the root folder are deleted


The confusion may be that they won't automatically get removed by the RemoveFiles action, but if you put specific entries for them in the RemoveFiles table (including wildcards if you like) they will be removed. You do, of course, have to put in explicit directory entries in your project for each sub directory that may contain application created files.

Dean H
03-24-2008, 09:05 AM
Sorry I did not reply sooner, I found out why the files we not getting deleted, I had transposed the last two characters, once I fixed the typo, the files were deleted. Thanks for all of your help