 |
 |
 |
Nikita wrote:
> I would like to find out if MSXML 3 or higher is installed on a
> computer during an installation so that, if MSXML is not installed or
> the version is below 3, then I install MSXML 4. How can I do that?
Hi,
I had the same problem for the installation process of one of my PC Mag
Utilities. I used the HTML page below to detect the user's context.
--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr
------------- xmldetect.htm - cut here ---------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Version Detection</title>
<script language="jscript">
function XMLClientVer()
{
//*********************
// Public properties
//*********************
this.bIsMSXML4 = false;
this.bIsMSXML3 = false;
this.bIsMSXML2 = false;
var majorversion;
var minorversion;
var requiredversion = 5;
if (typeof(ScriptEngineMajorVersion) + "" == "undefined")
{
majorversion = 1;
minorversion = 0;
}
else
{
majorversion = ScriptEngineMajorVersion();
minorversion = ScriptEngineMinorVersion();
}
document.write("<p>JSCRIPT ");
document.write("<b>"+majorversion+"."+minorversion+"</b>");
if (majorversion < requiredversion)
document.write("<br><i>You need a more recent version of JSCRIPT to run
this XML detection page (see links below).</i><br>");
else
document.write("<br><i>This version of JSCRIPT is sufficient to run
MyApp.</i><br>");
var e = new Error();
var oXML = null;
// Try to load the most recent version of the MSXML parser;
// if that fails, try to load the next most recent version, and so on.
// Always test using the version *dependent* PROGID.
try
{
// Test for MSXML 4.0
oXML = new ActiveXObject("MSXML2.DOMDocument.4.0");
oXML = null;
this.bIsMSXML4 = true;
//return;
}
catch (e)
{
try
{
// Test for MSXML 3.0
oXML = new ActiveXObject("MSXML2.DOMDocument.3.0");
oXML = null;
this.bIsMSXML3 = true;
//return;
}
catch (e)
{
try
{
// Test for MSXML 2.0
oXML = new ActiveXObject("Microsoft.XMLDOM.1.0");
oXML = null;
this.bIsMSXML2 = true;
//return;
}
catch (e)
{
// Stub
}
}
}
document.write("<p>MSXML ");
if (!this.bIsMSXML3 || !this.bIsMSXML4)
{
if (this.bIsMSXML4)
{
document.write("<b>4.0</b>");
document.write('<br><i>This version of MSXML is sufficient to run
MyApp.</i>');
}
else
{
var xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
var dummyxml = '<?xml version="1.0"?><books><book/></books>';
xmlDoc.async = false;
xmlDoc.loadXML(dummyxml);
xmlDoc.setProperty("SelectionLanguage", "XPath");
xmlDoc.setProperty("SelectionNamespaces",
"xmlns:my='urn:http//www.my.com/schema/'");
var nodelist = xmlDoc.documentElement.selectNodes("child::my:book");
var expected = "xmlns:my='urn:http//www.my.com/schema/'";
var actual = nodelist.getProperty("SelectionNamespaces");
if (actual != expected)
{
document.write("<b>3.0</b>");
document.write('<br><i>Use the link below to install SP2 or upgrade to
MSXML 4 before continuing the installation.</i>');
}
else
{
document.write("<b>3.0 SP2</b>");
document.write('<br><i>This version of MSXML is sufficient to run
MyApp.</i></b>');
}
}
}
else
{
document.write("<b>below 3.0</b>");
document.write ('<br><i>Use the link below to upgrade to MSXML 3 SP2 or
MSXML 4 before continuing the installation.</i>');
}
}
</script>
</head>
<body>
<h1>Component Version Detection</h1>
MyApp requires MSXML 3 SP2 or higher, and JSCRIPT 4.0 or higher. You are
running:
<SCRIPT LANGUAGE=JSCRIPT>
XMLClientVer();
</SCRIPT>
<P>
<HR>
<P>
<P>MSXML upgrade packages are available <a
href="http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/772/msdncompositedoc.xml&frame=true">here</a>.
<P>Microsoft Windows Installer is required to install MSXML 3. If
running the MSXML installer generates an MSI error, download the latest
version.
<p>- For Windows NT4, 2000, and XP, click <a
href="http://www.microsoft.com/downloads/release.asp?releaseid=32832&NewList=1">here</a>.
<br>- For Windows 95, 98, and Me, click <a
href="http://www.microsoft.com/downloads/release.asp?ReleaseID=32831">here</a>.
<P>The JSCRIPT upgrade package is available <a
href="http://msdn.microsoft.com/downloads/sample.asp?url=/MSDN-FILES/027/001/733/msdncompositedoc.xml">here</a>.
<P>
<HR>
</html>
------------- xmldetect.htm - cut here ---------------
|
 | 

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |