Page 1 of 1

Patch projects.

Posted: Mon Feb 23, 2009 5:37 am
by bokkie
I used the patch white paper as the template for creating my patch sample and I created four text files on my desktop called A.txt through D.txt. In my project I first added files A and B. I built the project using Web Deploy and selected the output folder and copied the two files TextFiles.exe and text files.7zip into a new folder on my desktop called Version 1. I then added file C.txt to my project. Again, I built the project using Web Deploy and copied the new TextFiles.exe and text files.7zip to a new folder on my desktop called Version 2. I then did the same for D.txt and copied the files to Version 3.

I ran each of the TextFiles.exe in turn and the usual uninstall occurred first and then the normal installation followed. I verified that my Program Files folder contained (Version 1) A and B, (Version 2) A, B, and C, and (Version 3) A, B, C, and D. So each setup program installed the right files. I then uninstalled everything and reinstalled only Version 1 to install the original files A and B only. I then turned my attention to doing the patches and it is here that I’m doing something wrong or missing something.

On the Patches node I added the .exe files for Version 1 and Version 2. This should collectively only install A, B, and C (?). I built the patch and selected the Browse button and ran the executable. What it did was create all files A through D even though the executables I added to the patch only contained A and B, and A through C respectively. In other words it also picked up file D which by now is in the project files but not in the patch executables. Clearly I’m doing something wrong but I’d like some help. I have a suspicion I should be doing things in a different sequence to what I’m doing.

One thing I suspect I might need to do is first build version 1 using files A and B. Then install version 1 as normal. I then introduce file C and build Version 2. I then add version 2 as the first patch to the list. I then build the patch and save the files it produces. Finally I add file D and build Version 3. I then add version 3 to the patch list and build it again. I then save the output files it produces. Does that sound plausible?

What I’m hoping to achieve is that when I run Version 1 it installs A and B. When I run the first patch (Version 2) that should install only file C as nothing has changed in files A and B. Finally, when I run the patch for Version 3 that would create file D only as neither A through C have changed. Then, if I edit A, C, and D as Version 4 and add that to the patch list, build and save the files then installing it will install the changed files for A, C and D but nothing will change for file B.

My apologies for such a long post and I hope it sort of makes sense as to what I think patching should achieve. I’d appreciate any help or clarity if I’ve misunderstood what I think it should all be doing.

Posted: Mon Feb 23, 2009 8:53 pm
by MichaelNesmith
Hi Peter,

You basically need to understand what a patch build does.

First, it builds the latest version of your setup, as defined in your MSIcode with the BUILDMODE compiler variable set to PATCH, with the files and logic spelled out as exactly in your MSIcode.

And then, it takes your patch reference setups, and converts the latest built setup into a patch that will upgrade all installations performed with the reference setups into the latest version.

While I'm not clear on parts of your post, I think this should help clear your conceptual confusion.

Posted: Tue Feb 24, 2009 6:57 am
by bokkie
Michael,

I think I understand what you are getting at. I think I will debug the MSI code and follow it through. A few more cups of coffee will also help. :)