windows-installerinstallshieldinstallshield-2009

InstallShield remove file not originally installed on uninstall using RemoveFile


First off, I know that there are similar questions on SO, but I have yet to see any answer that fits my issue.

InstallShield 2009 installs my program, and my program creates an ini file. When the program uninstalls, it leaves the ini (because it wasn't in the original installation). I tried to use RemoveFile in the direct editor. I gave it the property, the correct installmode, but I have no idea what "Component" is, or what I'm supposed to do with it. I've dug through every InstallShield help file and looked online but everything that describes "component" is extremely ambiguous. The debugger doesn't throw any errors or warnings related to the RemoveFile, but the file continues to stay when I run the new uninstaller. I have been struggling with this issue for days now and have tried all sorts of things in RemoveFile to no avail!

Simply... I just want to delete an ini that is located within the install directory where it installs the executable. What is the easiest way to go about this, and what is the "Component"?


Solution

  • The component is required by the Windows Installer to detect whether to handle the "removefile instruction" at all. I quoted that term because there's no such term, actually - it's just for the ease of explanation.

    So, if the component is scheduled for installation (included into the feature being installed, condition resolves to true), and InstallMode is "remove on install or both", the Windows Installer will try to find the file(s) you specified in FileName located in the DirProperty and will try to remove it.

    If the component is scheduled for removal, and InstallMode is "remove on uninstall or both", the same logic will work on uninstall.

    In case the component is not to be installed/uninstalled (for instance, another feature is being installed or condition is false), the "removefile instruction" will be ignored by the Windows Installer.

    Hope this makes more sense now.