Wix Toolset CustomAction for determining if the OS is windows 7/xp home edition or starter edition and display message for not -


i new wix toolset installation. using wix 3.7 , visual studio 2010 sp1.

i going through tutorial uses bootstrapper in there conditional message in product.wxs file checking .net framework 4.0 installed there propertyref id variable , condition message

<propertyref id="netframework40full"/> <condition message="this application requires .net framework 4.0. please install .net framework run      installer again.">   <![cdata[installed or netframework40full]]> </condition> 

how can 1 check condition windows xp starter/home , windows 7 starter/home/home premium editions , show conditional message installation not support os listed , require professional editions.

i have gone through links on wixtoolset website, didn't help:

checking windows versions http://wixtoolset.org/documentation/manual/v3/howtos/redistributables_and_install_checks/block_install_on_os.html

http://msdn.microsoft.com/library/aa370556.aspx

i have tried place condition in bootstrapper's bundle.wxs file as:

<bundle name="!(loc.productname)" compressed="yes" version="1.2.6.0"   splashscreensourcefile="resources\splashscreen.bmp" iconsourcefile="resources\ixmweb.ico"  manufacturer="!  (loc.manufacturername)" upgradecode="fed377e5-8762-48c4-b123-8d4ad89b0222" condition="((versionnt >= v5.1) ,  (servicepacklevel >= 3) , not(ntsuitepersonal)) or ((versionnt >= v5.2) , (servicepacklevel >= 2)) or  (versionnt >= v6.0 , not(ntsuitepersonal))"> 

i have gone through post need use ntsuitepersonal instead of msintsuitepersonal checking if edition home edition being installed.

please let me know not correct in above condition used.

for checking windows version (i.e. windows xp, vista, 7, 8, ...) can use versionnt-property described in links provided you. checking edition (i.e. home, premium, professional, ...), according this so-question, can use values below registry hive hklm\software\microsoft\windows nt\currentversion.
in combination wix registry search sets property , use property in condition (i verify exact registry key on windows 7 professional names editionid):

...  <property id="windowsedition" secure="yes">     <registrysearch id="windowseditionreg" root="hklm" key="software\microsoft\windows nt\currentversion" name="editionid" type="raw" /> </property>  ... 

see how to: read registry entry during installation.

edit: using properties named in link operating system property values , how to: read registry entry during installation , how to: block installation based on os version, example of checking if user has windows 7 professional service pack 1 installed , deny installation on else (put inside product-tag):

<condition message="this application can installed on windows 7 professional service pack 1.">     <![cdata[installed or (versionnt = 601 , windowsbuild > 7100 , windowsedition ~= "professional")]]> </condition> 

the installed-property on beginning of condition ensures condition validated if product isn't installed. within parenthesis find other conditional elements. ensure run on windows 7 (versionnt = 601 , windowsbuild > 7100) , edition correct (windowsedition ~= "professional"). note ~= checks string case insensitive.
syntax of conditional statements can take here. can of course combine additional conditions using or, and , grouping them parentheses appropriate. in real world scenario have condition, windows 7 , higher versions.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -