Why doesn't the FileSearch element's MinVersion attribute work in my WiX installer? -


i writing windows installer package using wix toolset. application integrates windows forms webbrowser control—basically internet explorer—and need ensure minimum version of internet explorer in installer. did not find easy, built-in method in wix check internet explorer version (as there .net framework), following wix tutorial's instructions checking file's version number during installation along microsoft's documentation of internet explorer version numbers (under heading, how determine version of internet explorer windows, third bullet point).

here relevant code product.wxs file explanatory comments included:

<property id="ie10orhigher">   <directorysearch id="progfolder" path="[programfilesfolder]\internet explorer">     <!-- tried following line ensure directorysearch path           , filesearch name attributes functioning correctly.          line--without minversion set--results in ie10orhigher          property being defined during installation, useless          because merely detects iexplore.exe exists rather          ensuring minimum version.  -->     <!-- <filesearch name="iexplore.exe" /> -->      <!-- need internet explorer 10 @ minimum. -->     <!-- ie10 rtm windows 8 version number: 10.0.9200.16384 -->     <!-- ie10 rtm windows 7 version number: 10.0.9200.16521 -->     <!-- use ie10 rtm windows 8 version string. minimum in filesearch          must desired revision minus 1. see          https://msdn.microsoft.com/library/aa371853.aspx -->     <filesearch name="iexplore.exe" minversion="10.0.9200.16383" />   </directorysearch> </property>  <!-- requires internet explorer 10 or higher. --> <condition message="this application requires internet explorer 10 or higher. please upgrade internet explorer, , run installer again.">   <![cdata[installed or ie10orhigher]]> </condition> 

running windows 8.1, , have verified version of iexplore.exe on system 11.0.9600.17840. when compile , run installer full logging (/l*vx) though, condition message displayed, , software not installed. here excerpt msiexec log file showing search file, stars inserted point out important lines:

action 22:10:12: appsearch. searching installed applications action start 22:10:12: appsearch. ★appsearch: property: ie10orhigher, signature: progfolder appsearch: property: netframework45, signature: netframework45 msi (c) (bc:54) [22:10:12:849]: property change: adding netframework45 property. value '#379893'. action ended 22:10:12: appsearch. return value 1. msi (c) (bc:54) [22:10:12:849]: doing action: launchconditions msi (c) (bc:54) [22:10:12:849]: note: 1: 2205 2:  3: actiontext  action 22:10:12: launchconditions. evaluating launch conditions action start 22:10:12: launchconditions. msi (c) (bc:48) [22:10:12:856]: font created.  charset: req=0, ret=0, font: req=ms shell dlg, ret=ms shell dlg ★this application requires internet explorer 10 or higher. please upgrade internet explorer, , run installer again. msi (c) (bc:54) [22:10:14:276]: note: 1: 2205 2:  3: error  msi (c) (bc:54) [22:10:14:276]: note: 1: 2228 2:  3: error 4: select `message` `error` `error` = 1709  ★msi (c) (bc:54) [22:10:14:276]: product: myproductname -- application requires internet explorer 10 or higher. have  installed. please upgrade internet explorer, , run installer again.  action ended 22:10:14: launchconditions. return value 3. action ended 22:10:14: install. return value 3. property(c): upgradecode = {my-guid-removed} property(c): netframework45 = #379893

for contrast, here log file installation when recompile filesearch element's minversion attribute omitted. in case, iexplore.exe file found, property set, , program installs fine (but of course, omitting version check need accomplish!)

action start 21:40:48: appsearch. appsearch: property: ie10orhigher, signature: progfolder ★msi (c) (98:14) [21:40:48:761]: property change: adding ie10orhigher property. value 'c:\program files\internet explorer\iexplore.exe'. appsearch: property: netframework45, signature: netframework45 msi (c) (98:14) [21:40:48:762]: property change: adding netframework45 property. value '#379893'. action ended 21:40:48: appsearch. return value 1. msi (c) (98:14) [21:40:48:762]: doing action: launchconditions msi (c) (98:14) [21:40:48:762]: note: 1: 2205 2:  3: actiontext  action 21:40:48: launchconditions. evaluating launch conditions action start 21:40:48: launchconditions. action ended 21:40:48: launchconditions. return value 1.  ★★★numerous lines installation's progress skipped here★★★  property(c): upgradecode = {my-guid-removed} ★property(c): ie10orhigher = c:\program files\internet explorer\iexplore.exe property(c): netframework45 = #379893 

