For now I am going to base this page on the "Patch Creation - Julian Onions" section and the code installed by MAKEMSI. This is a work in progress and may not be the best way of doing things.
This is what I had to do:
;--- Make the full patch file ------------ call Info "Building the patch file from <$MAKEMSI_OUT_MSI_DIR><??@@PatchName>.<$MAKEMSI_PATCHCTLFILE_SUFFIX>..."; call Say ""; @@Cmd = 'Msimsp.exe -s "<$MAKEMSI_OUT_MSI_DIR><??@@PatchName>.<$MAKEMSI_PATCHCTLFILE_SUFFIX>" -p "<$MAKEMSI_OUT_MSI_DIR>\<??@@PatchName>.<$MAKEMSI_PATCHFILE_SUFFIX>" -l "<$MAKEMSI_OUT_LOG_DIR>patch.log"'; @@Rc = AddressCmd(@@Cmd); if @@Rc <> 0 then; error("Failed to build the patch - see <$MAKEMSI_OUT_LOG_DIR>patch.log",,'Failed Executing:',@@Cmd); call Info "Patch file built in <$MAKEMSI_OUT_MSI_DIR><??@@PatchName>.<$MAKEMSI_PATCHFILE_SUFFIX>";
#define? PATCH_URL http://cantBeBlankBug.htm #include "patch.mmh" <$Patch "MyPatch"> #define Family MyFamily <$PatchFamily Family="<$Family>"> <$PatchImage Key="MyOrig" SrcMsi="out.1\AdminInstall\TryMe.msi" Upgraded="MyPatch"> <$PatchUpgrade Key="MyPatch" NewMsi="out.2\AdminInstall\TryMe.msi" Family="<$Family>"> ; <$PatchSequence Family="<$Family>" Version="1.0.1"> ;Logged MSG: Stop: ERROR: Since MSI 3.0 will block installation of major upgrade patches with sequencing information, creation of such patches is blocked. <$PatchProperty "SEQUENCE_DATA_GENERATION_DISABLED" Value="1"> <$TableDelete "PatchSequence"> <$/Patch>
I had to add the last two statements to remove sequence information otherwise the patch wouldn't build and I'd get an error message "Failed to create patch. Error code: 0xC00E5182".
msiexec.exe /p MyPatch.msp /l*vx ApplyPatch.log
However it only works if the MSI #1 is installed using the adminstrative image used in the patch creation above. If its installed by the original (compressed) MSI then I get a "2356" failure.
|Update from Julian|
Some comments on the patch creation:
I had to make admin installs for it to work at all. It works OK provided you are just adding/deleting files, or modifying text or .EXE files - it seems to deal with those ok. Its not good on binary files though - and it takes a very long time to do differences of anything significant (as in 4-5 hours).
Some comments on the patch application:
Also found patching can be very difficult to apply if any of the files are changed by the user. Its also quite easy to mess up the MSI DB and have the whole thing get corrupt! You then have to use an MS tool to remove the installation and start again. So not as smooth a change as I'd hoped.
Some comments on switching to using PocketSoft's "RTPatch":
We switched to pocketsoft's commercial RtPatch product, which can make MSP compatible patches much faster and smaller. However we found a number of bad interactions with the MSI files when trying to apply patches to patches and stuff like that, so eventually we switched to their native format patching - as it was the only pragmatic way we could solve our problems.
|Other Free Patch Tools|
Some free patch tools include: