PDA

View Full Version : Windows Installer Repair breaks patched installation


NickSills
04-16-2008, 11:19 AM
Hi

Scenario:

1. Install the following files with Windows Installer:
prog.exe - Version 1.0
prog.chm - Help File

2. Run a patch to update to prog.exe to version 1.1 and patch the help file to the latest release.
3. The user then either deletes a required registry key OR clicks the 'Repair' button in 'Add/Remove programs'.
4. Windows Installer repair process replaces 'prog.chm' with the original BUT leaves prog.exe as version 1.1 because it won't replace a more recent version.

Problem:

The installation is now broken. The help file is for an older version of the installed exe! This is a problem with all files in the 'program files' directory that don't have version numbers. I've got a big problem because some users are trying to delete a required service. This is causing Windows Installer to 'repair' our programs and causing some critical files (that aren't .exe files) to get 'out-of-sync'.

Is there any way to stop Windows Installer breaking a patched installation?

Many thanks

Nick

Lorne
04-16-2008, 11:37 AM
You could try specifying a Registry key as the key file for the component that the .chm file is in.

You could try giving that file's component a condition to prevent the maintenance installation -- for example, based on the value of some other registry key that indicates the patched version.

Setting "Never overwrite" for that component might work too, depending on your long term update needs.

Some MSI actions were added in Visual Patch 3.0.2.0, so there might be a way to update that component when your patch is run (for example, it might be possible to use MSI.ApplyPatch with a small MSI file, or perhaps MSI.ReinstallFeature, to update the component information).

NickSills
04-16-2008, 12:38 PM
Hi lorne

Thanks for the quick reply:

'You could try specifying a Registry key as the key file for the component that the .chm file is in.'

Not sure what you mean. It's windows installer that's messing things up. The patch works, so the key file for the patch is irrelevant.

'You could try giving that file's component a condition to prevent the maintenance installation -- for example, based on the value of some other registry key that indicates the patched version.'

OK. So create a registry with the patch that indicates the patched version number. Then condition the installer to only install the file(s) if the patched version doesn't exist or is less than the installed version. Is that what you mean?

'Setting "Never overwrite" for that component might work too, depending on your long term update needs..

'Never overwrite'. I don't have any such option in either the patch or the installer. I'm using a Visual Studio Deployment project. Anyway that seems a bit dangerous.

'Some MSI actions were added in Visual Patch 3.0.2.0, so there might be a way to update that component when your patch is run (for example, it might be possible to use MSI.ApplyPatch with a small MSI file, or perhaps MSI.ReinstallFeature, to update the component information).'

I'm using Visual Patch so I don't have to use the terrible MSI patch process! Anyway, I think ReinstallFeature is causing the problem in the first place.

Have I understood your answers correctly?

Many thanks

Nick

Lorne
04-16-2008, 12:53 PM
Hi lorne

Thanks for the quick reply:

'You could try specifying a Registry key as the key file for the component that the .chm file is in.'

Not sure what you mean. It's windows installer that's messing things up. The patch works, so the key file for the patch is irrelevant.Actually I meant the key path for the component -- I was thinking key path but typed key file, sorry. :)

I'm not sure if it would work in your case, but setting the component's key path to a registry key might get around the version check.

'You could try giving that file's component a condition to prevent the maintenance installation -- for example, based on the value of some other registry key that indicates the patched version.'

OK. So create a registry with the patch that indicates the patched version number. Then condition the installer to only install the file(s) if the patched version doesn't exist or is less than the installed version. Is that what you mean?Yes, exactly.

'Setting "Never overwrite" for that component might work too, depending on your long term update needs..

'Never overwrite'. I don't have any such option in either the patch or the installer. I'm using a Visual Studio Deployment project. Anyway that seems a bit dangerous.Yeah, that's our name for it in the Setup Factory for Windows Installer interface...I'm not sure what the MSI name is offhand. But I agree it seems riskier than the other options.

'Some MSI actions were added in Visual Patch 3.0.2.0, so there might be a way to update that component when your patch is run (for example, it might be possible to use MSI.ApplyPatch with a small MSI file, or perhaps MSI.ReinstallFeature, to update the component information).'

I'm using Visual Patch so I don't have to use the terrible MSI patch process!I hear that! MSI patches are difficult to make, and even harder to make sense of.

We've tossed around the idea of making an MSI patching tool based on our DeltaMAX technology, but the technical hurdles are pretty formidable. MSI is a really difficult technology to work with all around.

Anyway, I think ReinstallFeature is causing the problem in the first place.

Have I understood your answers correctly?Yes, except for the first one, which I hope I've clarified above.