1

I have a patch (MyPatch.msp) which updates a .NET application from version 6.13.7604 to 6.14.7605

If I run the following command

msiexec /update MyPatch.msp

it shows the installation dialog boxes, progress indicators, including "Copying new files", "Patching files" etc. for the patch, everything runs fine and it updates the application.

However I want to run the patch in quiet mode.

msiexec /update MyPatch.msp /qn

It runs in quiet mode alright, but it doesn't update the application files. However, if I check the application the Control Panel, it has updated the version number to 6.14.7605. But the Product Version in the application's .exe file is still at 6.13.7604 (and it doesn't have the new functionality)

The same happens if I try any of the levels of UI other than /qf (the default) or use /passive.

If I have it create a log, I don't see any error messages and at the bottom it appears to have been successful:

MSI (s) (D0:94) [12:17:57:277]: Product: MyProduct -- Configuration completed successfully.

MSI (s) (D0:94) [12:17:57:277]: Windows Installer reconfigured the product. Product Name: MyProduct. Product Version: 6.14.7605. Product Language: 1033. Manufacturer: MyCompany. Reconfiguration success or error status: 0.

Likewise, the Event Log has an entry indicating success...

Windows Installer reconfigured the product. Product Name: MyProduct. Product Version: 6.14.7605. Product Language: 1033. Manufacturer: MyCompany. Reconfiguration success or error status: 0.

Why is it not updating the files in quiet / passive mode?

Edit

(adding info in response to comment)

It's a massive application and the actual code change is immaterial (just a resx string change for the purpose of testing patching).

Also, this line was modified in AssemblyInfo.cs:

 [assembly: AssemblyInformationalVersion("6.14.7605")] 

However, the PCP file and line used to generate the patch may be useful:

ImageFamilies table: enter image description here

Properties Table: enter image description here

TargetImages table: enter image description here

UpgradedImages table: enter image description here

Command used to create the msp file:

C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x86\msimsp.exe" -s "setup\MyApplication\Patch\MyPatch.pcp" -p "C:\agent\_work\38\a\Archive\LauncherPatch.msp" -l MyPatch.log

Further update

Here are the log entries relating to the component failing to update both with and without quiet mode (the latter of which works fine) As you can see there is one extra line relating to this component's guid but I don't understand what the difference means.

Quiet Mode:

ComponentRegister(ComponentId={B02BFA02-FEBE-4965-A07A-0150C44CDA7C},KeyPath=C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0)

MSI (s) (34:F4) [08:34:45:166]: WIN64DUALFOLDERS: Substitution in 'C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe' folder had been blocked by the 1 mask argument (the folder pair's iSwapAttrib member = 0).

Without quiet mode (files update correctly):

ComponentRegister(ComponentId={B02BFA02-FEBE-4965-A07A-0150C44CDA7C},KeyPath=C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe,State=3,,Disk=1,SharedDllRefCount=0,BinaryType=0)

1: {33250B4C-B2D2-4F36-AB12-D5FF0757C973} 2: {B02BFA02-FEBE-4965-A07A-0150C44CDA7C} 3: C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe

MSI (s) (34:50) [08:37:23:282]: WIN64DUALFOLDERS: Substitution in 'C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe' folder had been blocked by the 1 mask argument (the folder pair's iSwapAttrib member = 0).

The component guid is mentioned once more later in the log but the entries are almost identical for both attempts:

MSI (s) (34:F4) [08:34:45:812]: Executing op: RegisterSharedComponentProvider(PatchGUID={66911576-86A6-4A9C-AF86-9370E40E09EA},MediaCabinet=#PCW_CAB_LnchApps,File=MyApp.exe,Component={B02BFA02-FEBE-4965-A07A-0150C44CDA7C},ComponentVersion=1.0.0.0,ProductCode={33250B4C-B2D2-4F36-AB12-D5FF0757C973},ProductVersion=6.13.7604,PatchSize=554,PatchAttributes=0,PatchSequence=10006,SharedComponent=0,IsFullFile=0

MSI (s) (34:50) [08:37:24:238]: Executing op: FileCopy(SourceName=MyApp.exe,SourceCabKey=MyApp.exe,DestName=MyApp.exe,Attributes=0,FileSize=422400,PerTick=65536,,VerifyMedia=1,,TotalPatches=1,,,CheckCRC=0,Version=1.0.0.0,Language=0,InstallMode=327680000,,,,,,,)

MSI (s) (34:50) [08:37:24:242]: File: C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe; Patch targets existing file.; Smart patch; Existing file is of an equal version

... the only difference being "InstallMode" - it's 327417856 in the quiet attempt and 327680000 in the successful attempt.

I did just notice "Existing file is of an equal version" ... but it isn't! Besides this also appears when not running in quiet mode and then the file is replaced...

But wait!

In the quiet mode log, I found this (emphasis mine):

MSI (s) (64:0C) [09:05:12:910]: Executing op: CacheBaselineFile(Baseline=0,FileKey=MyApp.exe,FilePath=C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe,,Existing=0)

MSI (s) (64:0C) [09:05:12:911]: Executing op: PatchApply(PatchName=MyApp.exe,TargetName=C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe,PatchSize=554,TargetSize=422400,PerTick=0,,FileAttributes=0,PatchAttributes=0,CheckCRC=0)

MSI (s) (64:0C) [09:05:12:912]: Skipping all patches for file 'C:\Program Files (x86)\MyCompany\MyApplication\MyApp.exe'. File does not need to be patched.

0

2 Answers 2

1

Upgrades happen at the component based level. You can run this quietly but add onto the end of the command line /l*v <pathToLog> Once the upgrade is complete, search the log file for the component GUID that is not upgrading.

Usually it will show some reason why it's not upgrading the file attached to that component.

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks - I've tried that both with and without quiet mode (where the update works fine). No sign of an error message relating to that component guid, there is a slight difference in the logs which I don't really understand - I've pasted the log difference into my question.
I'm assuming that you've confirmed the version of both exe files through File Explorer. If so, then someone smarter than me will have to chime in. It's not showing why the new file isn't being installed and the version change is within 3 octets. Those are the areas where I've seen issues.
I have verified the exe file in file explorer. The file is still at the older version number, and its modified time reflects the older file version. However if I run the very same .msp file in interactive mode, afterwards the file is correctly at the new version number and the modified time is updated accordingly.
0

This seems to do the trick...

msiexec /update MyPatch.msp /q REINSTALLMODE=AMUS    

However, it does take a lot longer to run, and if I create a log it shows to attempting to update every single file in the project...

This would seem to be the brute-force approach, but doesn't answer my original question about why it doesn't just work normally. If I use OMUS (the default) I get the behaviour in the question... But my new version and date of the file is definitely later than the already installed one.

(according to the docs... https://learn.microsoft.com/en-us/windows/win32/msi/reinstallmode the A forces all files to be installed, whereas O is to install only if the existing file is older)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.