[wpkg-users] Condition logic

Paul McGrath J.P.McGrath at leeds.ac.uk
Mon Mar 23 23:55:53 CET 2015


Hi,
  Just looking for advice on whether I can make this simpler.  The aim is to install the correct bit version of Visio or Project for the corresponding bit version of Office 2013 that is already installed.  If Office 2013 is not installed then install the bit version that matches Windows 7 e.g. W764 = X64 version of Visio/Project.
  I've research the bitness versus product code and after Office is uninstalled the product code values still exist.  Bitness is more reliable but I am sure not 100% fool proof.
This I what I have come up with:

     <package id='visio' revision='1'>
      <!-- CHECK IF W732 & OFFICE2013 32BIT ALREADY INSTALLED -->
      <install architecture='x86' cmd='download.exe visio2013x32bit.zip'>
         <condition>
           <check type='logical' condition='and'>
             <check type='host' condition='architecture' value='x86' />
              <check type='logical' condition='or'>
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Standard 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional 2013" />
             </check>
             <check type='logical' condition='or'>
               <!-- Check wow6432 first -->
               <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Outlook\Bitness' value='x86' />
               <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Outlook\Bitness' value='x86' />
               <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\14.0\Outlook\Bitness' value='x86' />
               <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\15.0\Outlook\Bitness' value='x86' />
             </check>
           </check>
       </condition>
      </install>
      <!-- CHECK IF W764 & OFFICE2013 32BIT ALREADY INSTALLED -->
      <install architecture='x64' cmd='download.exe visio2013x32bit.zip'>
         <condition>
           <check type='logical' condition='and'>
             <check type='host' condition='architecture' value='x64' />
              <check type='logical' condition='or'>
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Standard 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional 2013" />
              </check>
              <check type='logical' condition='or'>
              <!-- Check wow6432 first -->
                 <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Outlook\Bitness' value='x86' />
                 <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Outlook\Bitness' value='x86' />
                 <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\14.0\Outlook\Bitness' value='x86' />
                 <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\15.0\Outlook\Bitness' value='x86' />
              </check>
           </check>
         </condition>
      </install>
      <!-- CHECK IF W764 & OFFICE2013 64BIT ALREADY INSTALLED -->
      <install architecture='x64' cmd='download.exe visio2013x64bit.zip'>
         <condition>
           <check type='logical' condition='and'>
             <check type='host' condition='architecture' value='x64' />
              <check type='logical' condition='or'>
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Standard 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional 2013" />
              </check>
              <check type='logical' condition='or'>
              <!-- Check wow6432 first -->
                 <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\Outlook\Bitness' value='x64' />
                 <check type='registry' condition='equals' path='HKLM\SOFTWARE\Wow6432Node\Microsoft\Office\15.0\Outlook\Bitness' value='x64' />
                 <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\14.0\Outlook\Bitness' value='x64' />
                 <check type='registry' condition='equals' path='HKLM\Software\Microsoft\Office\15.0\Outlook\Bitness' value='x64' />
              </check>
           </check>
         </condition>
      </install>
      <!-- CHECK IF W732 & OFFICE2013 NOT INSTALLED -->
      <install architecture='x86' cmd='download.exe visio2013x32bit.zip'>
         <condition>
           <check type='logical' condition='not'>
              <check type='logical' condition='or'>
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Standard 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Student 2013" />
              </check>
           </check>
       </condition>
      </install>
      <!-- CHECK IF W764 & OFFICE2013 NOT INSTALLED -->
      <install architecture='x64' cmd='download.exe visio2013x64bit.zip'>
         <condition>
           <check type='logical' condition='not'>
              <check type='logical' condition='or'>
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional Plus 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Standard 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Business 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Professional 2013" />
                 <check type="uninstall" condition="exists" path="Microsoft Office Home and Student 2013" />
              </check>
           </check>
       </condition>
      </install>
  <!-- LINES TO FOLLOW, EXTRACT ZIP, MSIEXEC STUFF ETC ETC ETC -->
  </package>

Thanks
Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20150323/d3020d02/attachment-0002.html>


More information about the wpkg-users mailing list