R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

"Always overwrite existing file" causes broken Patches

Hi,

I have a third party dll, which is part of my setup. In the past this dll was provided by the vendor with a higher version number, then they suddenly changed the version number of this file to a lower version (this already happens years ago). As result I need to set "Always overwrite existing file" for this file, otherwise the file is missing, e.g. after a major update or has the wrong version.

Now we started patching. The option "always overwrite" still needs to be set on the base setup, in case a customer is updating from an older version. Typically (especially when working with virtual machines) we are using ISO files, which are mounted into the DVD drive of the testing machine. That means, the product is installed (let's say version 10) to update the installed version 9. The Product Code of this version (V10) was changed to favor a major upgrade. The installation media is removed after installation.

Then the patch (V10.1) is going to be installed. Here we can investigate two different behaviors:
1) If the patch is just installed via double clicking on the msp file, the patch installation will fail because the source media is unavailable. The user has to provide the installation source (network folder) or DVD. In case of DVD it fails anyway on an UAC enabled system.
2) If the patch is installed unattended via our own updater, then its working fine. The updater is installing the patch with the option /qb to do not allow any user interaction, just status messages.

According to the log files, the reason why it fails in case 1) is, that the installer tries to reinstall the third-party-dll (due to "Always Overwrite"), but the file is not contained in the patch file (this is clear, it wasn't changed compared to original V10 setup). The installation in case 2) runs through, because it somehow worked completely different (its running more on MSI server side, as far as I understand).

As a workaround, I added the same file again to the patch into a new component and set the condition of the original component of the third party dll to "FALSE" to force an uninstall of this component. But the trouble is now starting again, hence we are preparing the next update. I run now into the same issues as before with update 1 without the workaround (file is not replaced or media is requested). Setting a component to "Always Overwrite" seems to break proper patching afterwards.

I built the installer of this version with Advanced Installer 9.9. To no break patching, I need to stay with this version (probably forever) as long as we will support this version. The first version and the first update are already released and can't be changed anymore.


The questions are:

1) Is this behavior a well known issue?
2) How do I add files with a lower version properly, so that patches are not broken afterwards?
3) What should I do in the future, with the next "Major Update" of our product to avoid similar problems?

Regards,

R.Mueller
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Roland,

I'm not sure why you encounter this behavior, however, it shouldn't be related to the "Always overwrite existing file" option.

Can you please send us the three .AIPs (the old version, the new version and the patch) and also a link to download your packages (Target, Upgrade and Patch) to support at advancedinstaller dot com so we can investigate them and try to find the problem?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Eusebiu,

better, I have prepared test projects which exactly reproduces this issue. I will sent a zip containing all files to support.

Regards,

Roland
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Roland,

I tested your packages and I reproduced the behavior which, indeed, seems to be caused by the "Always overwrite existing file" option. It seems that Windows Installer Patch feature does not support this option and this might be related to the File Versioning Rules.

Although, if you really want to create a patch instead of a major upgrade, you can try to use the solution described in this thread.

Just let us know anytime you need help.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Eusebiu,

as mentioned in my first post, there was already a major version in between (V10) to favor a major update. Until this point, everything was running as expected (the third-party-dll gots overwritten). When I now try to apply the patch for version 10.1 (so after the file was replaced) I run into this issue. And for sure, there will be a major update in the near future to be installed with our next major version, but we the customer might have V9 or older installed, with the buggy version of this third-party-dll. That's why "Always overwrite" is set, to make sure, the file is overwritten.

What is your recommendation to solve the issue?

As I understand, this should be a patch issue in combination with Microsoft's rules of file replacements. Shouldn't the file being replaced, as soon as a major update (V10) is installing another (lower) version of this file?

Should I change or keep the component guid, compared to V9, in the patch or in the major version?

Is there a trick or cheat I can use in the setup, which will be the base for creating a patch to avoid this kind of trouble or to force installation of that file?

Your idea with the second setup, which is not registered in the Windows Installer Database is a good cheat, but its a no-go for patching, if you only provide msp files to the end users (like we do).

