FranB
Posts: 9
Joined: Mon Apr 08, 2019 12:41 pm

Newly created Patch (MSP) not patching different files

Hi.
When generating an MSP file by comparing two MSI files (older-newer version) of an application, I found out that only newly added files in the newer MSI are included in the MSP file. Files with the same name but different size are ignored, causing the patch (MSP) to be useless.
What am I doing wrong? Have I select anything special? (I tried to look up for any related option but I can't find anything)

Another question is that I'd like to create MSP files that don't uninstall the older version, but just update files. How can I achieve that?

That happened using the AI 15.8 Trial version (currently the latest one).

Thanks.
FranB
Posts: 9
Joined: Mon Apr 08, 2019 12:41 pm

Re: Newly created Patch (MSP) not patching different files

Well, since I don't think the AI team will release a version solving this issue in a timely fashion, I'm posting here the way to create manually a MSP file using the tools provided in the Microsoft SDK. This way files with differences between versions will be included in the MSP Patch.

Sample instructions for 7-zip 1805 MSI package to 1806 MSI package patch creation:
1. Install Win32Tools from Microsoft SDK (Download SDK ISO from https://www.microsoft.com/en-us/downloa ... px?id=8442, then mount or decompress it and browse "\Setup\WinSDKWin32Tools_amd64" for 64 bit version of the tools, but there's also available the 32-bit version)
2. Create a workspace directory, for example, c:\7zip. Inside this directory create two more directories: "\1805" and "\1806"
3. Make an administrative install of each MSI:
a. Msiexec /a 7z1805-x64.msi TARGETDIR="c:\7zip\1805"
b. Msiexec /a 7z1806-x64.msi TARGETDIR="c:\7zip\1806"
4. Make a copy of the "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\msitools\Schemas\MSI\template.pcp" and place it to the newly created "c:\7zip" directory. Rename it as "7zip1806.pcp"
5. Edit the "template.pcp" file using "ORCA" editor (you can find it inside the SDK ISO). The next steps are based on the info from the document "https://docs.microsoft.com/en-us/window ... rties-file"
6. Edit the table "Properties" and make the following changes:
a. Add a new row. Set "SEQUENCE_DATA_GENERATION_DISABLED" for "Name" and "1" for "Value".
b. Edit "PatchOutputPath" and set the output path for the resultant MSP file, for example C:\7zip1806.msp. Take note of this path as you would referenciate it later when generating the MSP.
c. Generate a new GUID for the property "PatchGUID" by right-clicking on the corresponding cell "Value" and selecting "Paste New GUID".
7. Edit the table "ImageFamilies" and add a new row (maybe in more complex scenarios you may need tho specify different values):
a. Family: MNPapps
b. MediaSrcPropName: MNPSrcPropName
c. MediaDiskId: 2
d. FileSequenceStart: 1000
8. Edit the table "UpgradedImages" and add a new row (maybe in more complex scenarios you may need tho specify different values):
a. Upgraded: MNP_fixed
b. MsiPath: c:\7zip\1806\7z1806-x64.msi
c. Family: MNPapps
9. Edit the table "TargetImages" and add a new row (maybe in more complex scenarios you may need tho specify different values):
a. Target: MNP_error
b. MsiPath: c:\7zip\1805\7z1805-x64.msi
c. Upgraded: MNP_fixed
d. Order: 1
e. ProductValidateFlags: 0x00000922
f. IgnoreMissingSrcFiles: 0
10. Once all the specified tables have been edited properly, run cmd.exe as administrator and execute the following command line (more info on using msimsp.exe at https://docs.microsoft.com/en-us/window ... msimsp-exe):
a. "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\MsiMsp.Exe" -s c:\7zip\7zip1806.pcp -p C:\7zip1806.msp -l C:\7zip\msimsp_1806.log
11. If everything goes OK, you will have the resultant patch at C:\7zip1806.msp. You now can upgrade a computer with 7-zip 1805 to 1806 without running the 1806 MSI. However, I still haven't found how to patch without uninstalling the previous version, in order to avoid per-machine configuration deletion (user configuration seems to remain intact after uninstall for obvious reasons). I think there's a way but I haven't found it yet.

Hope I don't forget anything.

This information is provided "as is". Please always take measures to prevent data loss and system damage. Try everything first in a test enviroment, using virtualization when available. These instructions are only valid for test environments. You and only you are the only accountable when deploying to production computers.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Newly created Patch (MSP) not patching different files

Hello and welcome to our forums,

If you still want to give Advanced Installer a trial in what regards patch creation mechanism, then first of all please make sure that the target and upgraded versions of your MSIs are fully compliant with the patch creation rules.

In what regards the files with different size not being included into your setup package, I cannot say why this happens nor I am aware how you did conclude that they are ignored. However, you could try to check the "Include whole files" only option from "Patch Details" page of your patch project and see if this helped.

In what regards how to create an MSP patch file that do not uninstall the older version, you should be able to achieve this if you follow the patch creation rules (especially using the same ProductCode for both versions of your MSI and a different ProductVersion). You can have a look on our "Authoring a Windows Installer patch" tutorial for an example use case.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
FranB
Posts: 9
Joined: Mon Apr 08, 2019 12:41 pm

Re: Newly created Patch (MSP) not patching different files

Thanks Daniel, I'll check that out.

I concluded that files with different size are ignored by checking files after installation and also looking at the AI log shown after hitting F7 (building).

About the "without uninstalling" question, understood. In fact I read that somewhere else, however it was poorly described or I didn't fully understand the process. Thank you anyway.

And by the way, I'm working for a customer who already bought an AI license. [Edit] However, the license is being used by other workmate but I use the Trial version to test features for documentation purposes.
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Newly created Patch (MSP) not patching different files

Thank you for your follow up on this.

Just let us know when you have further questions or doubts.

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

Return to “Common Problems”