Paraffin 3.5 – Now with Better Minor Upgrade Support

Slowly but surely I’m getting through the list of feature requests everyone’s been asking for. This release of Paraffin brings support for the trick outline by Vagmi Mudumbai (http://geekswithblogs.net/Vagmi.Mudumbai/archive/2006/06/11/81426.aspx) of allowing minor upgrades (AKA patches) to remove files by setting the transitive bit on the component and adding a conditional element that evaluates to false.

<Component Id="comp_F5B392C05B5249C2AB34810BE4A6163F"
           Guid="FD9D7BF4-550A-47E2-85A3-634D77F609FB"
           Transitive="yes">
  <File Id="file_81DD236ED61B4BBEB445FAB9E9C2DAB2"
        Checksum="yes"
        KeyPath="yes"
        Source=".Tempa.exe" />
  <Condition>1 = 0</Condition>
</Component>

So if you need to delete A.EXE on a minor upgrade, delete A.EXE from disk and run Paraffin with the new –PatchUpdate switch. The output .PARAFFIN file will have the following in it for A.EXE

Those of you who’ve looked at Vagmi’s trick are wondering about the other piece that needs to be there; the file. But you deleted the file. If you build with WiX, you’ll get an error because the File element must point to a file to put in the output .MSP. To keep the patch file small, you should have a zero byte file called A.EXE to make everything work.

Fortunately, Paraffin has you covered there as well. When you specify the –PatchUpdate switch, you can add the new –PatchCreateFiles switch and Paraffin will create the zero byte files for you. Don’t worry, when you rerun Paraffin again with –PatchUpdate, if the zero byte file is there, Paraffin checks if the Transitive attribute is set and makes sure to keep everything straight.

While you could keep those zero byte files in your version control system, which seems a little odd to me since they are, well, no longer needed. Because Paraffin knows which files have been deleted with the Transitive attribute on the Component element you can recreate the zero byte files at any time by using –PatchUpdate file.wxs as the command line. The idea is that you’ll run this as part of your build so you never have to worry about those zero byte files.

While I believe major upgrades are really the way to go since they are much easier to manage, I know a lot of you using Paraffin are doing minor upgrades. Hopefully this will make your WiX life a little easier.

A second new feature I added is the –ReportIfDifferent switch. Several people told me they wanted a way they could tell if when updating, through –Update (for major upgrades) and the new –PatchUpdate switch, if the output .PARAFFIN file was different than the input file. As one person told me they wanted to run the update during a build and if the files were different, to fail the build in case someone forgot to update the .WXS file to reflect changes. With –ReportIfDifferent, the exit code for Paraffin will be four if the input .WXS and output .PARAFFIN files are different. If they are the same, the exit code is zero.

I did remove a feature from Paraffin, support for multiple files per component. All the people I talked to using Paraffin were using one file per component because it offers better resiliency with Windows Installer. By removing this support, it made my development life easier as well. If you need multiple files per component support, keep using Paraffin 3.13 (https://training.atmosera.com/CS/files/folders/8198/download.aspx).

Another change for upgraders is I changed to adding the KeyPath on the File element instead of the Component element. If you use Paraffin 3.5 to update a .WXS file created with a previous version of Paraffin, I swap the attributes around.

While I never cared what you did with Paraffin or its source code, not having a license in the download was freaking out many of your lawyers. Without legal language somewhere lawyers head’s explode. I threw in the CPL license file to make your life easier. However, I still don’t care what you do with the code. All I ask is that you let me know about any bugs you find or features you want in Paraffin.

Here’s the list of minor changes I made in Paraffin 3.5.

  • Added a Zen of Paraffin document to help explain how to best use Paraffin.
  • Added the -verbose command line option for verbose output.
  • Now the DiskId attribute is only added if the value is not the default of 1.
  • Refactored the code into three different files for ease of development.
  • Removed deprecated command line switches and the code reporting their usage.
  • Warnings are written in yellow text and errors are now written in red.

Here’s the program and the source: https://training.atmosera.com/CS/files/folders/18310/download.aspx.

We deliver solutions that accelerate the value of Azure.

Ready to experience the full power of Microsoft Azure?

Start Today

Blog Home

Stay Connected

Upcoming Events

All Events