Any further ideas?

Thanks in advance

Roland
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Roland,

Sorry for the delayed reply.
as mentioned in my first post, there was already a major version in between (V10) to favor a major update. Until this point, everything was running as expected (the third-party-dll gots overwritten). When I now try to apply the patch for version 10.1 (so after the file was replaced) I run into this issue. And for sure, there will be a major update in the near future to be installed with our next major version, but we the customer might have V9 or older installed, with the buggy version of this third-party-dll. That's why "Always overwrite" is set, to make sure, the file is overwritten.
Please keep in mind that the patch can be installed only if the target version of the product (in your case V10) is installed on the machine. It cannot be installed if only V9 or older is installed on the machine.
What is your recommendation to solve the issue?
To solve this issue you can either create a major upgrade or use the solution recommended in my previous post. Also, you can try to go in the patch .AIP file, select the "Upgraded" image and use the "Ignore Package Files" feature, then select your DLL file which will be ignored when the patch is created and installed (this file was already replaced by the V10, so there is no problem if the patch ignores it).
As I understand, this should be a patch issue in combination with Microsoft's rules of file replacements. Shouldn't the file being replaced, as soon as a major update (V10) is installing another (lower) version of this file?
Indeed, the file is replaced by the V10, but the patch tries to replace it again if the "Always overwrite" option is selected.
Should I change or keep the component guid, compared to V9, in the patch or in the major version?
I don't think changing or keeping the component GUID, compared to V9, would help in your case.

Let us know if you have any other question.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: "Always overwrite existing file" causes broken Patches

Also, you can try to go in the patch .AIP file, select the "Upgraded" image and use the "Ignore Package Files" feature
Unfortunately this feature is only available in newer versions of AI. The underlying setup of V10 was created with AI 9.9, so I have to stay with this version for patching, otherwise I get a big fat red warning.
Please keep in mind that the patch can be installed only if the target version of the product (in your case V10) is installed on the machine. It cannot be installed if only V9 or older is installed on the machine.
This is true. What do you exactly mean by this statement? That I should remove the "Always Overwrite" option in the later versions?

Thanks for helping!

Regards,

Roland
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Roland,
Unfortunately this feature is only available in newer versions of AI. The underlying setup of V10 was created with AI 9.9, so I have to stay with this version for patching, otherwise I get a big fat red warning.
I'm not sure why you encounter this behavior, but it should work. You can create and build V9, V10 and V10.1 with AI 9.9, then create the patch project with AI 10.3 which has the "Ignore Package Files" feature available and it should work as expected.
This is true. What do you exactly mean by this statement? That I should remove the "Always Overwrite" option in the later versions?
Yes, I meant that this option is no longer needed in the patch because the file was already replaced by the V10 of the product, so it can be disabled here and re-enabled for the V11 if needed.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Eusebiu,

this is the normal case:
Setup_9.9_patch.png
Setup_9.9_patch.png (49.24 KiB) Viewed 13024 times
and this happens, after I opened and rebuild the project with AI 10.3 (with definitely no other changes):
Setup_AI10.3_update_from 9.9_patch.png
Setup_AI10.3_update_from 9.9_patch.png (50.8 KiB) Viewed 13024 times
Regards,

Roland
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Roland,

What I wanted to say in my previous post is explained below:
V10 - create project with Advanced Installer 9.9 and build it with Advanced Installer 9.9 too
V10.1 - create project with Advanced Installer 9.9 and build it with Advanced Installer 9.9 too
Patch - create project with Advanced Installer 10.3, add the "Upgraded" and "Target" packages and build it with Advanced Installer 10.3

I tested it and it worked well to me.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
R.Mueller
Posts: 202
Joined: Thu Aug 02, 2012 3:31 pm

Re: "Always overwrite existing file" causes broken Patches

Hi Eusebiu,

I only have to create the patch with AI 10.3, sorry this was a misunderstanding. I will give it a try!

Thanks so far for your help!

Regards,

Roland

Return to “Common Problems”