c# - Manage prerequisites version in bootstrapper -


i want create bootstrapper application c# visualstrudio 2015. want set prerequisite sharedmanagementobject (from microsoft, downloaded that direct link). followed instructions on the microsoft website.

there product.xml:

<?xml version="1.0" encoding="utf-8" ?> <product   xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"   productcode="custom.bootstrapper.sharedmanagementobjects2014x86">    <relatedproducts>     <dependsonproduct code="custom.bootstrapper.sqlsysclrtypes2014x86" />   </relatedproducts>    <packagefiles>     <packagefile name="sharedmanagementobjects2014x86.msi"/>   </packagefiles>    <installchecks>     <msiproductcheck product="ismsiinstalled"        property="{4e6202de-b996-4736-a64b-09ee2a8469e6}"/>   </installchecks>    <commands>     <command packagefile="sharedmanagementobjects2014x86.msi" arguments="">        <installconditions>         <bypassif property="ismsiinstalled"           compare="valuegreaterthan" value="0"/>         <failif property="adminuser"            compare="valuenotequalto" value="true"          string="notanadmin"/>       </installconditions>        <exitcodes>         <exitcode value="0" result="success"/>         <exitcode value="1641" result="successreboot"/>         <exitcode value="3010" result="successreboot"/>         <defaultexitcode result="fail" string="generalfailure"/>       </exitcodes>     </command>   </commands> </product> 

on setup, dialog box correctly ask install sharedmanagementobjects2014x86.msi have 2 problems :

  • on cpu not compatible x86, installation runs fail. there instruction check cpu , install on x86 ?
  • on x86 cpu, installation ok. if re-run setup.exe, sharedmanagementobjects2014x86.msi again installed. why <bypassif property="ismsiinstalled" compare="valuegreaterthan" value="0"/> doesn't work ?

tank you

i found answer

  • to not reinstall : check registry

  • to install depending on cpu : check processorarchitecture

my code :

<?xml version="1.0" encoding="utf-8" ?> <product     xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"     productcode="custom.bootstrapper.sharedmanagementobjects2014">      <relatedproducts>         <dependsonproduct code="custom.bootstrapper.sqlsysclrtypes2014" />     </relatedproducts>      <packagefiles>         <packagefile name="sharedmanagementobjects2014x64.msi"/>         <packagefile name="sharedmanagementobjects2014x86.msi"/>     </packagefiles>      <installchecks>         <!-- check registry -->         <registrycheck property="ismsiinstalled"          key="hkey_local_machine\software\microsoft\microsoft sql server\sharedmanagementobjects\currentversion"          value="version" />     </installchecks>      <commands>         <!-- install x86 : processorarchitecture = intel -->         <command packagefile="sharedmanagementobjects2014x86.msi" arguments="">                 <installconditions>                 <bypassif property="ismsiinstalled"                  compare="valuegreaterthan" value="0"/>                 <bypassif property="processorarchitecture"                  compare="valuenotequalto" value="intel"/>                 <failif property="adminuser"                   compare="valuenotequalto" value="true"                  string="notanadmin"/>             </installconditions>              <exitcodes>                 <exitcode value="0" result="success"/>                 <exitcode value="1641" result="successreboot"/>                 <exitcode value="3010" result="successreboot"/>                 <defaultexitcode result="fail" string="generalfailure"/>             </exitcodes>         </command>          <!-- install x64 : processorarchitecture = amd64 -->         <command packagefile="sharedmanagementobjects2014x64.msi" arguments="">                 <installconditions>                 <bypassif property="ismsiinstalled"                  compare="valuegreaterthan" value="0"/>                 <bypassif property="processorarchitecture"                  compare="valuenotequalto" value="amd64"/>                 <failif property="adminuser"                   compare="valuenotequalto" value="true"                  string="notanadmin"/>             </installconditions>              <exitcodes>                 <exitcode value="0" result="success"/>                 <exitcode value="1641" result="successreboot"/>                 <exitcode value="3010" result="successreboot"/>                 <defaultexitcode result="fail" string="generalfailure"/>             </exitcodes>         </command>     </commands> </product> 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

c# - Json.Net Serialize String from URI -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -