Hi,

I've added a page to the installer after the welcome page which links to the Microsoft .NET site if the version of the .NET framework isn't 4.0 or greater. The page itself uses the autodetectDotNetFramework tag as part of the validationActionList to stop the installer proceeding if the version isn't present. I've added the following to stop the page from being displayed if .NET is already present...

<rulelist> <compareversions version1="${dotNetPresent}" logic="less" version2="${dotNetRequired}"/> </rulelist>

Which is set within the initializationActionList like so <setinstallervariable name="dotNetRequired" value="4.0"/> <setinstallervariable name="dotNetMax" value="4.5"/> <setinstallervariable name="dotNetPresent" value=""/> <actiongroup> <actionlist> <actiongroup> <actionlist> <registryget name="Install" key="HKEY_LOCAL_MACHINEklzzwxh:0005SOFTWAREklzzwxh:0006Microsoftklzzwxh:0007NET Framework Setupklzzwxh:0008NDPklzzwxh:0009v4klzzwxh:0010Client" variable="dotNetValue"/> <setinstallervariable name="dotNetPresent" value="4.0"> <rulelist> <comparetext text="${dotNetValue}" value="1" logic="equals"/> </rulelist> </setinstallervariable> </actionlist> <rulelist> <compareversions version1="${dotNetRequired}" logic="less_or_equal" version2="4.0"/> </rulelist> </actiongroup> <actiongroup> <actionlist> <registryget name="Install" key="HKEY_LOCAL_MACHINEklzzwxh:0011SOFTWAREklzzwxh:0012Microsoftklzzwxh:0013NET Framework Setupklzzwxh:0014NDPklzzwxh:0015v4klzzwxh:0016Full" variable="dotNetValue"/> <setinstallervariable name="dotNetPresent" value="4.0"> <rulelist> <comparetext text="${dotNetValue}" value="1" logic="equals"/> </rulelist> </setinstallervariable> </actionlist> <rulelist> <compareversions version1="${dotNetRequired}" logic="less_or_equal" version2="4.0"/> </rulelist> </actiongroup> <actiongroup> <actionlist> <registryget name="Install" key="HKEY_LOCAL_MACHINEklzzwxh:0017SOFTWAREklzzwxh:0018Microsoftklzzwxh:0019NET Framework Setupklzzwxh:0020NDPklzzwxh:0021v4.5klzzwxh:0022Client" variable="dotNetValue"/> <setinstallervariable name="dotNetPresent" value="4.5"> <rulelist> <comparetext text="${dotNetValue}" value="1" logic="equals"/> </rulelist> </setinstallervariable> </actionlist> <rulelist> <compareversions version1="${dotNetRequired}" logic="less_or_equal" version2="4.5"/> </rulelist> </actiongroup> <actiongroup> <actionlist> <registryget name="Install" key="HKEY_LOCAL_MACHINEklzzwxh:0023SOFTWAREklzzwxh:0024Microsoftklzzwxh:0025NET Framework Setupklzzwxh:0026NDPklzzwxh:0027v4.5klzzwxh:0028Full" variable="dotNetValue"/> <setinstallervariable name="dotNetPresent" value="4.5"> <rulelist> <comparetext text="${dotNetValue}" value="1" logic="equals"/> </rulelist> </setinstallervariable> </actionlist> <rulelist> <compareversions version1="${dotNetRequired}" logic="less_or_equal" version2="4.0"/> </rulelist> </actiongroup> </actionlist> </actiongroup>

I'm not a fan of setting the dotNetPresent variable like that at all; although I can't see a way of doing it using autodetectDotNetFramework. Is it possible or do I need to make sure that my .NET detection is just kept up to date?

asked 13 Dec '12, 06:22

A%20Jefferiss's gravatar image

A Jefferiss
56151621
accept rate: 100%


Sorry, I may not be properly understanding the issue but you could simply call <autodetectDotNetFramework/> in the <initializationActionList> and attach the below rule to your page:

<initializationActionList>
   <autodetectDotNetFramework ... abortOnError="0" showMessageOnError="0"/>
</initializationActionList>
 ...
<parameterGroup>
    <name>yourPage</name>
        ...
    <ruleList>
         <isFalse value="${dotnet_autodetected}"/>
    </ruleList>
</parameterGroup>

So it won't appear if it is found.

link

answered 13 Dec '12, 07:30

juanjo's gravatar image

juanjo ♦♦
5.8k413
accept rate: 23%

Excellent thanks, not sure how but when I initially read the docs I missed the dotnet_autodetected variable.

I've copied my autodetectDotNetFramework element into the initializationActionList, like so and with the isfalse check on my page it works:

<autodetectdotnetframework abortonerror="0" showmessageonerror="0">
  <validdotnetversionlist>
    <validdotnetversion>
      <frameworktype>any</frameworktype>
      <maxversion>${dotNetMax}</maxversion>
      <minversion>${dotNetRequired}</minversion>
    </validdotnetversion>
  </validdotnetversionlist>
</autodetectdotnetframework>

(13 Dec '12, 08:34) A Jefferiss

Hi,

I try to use the autodetectdotnetframework feature for .Net 4.5.1, but my code below is not working (.NET 4.5.1 is not detected wehen it is already installed.):

<autodetectDotNetFramework>
<abortOnError>0</abortOnError>
<showMessageOnError>0</showMessageOnError>
<validDotNetVersionList>
    <validDotNetVersion>
        <frameworkType>full</frameworkType>
        <maxVersion></maxVersion>
        <minVersion>4.5.1</minVersion>
    </validDotNetVersion>
</validDotNetVersionList>
</autodetectdotnetframework>

I tried it with 4.5 instead of 4.5.1, but this is also not working.

Is the feature not wokring with this new .Net Version, or do I something wrong?

(This was with Bitrock Installbuilder 8.6 -> I will try 9.0 now...)

Edit: Detection is working with Installbuilder 9.0 and 4.5 as minversion. 4.5.1 as minversion is not working. But for me, its ok so!

link

answered 12 May '14, 04:23

CV1's gravatar image

CV1
36899
accept rate: 0%

edited 12 May '14, 05:51

1

Thanks for updating your post. Just the information that I was looking for. I have to upgrade to 9.0. I wish the docs did a better job of stating the supported frameworks in the autodetection actions.

(16 Dec '14, 18:49) DevHopeful_2012
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×5
×4
×1

Asked: 13 Dec '12, 06:22

Seen: 1,681 times

Last updated: 16 Dec '14, 18:49