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!

dexter_v
Posts: 23
Joined: Sat Nov 22, 2014 5:25 pm

Always overwrite existing file

Hello,

I'm trying out the latest version of Advanced Installer. I would like to set the overwrite behaviour properties of my dlls and files to "Always overwrite existing file" as the version number of some of my dlls may be newer and sometimes older. If I select this option the version number of that dll changes to 65535.65535.65535.65535, all the other option are greyed out Can you please suggest how do I set the file version to "Get from files".
Untitled1.png
Untitled1.png (7.02 KiB) Viewed 10326 times
Untitled2.png
Untitled2.png (13.96 KiB) Viewed 10326 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Always overwrite existing file

Hello,

It is mandatory to define the highest possible file version for your file in the setup package when you want it to always overwrite at install time an existing file on disk. However, the file version specified in the setup package won't be effectively set on your file at install time. It will be only used when Windows Installer decides to overwrite an existing file on disk at install time.

Windows Installer decides if a file needs to be overwrite based on the following method: It first compares the file version from the disk with the file version defined in the setup. If the file version is the same it compares the date of the files. If the date is also the same it compares the language. You can find more information regarding this subject in the "File versioning rules" article.

For example if you have a file with version 1.0.0 on your disk and include in the setup the 2.0 version, the file will be overwritten if "Overwrite only if the existing file is older" is selected. Advanced installer gives you the opportunity to always overwrite a file by creating a "virtual" file version for the file in the setup, which is the maximum file version possible:

Code: Select all

65535.65535.65535.65535
When you select "Always overwrite existing file" option, the version of the file from disk will be compared with 65535.65535.65535.65535, thus the version of the file from the disk will be always smaller or equal. Please keep in mind that the real file version will not be 65535.65535.65535.65535. This value is only used by Windows Installer in the former algorithm.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dexter_v
Posts: 23
Joined: Sat Nov 22, 2014 5:25 pm

Re: Always overwrite existing file

Hi Daniel,

Thanks for the reply.

1) I've attached 2 installers files

The 1st installer has a file with version number 14.1400.0.46
The 2nd installer has a file with version number 14.1400.0.41

If I install the product using 1st installer (file version 14.1400.0.46) and then update it using the 2nd installer (file version 14.1400.0.41 ).
The installer deletes the file,

2) Report Generation

I'm creating a installer report using the log file created by the installer. This report needs to mention the version number of all dlls.
To overcome the problem mentioned in #1 I tried the "Always overwrite existing file". This makes the dll version number in the log file as  65535.35535.65535.65535
and in the installer report, all the dll version numbers are coming out to be 65535.35535.65535.65535

Please suggest a workaround.
Attachments
2.aip
(18.07 KiB) Downloaded 469 times
1.aip
(18.04 KiB) Downloaded 448 times
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Always overwrite existing file

Hello,

You're always welcome.

1)

Unfortunately, this is a know windows installer bug. The update works in the following way: first the new package runs. An older package is detected. The old package is uninstalled and after that 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 DLL is already installed, the one in the old package is compared to the one in the new package. However, the DLL in the new package has a version number lower then the one in the older package, therefore it will not be installed (according to the file versioning rules). During the update the old file is removed and the new one is not installed.

The only workaround for this issue is to select "Always overwrite existing file" option.

2)
Regarding the version 65535.65535.65535.65535 appearing in the log, this is the "virtual" file version which is stored in the msi table, necessary for the algorithm of always overwriting files. The real file version cannot be written in the log file in this case.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dexter_v
Posts: 23
Joined: Sat Nov 22, 2014 5:25 pm

Re: Always overwrite existing file

Thanks Daniel,

1) I think I will go with "Always overwrite existing file"

2) I was able to get the correct version of the dlls after installation using c# code.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Always overwrite existing file

You're always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”