Search code examples
installationinstallshield

Installshield won't update files after component has been removed


Basic .msi project.

Installshield 2010.

Im my installation project v1.0.0.0 i have added some components:
1. Went to "Installation designer" tab -> "Organization" menu category -> "Components" sub menu.
2. Right click "Components" -> "New component".
3. I append a new folder name "dir1" to the [INSTALLDIR] destination.
4. Then i add a file.
5. Went to "Organization" -> "Setup design"
6. Created a new feature
7. Right click the feature and select "Assign components"
8. I select the component

Build, Install.

Then i up the version of my installation to v1.0.0.1
1. Added new component again.
2. Appended destination with a different directory name [INSTALLDIR]dir2
3. Added a file.
4. Went to "Setup design"
5. Right click the feature and select "Assign components"
6. Selected the second component i created.
7. Then went to "Components" and deleted the first component.

Build, install.

At this point, nothing updated. I still see the Dir1 and there is no Dir2 in the application installation directory.

If i try to uninall, it will remove the application for the "Uninstall programs" list, but none of the files are removed at all.

What did i do wrong and how do i fix this?

google has zero help on this. I might not know what search words to use for this kind of problem.

If i completely uninstall my project and manually delete all the files, and then install the new version, then it is all ok and it creates dir2, but i need this to work not only with fresh install, but update too.

SOLUTION (for me at least)

While the M F solution is good for when you have not yet done damage to your installshield project, i will document my own steps on how i fixed this after the damage has been done and there is no backup saved.

In the 'Installation Designer' view:
1. Installation information -> General Information -> Product code, i click on Generate a new GUID button.
2. Media -> Upgrades -> Prepare setup for Upgrade Scenarios -> Upgrade Windows Installer Setup. Right click it and select Add major upgrade item.
3. Common -> Major upgrade. Leave the Products sharing my Upgrade Code checked.
4. Common -> Product Version. Select Within a specific range of versions and input current build version into 'max' box.

Now when application is being installed with this new install file, it will automatically uninstall the older version with all of its components and install the new version with new components.


Solution

  • You cannot remove components between minor installs.

    You can set the component condition to '0' so that the condition does not install and delete any files that are in the component. But leave the component as part of the project. If you want to remove the files installed as part of the original component then add the files to the component with remove files settings.

    If you output a verbose log you will see in the log file that it complains that a component was removed. Or if you validate the new build against the old build it will says that you cannot remove a component.