Missing files/folders after successful update? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Missing files/folders after successful update?

Hello everyone.

Attached is a project which includes one directory and one .exe file.

There are two copies (versions) of the project, V1.0.0 and V1.0.1.

The .exe file of V1.0.0 is a binary created with Advanced Installer.

The .exe file of V1.0.1 is a binary created with Visual Studio and which does not contain any meta-data (version information, etc.).

When I install V1.0.0 or V1.0.1 as a new installation, everything works as expected.

When updating V1.0.0 with V1.0.1 the complete application folder (C:\Program Files\Your Application\TEST_Missing) is missing after the installer exists.

Is there an explanation for this behavior? I have a gut feeling that it may be related to file versioning (the second .exe file is missing version information afterall), but this is absolutely not the behavior that I would have expected.


P.S.: Sending the projects failed due to upload size restriction, sent to AI support instead.



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Missing files/folders after successful update?

Hi Clemens,
Is there an explanation for this behavior? I have a gut feeling that it may be related to file versioning
The upgrade process works like this:
- the new package runs
- an older package is detected
- the old package is uninstalled
- the new package is installed

After the old package is detected, Windows Installer automatically determines which files will be installed based on the file versioning rules.

Since the EXE is already installed, the one in the old package is compared to the one in the new package. However, the EXE in the new package does not have a version, therefore it will not be installed (according to the file versioning rules).

During the upgrade the old file is removed and the new one is not installed. Since the installation folder contains only one file, if this file is not installed, the folder is not created.

A solution for this would be to use the "Ensure that this file overwrites any installed target file" option in the Version tab of the "Edit File" dialog. This will make the file have a temporary high version during the installation process in order to be marked for installation.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

Hello Cosmin,

thank you for the explanation.

You say that "During the upgrade the old file is removed and the new one is not installed.". This seems to be very unexpected behavior to me. Isn't it a bug?

I can guarantee that I will be able to explain this to my co-developers - and that they will forget about it in a few weeks again and then bump into this issue when they replace a file the way the test case did.

Unfortunately, because we are using a synchronized folder, we cannot configure this for each file. Even if the project would remember individual file settings when updating the synchronized folders, newly added files won't have the necessary "Ensure that this file overwrites any installed target file" option.

