Wednesday, May 9, 2012

MSI Validation using Custom ICE checks using C# ( in progress.. formatting issues)

  1. The below post explains how you can perform MSI Validation using Custom ICE checks using C# code
             Ref: http://blog.deploymentengineering.com/2009/02/msi-tip-authoring-ice-using-c-dtf.html

    2. Prerequisites to use the above code are :-

           a)You would need Microsoft visual studio to open the project.

           b)Download the 'WiX Toolset v3.5 ' and install it for Visual studio from location  to open all the projects
                  given  http://wix.codeplex.com/releases/view/60102

   3.Now below are the steps to add your own ICE rules to the Cub file (using downloaded code from step 1)
      
     Step 1 : Goto Tests project .Copy paste the ICE_DE_20_Properties folder in the and rename folder and
                   files  to suite your test name accordingly Eg:ICE_CUS01.

     Step 2: Write code for own functionality properties to validate the msi. Create an appropriate filename based
                on the same.

     Step 3: Goto "CustomActions.cs" add call to your custom method eg shown below
 
[CustomAction]public static ActionResult ICE_CUS_01(Session session)new ICE_CUS_01(session).RunTests(); //Assuming you name the class same same as test namereturn ActionResult.Success;
     Step 4: Goto Cub project and add your test to the file "Cub.wxs"  under the existing custom actions           
<CustomAction Id="ICE_CUS_01" BinaryKey="ICE" DllEntry="ICE_CUS_01"/>

  Step 5: In "Cub.wxs"  under the CustomTable  tag  add your test to the list by using a code shown below
</Row>Data Column="Action">ICE_CUS_01</Data>Data Column="Condition"></Data>Data Column="Sequence">31</Data>Row>

    Step 6: Right click on Cub project and select its Project properties -> Tool Settings tab
        Add your test to the existing ICE tests in the textbox separted by semi colin
        Supress specific ICE validation : ICE_DE_10;ICE_DE_20;ICE_CUS_01


   Step 7 : Now Build the solution

   Step 8 : you are ready to use the cub file from the debug output location of the Cub project
                 "......\DTF_ICE\Cub\bin\Debug" with the file name Cub.Cub

   Step 9: now you are ready with your cub file.

....Comming soon another post on how to add your new rules to existing cub files.


References :
A good reference for people working on packages
1) http://www.installsite.org/pages/en/msi/tips.htm

2)May help : Using WIX 3.5 with Visual Studio 2010
http://blogs.planetsoftware.com.au/paul/archive/2011/02/05/using-wix-3.5-with-visual-studio-2010.aspx

Devops links

  Build Versioning in Azure DevOps Pipelines