Hi Ben,
The method you are currently using relies on using the File Versioning Rules to replace the existing files and thus it will not work consistently.
http://msdn2.microsoft.com/en-US/library/aa368599.aspx
You should use a different method which conforms to the Windows Installer rules and best practices: each MSI package will remove an older version (upgrade) and also a newer version (downgrade).
Since AI does not fully support editing the Upgrades you will need to modify the AIP file manually and also edit the generated MSI file in Orca, as described below.
I would suggest that you follow the steps below starting with a new project and then implement the described method in your own project.
1. In the Upgrades page, make sure that the versioning method is set to "Automatically upgrade older product versions". Save the AIP file.
2. Open the AIP file in a text editor and locate the "MsiUpgradeComponent":
Code: Select all
<COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">
<ROW UpgradeCode="[|UpgradeCode]" VersionMax="[|ProductVersion]" Attributes="1025" ActionProperty="OLDPRODUCTS"/>
<ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="2" ActionProperty="AI_NEWERPRODUCTFOUND"/>
</COMPONENT>
3. In the second row (that sets the AI_NEWERPRODUCTFOUND Property), change the value for the "Attributes" attribute to "1025", such that when a newer product is found it will be removed - this will allow the downgrade. Hence, the "MsiUpgradeComponent" will become:
Code: Select all
<COMPONENT cid="caphyon.advinst.msicomp.MsiUpgradeComponent">
<ROW UpgradeCode="[|UpgradeCode]" VersionMax="[|ProductVersion]" Attributes="1025" ActionProperty="OLDPRODUCTS"/>
<ROW UpgradeCode="[|UpgradeCode]" VersionMin="[|ProductVersion]" Attributes="1025" ActionProperty="AI_NEWERPRODUCTFOUND"/>
</COMPONENT>
4. Save the AIP file as UTF-8.
5. Suppose that this is the project file for version 1.0.0 of your application. In order to create the project for the next version (for instance, 2.0.0) you will increase the Product Version in the Product Details page and answer "Yes" when asked to generate a new ProductCode.
6. In order to allow downgrading, the "AI_DOWNGRADE" Error Message Custom Action must be removed from MSI packages and you will need to use Orca in order to achieve this. Do the following:
a) Open one of the MSI packages in Orca and select the "InstallUISequence" table in the left list.
b) In the right list locate the row that contains "AI_DOWNGRADE" in the "Action" column and delete this row.
c) Do the same for the "AI_DOWNGRADE" row from the "InstallExecuteSequence" table.
d) Save the MSI database after you have performed the modifications.
e) Repeat steps a-d for the other MSI packages.
In a future version of Advanced Installer there will be more control over the Upgrades.
Hope this helps.
Regards,
Ionut