Is there anything else I can do to remove this possible error case (monthly reminders to everyone don't count)?

There isn't a switch in AI to configure all files to have the "Ensure that this file overwrites any installed target file" on by default, is there?



With best regards

Clemens Anhuth
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

Hello again,

by the way, we have 28 .exe files and 85 .dll files in our project. Configuring every individual file will be painful.



With best regards

Clemens Anhuth
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

Hello everyone.

I think here is another case of how files can be missing after successful updates:

http://bonemanblog.blogspot.com/2004/08 ... g-dll.html



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Missing files/folders after successful update?

Hi,
You say that "During the upgrade the old file is removed and the new one is not installed.". This seems to be very unexpected behavior to me. Isn't it a bug?
Yes, it is a bug in Windows Installer. Since the original file has a version, the upgraded file should have a higher version. Otherwise, there is no way for Windows Installer to determine that the new file is the upgraded version of the original one.
Is there anything else I can do to remove this possible error case
A good solution for this problem is to use versions for all the files which support it. Also, if a versioned file is modified, you should increase its version (from its source code).
There isn't a switch in AI to configure all files to have the "Ensure that this file overwrites any installed target file" on by default, is there?
I'm afraid that Advanced Installer doesn't have this type of options. However, we have on our TODO list a feature which will allow you to set this attribute for a folder.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

cosmin wrote:
You say that "During the upgrade the old file is removed and the new one is not installed.". This seems to be very unexpected behavior to me. Isn't it a bug?
Yes, it is a bug in Windows Installer. Since the original file has a version, the upgraded file should have a higher version. Otherwise, there is no way for Windows Installer to determine that the new file is the upgraded version of the original one.
I disagree with this approach. There are enough reasons that a file's version is not a linear, stable information that can be counted.

It is enough to replace "doXYZ.exe" from site http://www.vendor1.com with "doXYZ.exe" from http://www.vendor2.com to run into this problem unexpectedly because you didn't check whether the the version information state of previous and new file.

Or imagine I integrate and then update the Sun JDK in my product - I cannot honestly be expected to check all *.exe and *.dll files for their version information state. It is error prone to expect me to think of that when I replace files in the installer, and it is error prone (and time consuming) to check the version information state. Plus in the case of Sun Java I am probably not even allowed to replace individual files (as far as I remember it's an all or nothing deal).
Is there anything else I can do to remove this possible error case
A good solution for this problem is to use versions for all the files which support it. Also, if a versioned file is modified, you should increase its version (from its source code).[/quote]

I may not have that level of control over external files, and I may forget about this, then I will end up with a "broken" installer. I can already tell that management of my company won't accept this.
There isn't a switch in AI to configure all files to have the "Ensure that this file overwrites any installed target file" on by default, is there?
I'm afraid that Advanced Installer doesn't have this type of options. However, we have on our TODO list a feature which will allow you to set this attribute for a folder.[/quote]

OK.

(I am in the process of describing our requirements of the installer based on these experiences. I'll post that in the forum soon, hopefully a solution can be found for all issues.)



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Missing files/folders after successful update?

Hi Clemens,

Please note that most developers use a linear versioning system. Therefore, even if you use external files, their versions shouldn't be a problem (you are the first person to ask us about using different versions randomly). Also, since this is a Windows Installer bug, I'm not sure if there are other solutions other than the ones I mentioned.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

cosmin wrote:Please note that most developers use a linear versioning system. Therefore, even if you use external files, their versions shouldn't be a problem (you are the first person to ask us about using different versions randomly). Also, since this is a Windows Installer bug, I'm not sure if there are other solutions other than the ones I mentioned.
Cosmin,

the file versioning approach (be it via file version number or modification date) used by Windows Installer assumes a perfect world with perfect developers.

But developers are human - when put under pressure (if not before already) they make mistakes. Horrible, glaring mistakes. And the processes around them need to make up for their mistakes and keep their mistakes into account. Missing to increment a version number, removing a version number, or rewriting a tool and forgetting to include a version number in the new binary are very realistic possibilities.

Including external files such as the Sun JRE/JDK into my own product is another wide field for errors in this regard. When the next release of the JRE/JDK comes around, can anyone guarantee that the Sun developers gave consideration to the file version numbers of all individual files? (Pick Python or anything else as a runtime included in my product, if you like - the validity of the case remains.)

And what about my case of including an external program from source1, then from source2? Both programs perform the same task but are form completely different authors, and their version numbers (if existing at all) are completely unrelated. It's enough to pick another pre-compiled binary of some open source software from another developer already to have relevant version number differences.

Also, if I include a file in my installer, I have tested it in conjunction with all the other files in that very installer. Windows Installer assuming that the file already existing in the installation directory should be kept is really asking for hard to find trouble, because it can lead to combinations of files that have not been tested.



Anyway, thank you for your reply.



With best regards

Clemens Anhuth
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Missing files/folders after successful update?

Hi Clemens,

I'm afraid that your explanation seems a bit unrealistic. You are basically suggesting to modify the applications (by application I mean Windows Installer) so it can handle developer mistakes. From my knowledge, this works the other way around:
- each application has some rules which need to be respected
- if the developer makes a mistake, he fixes it, he doesn't modify the application so it can handle the mistake
Including external files such as the Sun JRE/JDK into my own product is another wide field for errors in this regard.
I think its safe to say that the developers at Sun are not using random versions for the files of their products. Therefore, I'm not sure it there is something to worry about when using external products (like the JRE or JDK).
And what about my case of including an external program from source1, then from source2? Both programs perform the same task but are form completely different authors, and their version numbers (if existing at all) are completely unrelated.
I'm afraid that this a developer problem, not one caused by Windows Installer. Windows Installer uses a predefined set of rules and best practices. If using different sources for each version of the package breaks these rules and best practices, then the package shouldn't use different sources for each package. The developers which manage the installations should choose one source and go with it.

However, if the need to change the source arises, you can use a launch condition which doesn't allow the install to start until the old version is removed manually by the user. This way you can make sure that the new version which uses a different source can be installed correctly.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
canhuth
Posts: 241
Joined: Thu Jun 19, 2008 9:03 am

Re: Missing files/folders after successful update?

Hello Cosmin,

thank you for sharing your point of view.

I guess we have to agree to disagree on the philosophy behind some of the decisions in Windows Installer. (It may be noteworthy that NSIS for example doesn't make the assumptions or have the rules about file versions as Windows Installer.)

However, it seems MS allows to alter the behavior via the REINSTALLMODE property.

A quick check with the TEST_Missing_Exe_File project showed that it works (it "overwrote" the existing and "higher version" exe file, and best of all - the file isn't missing).

(A discussion of that property can be found here: http://community.acresso.com/archive/in ... 58788.html Note that they mention possible, undesirable sideeffects!)



With best regards

Clemens Anhuth

Return to “Common Problems”