why filesearch failing recognize iexplore.exe's version of 11.0.9600.17840 greater minversion attribute's value of 10.0.9200.16383?


update problem cause , revised question - 2015-08-25

in response answers christopher painter , kiran hegde, began working on minimal version of installer project still show error. in doing so, found problem: installer dual-purpose package; default, runs per-user, , directorysearch element specifying path="[programfilesfolder]\internet explorer" searching under %localappdata%\programs rather under %programfiles%. verified case trying following workarounds/tests @ command prompt, both of allowed installer complete successfully:

workaround/test 1 - copy ie place installer looking

robocopy "%programfiles%\internet explorer" "%localappdata%\programs\internet explorer" iexplore.exe msiexec /package myproductname.msi rd /s /q "%localappdata%\programs\internet explorer"

or

workaround/test 2 - specify per-machine installation

msiexec /package myproductname.msi allusers=1

finding cause of problem great, still have problem. installer needs run in either per-user or per-computer context based on user's choice. since msi's programfilesfolder variable specific installation context, how can test ie's version under %programfiles% when running in per-user context?

can try trying in test project , see if works expected? because tried piece of code in test project , worked expected. used windows 7 64 bit environment , version of iexplore.exe on system 11.0.9600.17937.if use 11.0.9600.17937 in minversion field, see message(i.e minimum required version 11.0.9600.17938 not found. if use 11.0.9600.17936 in minversion field, don't see message (i.e minimum required version 11.0.9600.17937 has been found) shouldn't matter if windows 7 or windows 8 environment behavior dictated windows installer framework. btw, mean when version check omitted? see launch condition firing if required minimum version of internet explorer not found. long logs indicate :launchconditions. evaluating launch conditions, safe enough assume version check being performed.

here test project:

<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi">     <product id="*" name="filesearch" language="1033" version="1.0.0.0" manufacturer="test" upgradecode="8790de3a-ca66-4577-b3cd-5a9df0ab15b2">         <package installerversion="200" compressed="yes" installscope="permachine"  />          <majorupgrade downgradeerrormessage="a newer version of [productname] installed." />         <mediatemplate embedcab="yes" />          <feature id="productfeature" title="filesearch" level="1">             <componentgroupref id="productcomponents" />         </feature>      <property id="ie10orhigher">   <directorysearch id="progfolder" path="[programfilesfolder]\internet explorer">     <!-- tried following line ensure directorysearch path           , filesearch name attributes functioning correctly.          line without minversion set results in ie10orhigher          property being defined during installation, useless          because merely detects iexplore.exe exists rather          ensuring minimum version.  -->     <!-- <filesearch name="iexplore.exe" /> -->      <!-- need internet explorer 10 @ minimum. -->     <!-- ie10 rtm windows 8 version number: 10.0.9200.16384 -->     <!-- ie10 rtm windows 7 version number: 10.0.9200.16521 -->     <!-- use ie10 rtm windows 8 version string. minimum in filesearch          must desired revision minus 1. see          https://msdn.microsoft.com/library/aa371853.aspx -->     <filesearch name="iexplore.exe" minversion="11.0.9600.17936" />   </directorysearch> </property>  <!-- requires internet explorer 10 or higher. --> <condition message="this application requires internet explorer 10 or higher. please upgrade internet explorer, , run installer again.">   <![cdata[installed or ie10orhigher]]> </condition>     </product>      <fragment>         <directory id="targetdir" name="sourcedir">             <directory id="programfilesfolder">                 <directory id="installfolder" name="filesearch" />             </directory>         </directory>     </fragment>      <fragment>         <componentgroup id="productcomponents" directory="installfolder">               <component id="productcomponent" guid="{6cd6fbf0-8fe4-4882-80e1-dc16b9ced222}">                  <!-- todo: insert files, registry keys, , other resources here. -->          <file id="productfile" keypath="yes" source="e:\learning\test projects\files\abc.dll" name="abc.dll" />             </component>          </componentgroup>     </fragment> </wix> 

Comments

Popular posts from this blog

php - Admin SDK -- get information about the group -

dns - How To Use Custom Nameserver On Free Cloudflare? -

Python Error - TypeError: input expected at most 1 arguments, got 3 -