房
房客
Unregistered / Unconfirmed
GUEST, unregistred user!
http://sash.alphaworks.ibm.com/release/current/weblications/tools/wdkinstall/install.htm
(The IBM Sash Team)
install.js的内容如下:
/********************************************************************/
var SASHLOCATION = "http://sash.alphaworks.ibm.com/";
var REQUIREMENTS = "http://sash.alphaworks.ibm.com/about/requirements/";
var URLBASE = "2";
var NETSCAPEJAR = "install/runtime/npsash.jar";
var IECABPOSTFIX = "install/runtime/sashdld.cab"
var SASHINSTCAB = "install/runtime/sashinst.cab"
var NETSCAPE = "Netscape";
var IE = "Microsoft Internet Explorer";
var PLATFORM = "Win32";
var MINIEVERSION = 4.0;
var MINNSVERSION = 4.5;
var NETSCAPEPLUGINDESCRIPTION = "Netscape IBM Sash Plugin";
/********************************************************************/
var BrowserType = navigator.appName;
var VersionNum = navigator.userAgent.substring( navigator.userAgent.indexOf( "/" )+1, navigator.userAgent.indexOf( " " ) );
var ISIE = false;
var ISNETSCAPE = false;
var CONTINUE = false;
var AUTOINSTALL=false;
if (isNaN(URLBASE))
URLBASE = 2;
var urlindex = 0;
for (var i = 0 ; i < URLBASE ; i++) {
urlindex = document.location.pathname.indexOf("/",urlindex+1);
}
var sashloc = document.location.protocol + "//" + document.location.host + document.location.pathname.substr(0,urlindex+1);
var iecab = sashloc + IECABPOSTFIX;
var sashinst = sashloc + SASHINSTCAB;
var netscapejar = sashloc + NETSCAPEJAR;
if( navigator.platform!=PLATFORM)
{
alert( "Sorry, to install an IBM Sash Weblications for Windows you need to be running windows." );
document.location = REQUIREMENTS;
}
else if( ( ( BrowserType == NETSCAPE) && (VersionNum < MINNSVERSION )) ||
( ( BrowserType == IE ) &&(VersionNum < MINIEVERSION )) ||
( (BrowserType != IE) && ( BrowserType != NETSCAPE)) ) {
alert( "Sorry, to install an IBM Sash Weblication you need to/n be using either Microsoft Internet Explorer Version 4.0/n(and above) or Netscape Navigator 4.5 (and above)." );
document.location = REQUIREMENTS;
}
else
{
if ( BrowserType == NETSCAPE ) {
ISNETSCAPE = true;
if (HasPlugin()) {
CONTINUE = true;
if (window.location.hash.toUpperCase() == "#AUTOINSTALL") {
AUTOINSTALL=true;
}
}
}
else if ( BrowserType == IE ) {
ISIE = true ;
}
}
function loader() {
if (ISIE) {
document.all("InstallButton").disabled=false;
}
if (window.location.hash.toUpperCase() == "#AUTOINSTALL") {
if (ISIE || HasPlugin()){
button_click();
} else
alert("There has been a problem starting the/nIBM Sash Weblication installer program./nRefer to http://sash.alphaworks.ibm.com.");
}
}
function button_click() {
if (CONTINUE) {
if (ISIE) bd.style.cursor = "default";
if ((ISNETSCAPE && document.SashInstall) || (ISIE && document.SashInstall.object)) {
window.status = "";
document.SashInstall.ResumeURL = document.location.href + "#AUTOINSTALL";
document.SashInstall.WDF = WDFFILE ;
document.SashInstall.InstallerCabURL = sashinst;
document.SashInstall.Location = sashloc ;
var rc=document.SashInstall.Install();
if (rc==0 || rc==4 || rc==6) {
if (ISIE)
document.all("InstallButton").disabled=true;
}
} else {
alert("There has been a problem starting the IBM Sash Weblication installer program. Please check your security settings.");
}
} else {
if (ISIE) {
IEInstall();
} else if (ISNETSCAPE)
NetscapeInstall() ;
}
}
/* Start of IE Specific stuff */
function OnInit() {
CONTINUE=true;
window.status = "Starting IBM Sash Installation Manager ...";
button_click();
}
function IEInstall() {
window.status = "Downloading IBM Sash Installation Manager ...";
document.all("InstallButton").disabled=true;
bd.style.cursor = "wait";
objectInserter.innerHTML='<object classid="clsid:E9AEAEF3-8BAD-11D2-9321-00E09801CAF6" id="SashInstall" style="HEIGHT: 0px; WIDTH: 0px" codebase="'+iecab+'#version=2,0,0,135"><PARAM Name="OnInit" Value="OnInit"><SCR'+'IPT DEFER>window.status=""; alert("There has been a problem starting the IBM Sash Weblication installer program. Please check your security settings./nIn addition you may also require local Administrator privileges to complete this installation.");bd.style.cursor = "default";</SCR'+'IPT></object>';
}
/* End of IE Specific stuff */
/* Start of Netscape Specific Functions */
function NetscapeInstall() {
if ( navigator.javaEnabled() ) {
trigger = netscape.softupdate.Trigger;
if ( trigger.UpdateEnabled() ) {
trigger.StartSoftwareUpdate ( netscapejar, trigger.DEFAULT_MODE);
NetscapeRefresh();
}
else alert("In order to install IBM Sash Weblications for Windows SmartUpdate must be enabled./nEnable SmartUpdate through Netscapes advanced preferences applet.");
} else alert("In order to install IBM Sash Weblications for Windows Java must be enabled./nEnable Java through Netscapes advanced preferences applet.");
}
function HasPlugin(){
var HasNetscapePlugin = false;
var plugins=navigator.plugins;
plugins.refresh();
for (var i =0 ; i< plugins.length ; i++) {
if (plugins.description == NETSCAPEPLUGINDESCRIPTION) {
HasNetscapePlugin = true;
i = plugins.length;
}
}
return HasNetscapePlugin;
}
function NetscapeRefresh() {
if (CheckPlugin()) {
document.location.href="#AUTOINSTALL";
setTimeout("document.location.reload(false)",1);
} else setTimeout("NetscapeRefresh()",1000);
}
function CheckPlugin() {
navigator.plugins.refresh(true);
var existingVI = netscape.softupdate.Trigger.GetVersionInfo("plugins/npsash");
if (existingVI != null)
return true;
return false;
}
function NetscapeEmbed() {
if ((ISNETSCAPE) && (CONTINUE || AUTOINSTALL)) {
document.write("<EMBED HIDDEN NAME=/"SashInstall/" TYPE=/"application/x-Sash-Weblication-Install/" PLUGINURL=/""+netscapejar+"/"></EMBED>");
}
}
/* End of Netscape Specific Functions */
(The IBM Sash Team)
install.js的内容如下:
/********************************************************************/
var SASHLOCATION = "http://sash.alphaworks.ibm.com/";
var REQUIREMENTS = "http://sash.alphaworks.ibm.com/about/requirements/";
var URLBASE = "2";
var NETSCAPEJAR = "install/runtime/npsash.jar";
var IECABPOSTFIX = "install/runtime/sashdld.cab"
var SASHINSTCAB = "install/runtime/sashinst.cab"
var NETSCAPE = "Netscape";
var IE = "Microsoft Internet Explorer";
var PLATFORM = "Win32";
var MINIEVERSION = 4.0;
var MINNSVERSION = 4.5;
var NETSCAPEPLUGINDESCRIPTION = "Netscape IBM Sash Plugin";
/********************************************************************/
var BrowserType = navigator.appName;
var VersionNum = navigator.userAgent.substring( navigator.userAgent.indexOf( "/" )+1, navigator.userAgent.indexOf( " " ) );
var ISIE = false;
var ISNETSCAPE = false;
var CONTINUE = false;
var AUTOINSTALL=false;
if (isNaN(URLBASE))
URLBASE = 2;
var urlindex = 0;
for (var i = 0 ; i < URLBASE ; i++) {
urlindex = document.location.pathname.indexOf("/",urlindex+1);
}
var sashloc = document.location.protocol + "//" + document.location.host + document.location.pathname.substr(0,urlindex+1);
var iecab = sashloc + IECABPOSTFIX;
var sashinst = sashloc + SASHINSTCAB;
var netscapejar = sashloc + NETSCAPEJAR;
if( navigator.platform!=PLATFORM)
{
alert( "Sorry, to install an IBM Sash Weblications for Windows you need to be running windows." );
document.location = REQUIREMENTS;
}
else if( ( ( BrowserType == NETSCAPE) && (VersionNum < MINNSVERSION )) ||
( ( BrowserType == IE ) &&(VersionNum < MINIEVERSION )) ||
( (BrowserType != IE) && ( BrowserType != NETSCAPE)) ) {
alert( "Sorry, to install an IBM Sash Weblication you need to/n be using either Microsoft Internet Explorer Version 4.0/n(and above) or Netscape Navigator 4.5 (and above)." );
document.location = REQUIREMENTS;
}
else
{
if ( BrowserType == NETSCAPE ) {
ISNETSCAPE = true;
if (HasPlugin()) {
CONTINUE = true;
if (window.location.hash.toUpperCase() == "#AUTOINSTALL") {
AUTOINSTALL=true;
}
}
}
else if ( BrowserType == IE ) {
ISIE = true ;
}
}
function loader() {
if (ISIE) {
document.all("InstallButton").disabled=false;
}
if (window.location.hash.toUpperCase() == "#AUTOINSTALL") {
if (ISIE || HasPlugin()){
button_click();
} else
alert("There has been a problem starting the/nIBM Sash Weblication installer program./nRefer to http://sash.alphaworks.ibm.com.");
}
}
function button_click() {
if (CONTINUE) {
if (ISIE) bd.style.cursor = "default";
if ((ISNETSCAPE && document.SashInstall) || (ISIE && document.SashInstall.object)) {
window.status = "";
document.SashInstall.ResumeURL = document.location.href + "#AUTOINSTALL";
document.SashInstall.WDF = WDFFILE ;
document.SashInstall.InstallerCabURL = sashinst;
document.SashInstall.Location = sashloc ;
var rc=document.SashInstall.Install();
if (rc==0 || rc==4 || rc==6) {
if (ISIE)
document.all("InstallButton").disabled=true;
}
} else {
alert("There has been a problem starting the IBM Sash Weblication installer program. Please check your security settings.");
}
} else {
if (ISIE) {
IEInstall();
} else if (ISNETSCAPE)
NetscapeInstall() ;
}
}
/* Start of IE Specific stuff */
function OnInit() {
CONTINUE=true;
window.status = "Starting IBM Sash Installation Manager ...";
button_click();
}
function IEInstall() {
window.status = "Downloading IBM Sash Installation Manager ...";
document.all("InstallButton").disabled=true;
bd.style.cursor = "wait";
objectInserter.innerHTML='<object classid="clsid:E9AEAEF3-8BAD-11D2-9321-00E09801CAF6" id="SashInstall" style="HEIGHT: 0px; WIDTH: 0px" codebase="'+iecab+'#version=2,0,0,135"><PARAM Name="OnInit" Value="OnInit"><SCR'+'IPT DEFER>window.status=""; alert("There has been a problem starting the IBM Sash Weblication installer program. Please check your security settings./nIn addition you may also require local Administrator privileges to complete this installation.");bd.style.cursor = "default";</SCR'+'IPT></object>';
}
/* End of IE Specific stuff */
/* Start of Netscape Specific Functions */
function NetscapeInstall() {
if ( navigator.javaEnabled() ) {
trigger = netscape.softupdate.Trigger;
if ( trigger.UpdateEnabled() ) {
trigger.StartSoftwareUpdate ( netscapejar, trigger.DEFAULT_MODE);
NetscapeRefresh();
}
else alert("In order to install IBM Sash Weblications for Windows SmartUpdate must be enabled./nEnable SmartUpdate through Netscapes advanced preferences applet.");
} else alert("In order to install IBM Sash Weblications for Windows Java must be enabled./nEnable Java through Netscapes advanced preferences applet.");
}
function HasPlugin(){
var HasNetscapePlugin = false;
var plugins=navigator.plugins;
plugins.refresh();
for (var i =0 ; i< plugins.length ; i++) {
if (plugins.description == NETSCAPEPLUGINDESCRIPTION) {
HasNetscapePlugin = true;
i = plugins.length;
}
}
return HasNetscapePlugin;
}
function NetscapeRefresh() {
if (CheckPlugin()) {
document.location.href="#AUTOINSTALL";
setTimeout("document.location.reload(false)",1);
} else setTimeout("NetscapeRefresh()",1000);
}
function CheckPlugin() {
navigator.plugins.refresh(true);
var existingVI = netscape.softupdate.Trigger.GetVersionInfo("plugins/npsash");
if (existingVI != null)
return true;
return false;
}
function NetscapeEmbed() {
if ((ISNETSCAPE) && (CONTINUE || AUTOINSTALL)) {
document.write("<EMBED HIDDEN NAME=/"SashInstall/" TYPE=/"application/x-Sash-Weblication-Install/" PLUGINURL=/""+netscapejar+"/"></EMBED>");
}
}
/* End of Netscape Specific Functions */