Checking and Installing .net 4.0 before while installing my forms app in SharpSetup WIX -


i don't have lot (this first go of it) of experience wix, decided use sharpsetup template in vs 2012 , running quickly. problem need install .net on users machine them use app, answers i've found on here talk using 'chain'. again don't know i'd this. assume .net installer put in same folder .exe in i'm swinging @ @ moment. can see tried , failed solving problem including .net installer exe in same group project. if explain in code implement .net check/install i'd appreciate it!

here's wix:

<?xml version="1.0" encoding="utf-8"?> <wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <?include product.defines.wxi ?>    <fragment> <directory id="targetdir" name="sourcedir">   <directory id="programmenufolder" name="programs">     <directory id="programmenudir" name="!(loc.appname)">       <component id="pmd" guid="{9d848b50-cab5-4f96-abe3-4c551c7335db}">         <registryvalue root="hkcu" key="software\$(var.appcode)\programmenudir" type="string" value="programmenudir" keypath="yes" />         <removefolder id="programmenudirrf" on="uninstall" />       </component>     </directory>   </directory>   <directory id="desktopfolder" name="desktop" />   <directory id="startupfolder" name="startup" />   <directory id="programfilesfolder">     <directory id="installlocation" name="$(var.appcode)">       <component id="mainexecutable" guid="{bbd95e2b-9f33-4c67-80d9-9b80f3f52001}">         <file id="mainexecutablefile" name="sampleapp.exe" source="..\productbuild\samplefile.txt" keypath="yes">           <shortcut id="mainexecutablestartmenu" directory="programmenudir" name="!(loc.appname)" workingdirectory="installdir" icon="icon.ico" iconindex="0" advertise="yes"/>           <shortcut id="mainexecutabledesktop" directory="desktopfolder" name="!(loc.appname)" workingdirectory="installdir" icon="icon.ico" iconindex="0" advertise="yes" />         </file>       </component>       <component id="subfeatureexecutable" guid="{0b30137e-621e-49a1-83bb-d0b50c3834b8}">         <file id="subfeatureexecutablefile" name="samplelibrary.dll" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationpound" guid="{006f5e3e-bb68-409c-8c30-37dc82a0a3f9}">         <file id="documentationpoundfile" name="pound.currency" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationeuro" guid="{a1e06fa0-0293-4314-ad3b-5a82b7cde17e}">         <file id="documentationeurofile" name="euro.currency" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationcommon" guid="{578635b1-b912-428e-b161-3507465bced9}">         <file id="documentationcommonfile" name="help.exe" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationenglish" guid="{434f103e-7be8-49ac-b90b-9675f42e6caa}">         <file id="documentationenglishfile" name="english.documentation" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationfrench" guid="{bd132536-94c6-488d-aa8a-700d4070718f}">         <file id="documentationfrenchfile" name="french.documentation" source="..\productbuild\samplefile.txt" vital="yes" />       </component>       <component id="documentationgerman" guid="{045e065e-bc43-418d-97fc-701b0d80dca3}">         <file id="documentationgermanfile" name="german.documentation" source="..\productbuild\samplefile.txt" vital="yes" />       </component>     </directory>   </directory> </directory> <directoryref id="installlocation">   <component id="dotnetfx40_full_x86_x64.exe" guid="{c5e5282e-dafe-4e51-857f-2648bbcb743c}">     <file id="fil8a9sd8fa9s8df9a8fs98fd9sfa908sdf" keypath="yes" source="..\productbuild\dotnetfx40_full_x86_x64.exe" />   </component>   <component id="entityframework.dll" guid="{c8010f46-05cf-4d73-8f69-6f68176ec558}">     <file id="fil34ecf92861b5c4f79e50a3ee293ac68a" keypath="yes" source="..\productbuild\entityframework.dll" />   </component>   <component id="entityframework.xml" guid="{c68d3de4-d338-4c83-96f1-dcf7d1fa1aac}">     <file id="fil04efbf6dc1a33030a49cfce8889f7e70" keypath="yes" source="..\productbuild\entityframework.xml" />   </component>   <component id="petestimetray.exe" guid="{c1891d2b-9815-42a3-bcd7-3316f0f28ac7}">     <file id="fil7ac61c1eb5b94a1f447da90d87bb454b" keypath="yes" source="..\productbuild\petestimetray.exe">       <shortcut id="petestimetraystartmenu" directory="programmenudir" name="!(loc.appname)" workingdirectory="installdir" icon="icon.ico" iconindex="0" advertise="yes" />       <shortcut id="petestimetraydesktop" directory="desktopfolder" name="!(loc.appname)" workingdirectory="installdir" icon="icon.ico" iconindex="0" advertise="yes" />       <shortcut id="petestimetraystartup" directory="startupfolder" name="!(loc.appname)" workingdirectory="installdir" icon="icon.ico" iconindex="0" advertise="yes" />     </file>   </component>   <component id="petestimetray.exe.config" guid="{321efadc-29dd-4e41-bed0-5b360faebba0}">     <file id="fil1dc527512d4271328f383f45c1f9229b" keypath="yes"    source="..\productbuild\petestimetray.exe.config" />   </component> </directoryref> <componentgroup id="petestimetrayfiles">   <componentref id="dotnetfx40_full_x86_x64.exe" />   <componentref id="entityframework.dll" />   <componentref id="entityframework.xml" />   <componentref id="petestimetray.exe" />   <componentref id="petestimetray.exe.config" /> </componentgroup> </fragment> </wix> 

you can check if .net framework installed linking netfxextension light. add propertyref 1 want. can find list of properties here.

say want make sure .net framework 4.0 full present before installing software, you'd add somewhere in source code:

<propertyref id="netframework40full" /> <condition message=".net framework 4.0 full not installed.">     netframework40full </condition> 

when running msi, launchconditions action run , check if netframework40full property set. if is, installation continues, if not, installation fails.

however, if wanted install .net framework beforehand, you'll need 2 wix projects. 1 basic msi, , 1 bundle (this chain heard about). there's tutorial here on how that.

<bundle>      ...      <chain>         <packagegroupref id="netfx40redist"/>         <msipackage id="myapplication" sourcefile="path msi"/>     </chain> </bundle> 

you'll have link against netfxextension here too. list of possible .net packages listed here.


Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -