<!---
Name: getCFMXVersion.cfm
Author: Charlie Arehart
Version: 3/26/03
Published in the May 2003 CFDJ
--->
<h2>CF Version Analysis:</h2>
<cfscript>
versinfo = arraynew(1);
versinfo[1] = structnew();
versinfo[1].name = "the base version, with no updater";
versinfo[1].number = 48097;
versinfo[2] = structnew();
versinfo[2].name = "Updater 1";
versinfo[2].number = 52311;
versinfo[3] = structnew();
versinfo[3].name = "Updater 2";
versinfo[3].number = 55693;
versinfo[4] = structnew();
versinfo[4].name = "Updater 3";
versinfo[4].number = 58500;
curversion = listlast(Server.ColdFusion.ProductVersion);
</cfscript>
<cfoutput>
This server is running <b>#Server.ColdFusion.ProductName#, #server.coldfusion.ProductLevel#</b>
<p>
The current version number is <b>#Server.ColdFusion.ProductVersion#</b>
<cfif left(Server.ColdFusion.ProductVersion,5) is "6,0,0" >
which means it's running with
<cfif server.coldfusion.appserver is "j2ee" and curversion is 58096>
Updater 3 on ColdFusion MX for J2EE.
<cfelse>
<cfloop from="1" to="#arraylen(versinfo)#" index="i">
<cfif curversion eq versinfo[i].number>
<b>#versinfo[i].name#</b>.
<cfbreak>
<cfelseif curversion lt versinfo[i].number>
<b>patches not yet up to the final release of #versinfo[i].name#</b>
<cfbreak>
<cfelseif i is arraylen(versinfo)>
a version <b>greater than the final release of
#versinfo[arraylen(versinfo)].name#</b>.
This tool has not been updated yet to recognize that version number.
</cfif>
</cfloop>
</cfif>
<cfelse>
<!--- there were no updaters for CF 5 or before, so there's no reason to try to report on them
prior to CFMX, and this program will not report on any version greater than CFMX
(productversion > 6) --->
</cfif>
<p>
There are updaters for CFMX available at
<a href="http://www.macromedia.com/software/coldfusion/special/updater/faq/">
http://www.macromedia.com/software/coldfusion/special/updater/faq/</a>.
</cfoutput>
Actually, the code above is yet another update over a version (below) that I'd first offered here in this posting on 3/19. The version above is just a little better organized than the code below. They produce the same result.I offer the code below for "posterity". :-)
<cfoutput>
<h2>CF Version Analysis:</h2>
This server is running <b>#Server.ColdFusion.ProductName#, #server.coldfusion.PRoductLevel#</b>
<p>
The current version number is <b>#Server.ColdFusion.ProductVersion#</b>
<cfif listfirst(Server.ColdFusion.ProductVersion) is 6>
which means it's running with
<cfif listlast(Server.ColdFusion.ProductVersion) le 48097>
<b>no updater</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) lt 52311>
<b>patches above the base version but not yet up to the final release of updater 1</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) eq 52311>
<b>updater 1</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) lt 55693>
<b>patches above updater 1 but not yet up to the final release of updater 2</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) eq 55693>
<b>updater 2</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) eq 58096 and Server.ColdFusion.ProductName contains "j2ee">
<b>updater 3 for #Server.ColdFusion.ProductName#</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) lt 58500>
<b>patches above updater 2 but not yet up to the final release of updater 3</b>.
<cfelseif listlast(Server.ColdFusion.ProductVersion) eq 58500>
<b>updater 3</b>.
<cfelse>
a version <b>greater than the final release of updater 3</b>. This tool has not been updated yet to recognize that version number.
</cfif>
<cfelse>
<!--- there were no updaters for CF 5 or before, so there's no reason to try to report on them prior to CFMX, and this program will not report on any version greater than CFMX (prodcutversion > 6) --->
</cfif>
<p>
There are updaters for CFMX available at <a href="http://www.macromedia.com/software/coldfusion/special/updater/faq/">
http://www.macromedia.com/software/coldfusion/special/updater/faq/</a>.
</cfoutput>
No comments:
Post a Comment