7

I am using Installshield 2010. I made a basic MSI setup, and I am having a problem with uninstalling.

Uninstalling does not remove all folders.

After a complete install, I then uninstall only to find that there is still a path leftover.

For example, C:\ProgramFiles\CompanyName\Account\User_1234.xml still remains, while everything else is gone.

The User_1234.xml file is generated by the application, and this file is not normally in the install process. So it makes sense why this file may have some problems getting rid of it (installer side).

At the same time, I would think that it would be removed due to the fact that it is within the CompanyName folder.

Is there any way to specify to get rid of everything inside and including the CompanyName folder?

Thanks for any ideas.

deralbert
  • 856
  • 2
  • 15
  • 33
Kyle Sprick
  • 103
  • 1
  • 1
  • 7

1 Answers1

9

You have a couple problems and I'll address the obvious one first. Yes, Windows Installer default behavior is to not delete user data. This could be files not installed by the installer or files that were modified since the installer modified them. To get the installer to remove them, you must author the RemoveFiles table to teach it which files to remove.

Remove Files Table (Windows Installer)

Now I'll address the less obvious problem. You shouldn't expect your application to be able to write to ProgramFiles at runtime. I don't know what your software does but you should seriously consider this aspect of your application design.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • 1
    How do you this in Installshield Express? Is it possible? – CJ7 Feb 24 '12 at 07:34
  • I'm not sure if you can or not. Express is meant to be simple and hides a lot of MSI concepts. I have tricks if Express will let you consume a merge module. I assume it will. – Christopher Painter Feb 24 '12 at 11:52
  • Express can consume a merge module, but I don't understand how a merge module could cause a folder to be deleted at uninstall. – CJ7 Feb 24 '12 at 13:17
  • A merge module is just a portion of a Windows Installer database that gets merged into the final database at build time. Once it's merged it doesn't exist. It's just a way of abstracting out portions of setup logic ( in this case RemoveFiles table information ) into a discrete chunk. – Christopher Painter Feb 24 '12 at 13:40
  • http://blog.deploymentengineering.com/2011/01/augmenting-installshield-using-windows.html http://blog.deploymentengineering.com/2011/01/augmenting-installshield-using-windows_19.html – Christopher Painter Feb 24 '12 at 13:41
  • Would Visual Studio's merge module creation tool allow manipulation of the RemoveFiles table? – CJ7 Feb 25 '12 at 01:16
  • Nope. Unless you count building once a simple 1 file merge module and then usig Orca to author the additional table and data into the static module. Visual Studio Deployment projects are quite horrible for sooo many resons and why they won't be in the next release of Visual Studio. – Christopher Painter Feb 25 '12 at 01:49
  • What about putting empty files in the MSI with the same name as files that the app will create? Would the MSI uninstall them or are they considered modified files and therefore not uninstalled? I am thinking of log files that will be created in %APPDATA%. – CJ7 Feb 25 '12 at 06:15
  • Perhaps you should post your questions as questions. – Christopher Painter Feb 25 '12 at 12:56