Alex99
Posts: 42
Joined: Thu Feb 14, 2013 9:28 am

Upgrading some features only problem

Hello guys,
Can you help me with my problem?
For my installer I need to implement upgrading functionallity.
And this is what I want -
I have files splited in different features. While upgrading I want to upgrade some features and in other side left some features from old version.
As far as I understand I need to do the following -
- Open Upgrade Page
- Set automatically upgrade option
- Set "uninstall first" option
- Check "Customize Advanced Installer upgrade rules "
- Open row with "OLDPRODUCT" property.
- Go to Upgrade Action tab
- List features for upgrading into "updgade feature" field.
I did this - but I didnt get expected behaviour of updating.
For better understanding I've prepared sample project for you.(see attach)
So in this project we have 2 files that placed in 2 features.
All options listed above was set.
So what I'm doing - building this project first time - got version 1.0.0.
Change data in the files. Change version to 1.0.1. Click "Major update".Build installer again.
Install version 1.0.0 after that install version 1.0.1.
What I expect to see -
I have only 1.0.1 version installed. File "file_without_changes.txt" is not changed because this file is placed in feature "Fixed" that is not included in "updgade feature" field of Upgrade Action tab in Upgrade page.
What I have -
I have 2!!! versions installed - 1.0.0 and 1.0.1. All files is changed.
See project in attach.
What I'm doing wrong? If you will not see the same behaiour - please write step by step what I need to do and please send to me updated sample project.

Thanks in advance,
Alex
Attachments
Update_Test.7z
(2.58 KiB) Downloaded 492 times
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Upgrading some features only problem

Hello Alex,

Please keep in mind this is the normal behavior when using the above scenario. Only the "Changed" feature will be removed during upgrade, but in this case the two package versions will be installed side by side and (because they will use same installation path) the resource files of your "Fixed" feature will be overwritten.
However in order to achieve what you want you can proceed like this:
- Go to "Upgrades" page and disable the "Customize Advanced Installer upgrade rules" option.
- Build your project.
- Save your project (using "Save as" option) to a different location (e.g. UpdateTest2)
- Increase the product version field and choose "Major upgrade".
- Go to "Files and Folders" page, select your "file_without_changes.txt" file and from its context menu choose "Properties..." option.
- In the "Edit File" dialog -> "Operations" tab enable the "Do not overwrite existing file" option using the OLDPRODUCTS as condition.
- Build and run your project.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Alex99
Posts: 42
Joined: Thu Feb 14, 2013 9:28 am

Re: Upgrading some features only problem

Hello,
ok, thx. Looks like this solution is suitable for me.
But I have another question -
In my product we have 4th-way naming of versions. And I want automatically upgrate on changing on 4th number.
For example from version 1.0.0.0 to 1.0.0.1. As far as I understand windows installer detects only 3 numbers of version.
Do I have any ability to do the automatically upgrade when only last version number(4th number) was changed?

Thanks in advance,
Alex
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Upgrading some features only problem

Hello Alex,

Unfortunately, Windows Installer ignores the fourth field of the product version. So, if your first three product version fields are identical, then the new version of your application will not upgrade the previous one. So, please take a look on "ProductVersion property" article and set your product version accordingly in order to achieve what you want.

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

Return to “Building Installers”