Updater and disappearing files - Advanced Installer Community
LaughingJohn
Posts: 39
Joined: Wed Aug 11, 2010 1:05 pm

Updater and disappearing files

Hi,

I have an office add-in packaged using Advanced Installer Pro. When upgrading either by the updater or manually over an existing installation I noticed that my main dll was disappearing. A fresh install worked fine. I've done some research into this and realise that it is a windows installer issue because of file versioning rules and the fact that I had forgotten to update the version of my dll. So I updated it and all behaved as expected.

However, I'm still struggling a bit to understand the various settings in Windows installer and advanced installer that affect this behaviour and wonder if you can help my understanding:

1. This only seemed to affect my main dll. I have a number of other files (including other dlls) that are also packaged as part of the deployment without me changing their version numbers yet these seem to reinstall OK. Can you give me any idea why this might be? Is it because this is the main file or does it have something to do with the file modified date having changed on that one file? All files are set to "overwrite if the existing file is older" in the Operations part of Advanced Installer's File Properties.
2. I have my upgrade option set to "Uninstall old version first and then install new version". Given this I assumed the old version would be fully uninstalled, so the main dll would no longer exist before the new version is installed. So why/how does it check the versions? Does it check before the uninstall of the old version is run?
3. Is there a way of forcing the main dll to be installed if the version is greater or THE SAME? From reading other posts I've come across the REINSTALLMODE property which looks like it might help my situation. It look to me like changing the REINSTALLMODE from omus (which I believe is the default) to emus will prevent the disappearing file issue. Can you tell me how I change REINSTALLMODE in Advanced Installer? Is it at the package level or can you set it for each file?
4. Finally can you tell me if there any disadvantages to REINSTALLMODE emus instead of omus?

Thanks,
LJ
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Updater and disappearing files

Hi LJ,

Windows Installer has a specific set of rules for file replacement operation when a file already exist in the destination location. Here are the possible permutations for file versioning:
  • In case when the source file and the destination file are both versioned files, the rules are straightforward: Highest Version Wins.
  • In case when only one of the file is versioned. Here the are two cases:
    • a) source file is versioned and the destination file is not versioned: the unversioned file will be replaced with the versioned file;
      b) source file is unversioned and the destination file is versioned: the versioned file will not be replaced with the unversioned file;
  • In case the source file and the destination file are both unversioned files: Windows Installer will compare the created time and the last modified time of the destination file.
Read more about this in the File Versioning article.

If during an upgrade operation there are files missing from the installation folder, then the next step to troubleshoot this is to create a verbose log of the installation process.

If you can find the following message: Disallowing installation of component: GUID's component since the same component with higher versioned keyfile exists in your log, then this is the reason why your file is not coppied on the target machine.
The upgrade process performs the following actions:
  • Detect and completely remove older products. During this operation the file will be removed from the machine.
    Install the new product. The file from the upgraded version will not be installed since its component was not marked for installation.
To overcome this behaviour, you can enable the Always overwrite existing file option from the File Operations Tab of the File Properties or to increase the version of the resource from the upgraded version.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
LaughingJohn
Posts: 39
Joined: Wed Aug 11, 2010 1:05 pm

Re: Updater and disappearing files

Thanks Dan, that was very helpful. So I have a couple of additional questions:

1. How do I know whether a file is a versioned file or not in the Advanced Installer UI? When I look under the Version Tab in File Properties it says "Get from File" for pretty much all my files. The other options are "user specified" and "make file companion of". Which one of these makes a file versioned or not, or it just the presence of a version on the actual file itself?
2. Assume my file was versioned before and after. Is it true that if the same file exists with the same version, the upgrade process (we always do major upgrades) will check to see if it needs to replace the file, decide not to because the versions match. It then deletes the file and doesn't replace it? Even though in this case the date modified of the source file will be more recent? I appreciate this is windows installer and not AI, but I'm surprised it deletes the file and doesn't either replace it or leave the old one there... I looked at the link here: https://msdn.microsoft.com/en-us/librar ... 85%29.aspx and it seemed to suggest that it won't delete a file!?
3. What's a keyfile? Where is this defined in AI?
4. What does "Always overwrite existing file" actually do? Is this a windows installer feature? Does it set the version very high or is it changing REINSTALLMODE?

Thanks again,
LJ

Return to “Common Problems”