ZakiTNT
Posts: 7
Joined: Wed Nov 16, 2022 3:10 am

Custom patch

Wed Nov 16, 2022 7:10 am

Hi all,
I've an EXE app (contains few thousand files) packaged with AI v15.3. Already released multiple versions of this app. So far everything is working fine. Each version have different Product Code and using the same Upgrade Code. The packaging was set to uninstall the old version first before installing the new version.

Some users complain that they have to download the full version in order to update to the latest version of my app. FYI, until now, the different between each app version is minor: different version of dll, exe etc... I tried to create a patch between those app versions but so far none worked.
Scenario 1:
MyApp v1.1.0 -> Original version
MyApp v1.2.0 -> update some dll files, different Product Code
During patch building, it will show major patch detected but still managed to create the patch file. Running the patch file with the v1.1.0 installed will prompt the message of missing the program to be upgraded (although v1.1.0 did exist).
Scenario 2:
MyApp v1.1.0 -> Original version
MyApp v1.2.0 -> update some dll files, same Product Code as v1.1.0

What I did is just duplicate the original project file and rename it to MyApp_v120 and then update it to version 1.2.0. When I create a patch from both msi (extracted from the EXE), during building it will produce warning of component ID changed and sequence changed. I open the msp file with Orca but it doesn't contain the updated files.
Since my app are currently based on Scenario 1, I was wondering whether it is possible to create a small installer (maybe an EXE) that contains whatever updated files. What I'm trying to archive is:
Preferred Scenario:
MyApp v1.1.0 -> example Product Code: 10001, Upgrade Code: 70001
MyApp v1.2.0 -> example Product Code: 10432, Upgrade Code: 70001
MyApp v1.3.0 -> example Product Code: 12982, Upgrade Code: 70001

This custom EXE, should be able to update the previous version installation with new updated files AND also update the Product Code with the one used by the full installer. For example: v1.1.0 updated to v1.2.0 and change the Product Code to 10432.

I'm hoping the above scenario doesn't affect the standard Updater function (using the Advanced Updater) where the user should still be able to get an update reminder when it's available.
Is it possible to do this Preferred Scenario?

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Custom patch

Fri Nov 18, 2022 11:18 am

Hello and welcome to our forums,

Please allow me to address your points below:
Scenario 1:
MyApp v1.1.0 -> Original version
MyApp v1.2.0 -> update some dll files, different Product Code
During patch building, it will show major patch detected but still managed to create the patch file. Running the patch file with the v1.1.0 installed will prompt the message of missing the program to be upgraded (although v1.1.0 did exist).
Please note that in order to create a patch, the same ProductCode must be kept between the two versions of your product.

Basically, a patch is a diff between two packages. At install time, by the ProductCode and UpgradeCode, the patch will detect the previous version and the two databases (the one from the patch and the one from the main installation package) will be merged, resulting in the v2 of your setup.
Scenario 2:
MyApp v1.1.0 -> Original version
MyApp v1.2.0 -> update some dll files, same Product Code as v1.1.0

What I did is just duplicate the original project file and rename it to MyApp_v120 and then update it to version 1.2.0. When I create a patch from both msi (extracted from the EXE), during building it will produce warning of component ID changed and sequence changed. I open the msp file with Orca but it doesn't contain the updated files.
Here, please note that copying the project is not recommended. In fact, I would highly advise against that as it can lead to some issues.

You can read more about it here:

Save as Template option

You are indeed right that what you'd need here is a patch.

You can read more about patches here:

Updates Deployment: Major Upgrade vs Patch

Now, in order to create a patch, here is how you can proceed:

- let's say you already have the V1.0 of your product

- usually, Advanced Installer has a build folder where it builds your project into an MSI/EXE. Take the v1.0 out of that folder and put it in a different folder

- now open your Advanced Installer project and do the required changes. Upon changing the ProductVersion (e.g. from 1.0 to 1.1), select the option to keep the same ProductCode

- now, after the build, in the build folder we'll have v2.0

Open Advanced Installer --> "Updates" --> "Patch".

Using v1.0 and v2.0, generate the patch file which will consist only of the diff between the two (e.g. if you added in v2.0 another executable, compared to v1.0, the patch will only contain that executable).

Creating Patches

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”