Hallo,
Ik zat net op de 'slim install cd rond te kijken'
kwam ik dit tegen:
Code:
var MODEM_ADDRESS1 = "192.168.2.1"; // modem IP address
var MODEM_ADDRESS2 = "192.168.1.254";
var MODEM_ACCOUNT = ""; // modem administrator account
var MODEM_PASSWORD = ""; // modem administrator password
var objpw; // Password object
var gModemDOM = ipgLoadDom(gMODEM_CHARACTERISTICS);
//**********************************************************************************
// Name: ipgModemConfigured()
// Purpose: Determine if modem is configured to the correct config file.
// this method will login
// Parameter: (none)
// Return: true if are configured correctly
//**********************************************************************************
/*function ipgModemConfigured() {
var configList = ipgGetModemConfigurationChecks(gModemDOM);
if (!configList) // no configuration section, so no tests
return false;
objpw = new ActiveXObject("sdcuser.tgpassctl");
var bMatch = false;
if (ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) {
var nvPairs = ipgModemGetEnv();
bMatch = true;
var configItems = configList.childNodes;
for(var outer=0; outer<configItems.length && bMatch; outer++) {
ipgDebug(9,"checking "+configItems[outer].nodeName + "/" + configItems[outer].text);
bMatch = nvPairs[ configItems[outer].nodeName ] == configItems[outer].text;
}
if (bMatch && ipgIpIflist()) // if configured and modem is logged in
bMatch = true;
else
bMatch = false;
}
ipgModemLogout();
return bMatch;
}*/
//**********************************************************************************
// Name: ipgModemGetEnv()
// Purpose: return Assoc Array with all CONF_* items in env list
// you must be logged into the modem to use this method
// Parameter: (none)
// Return: Array with all CONF_* key value pairs
//**********************************************************************************
/*function ipgModemGetEnv() {
objpw.sendSocket("env list");
var response = ipgModemGetResponse();
ipgDebug(9,"env list="+response);
var splitText = response.split("\r\n");
var aKVP = new Array();
for (var ndx=0; ndx<splitText.length; ndx++) {
if (splitText[ndx].substr(0,5) == "CONF_") {
var kvp = splitText[ndx].split("=");
if (kvp.length >= 2)
aKVP[kvp[0]] = kvp[1];
}
if (splitText[ndx].substr(0,8) == "_MACADDR") {
//var macid = splitText[ndx].split("_MACADDR=");
var macid = splitText[ndx].substr(9,25);
ssSetReg("macid", macid);
}
}
return aKVP;
}*/
//**********************************************************************************
// Name: ipgModemIsSync()
// Purpose: Determine if modem is in sync. This is a required
// procedure and should determine as best as possible if we have sync.
// Parameter: (none)
// Return: true if we have sync
//**********************************************************************************
/*function ipgModemIsSync() {
window.external.RunCommand("bin\\sleep 40", BCONT_RUNCMD_HIDDEN);
if (!ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) {
objpw.close();
return false;
}
var bResult = ipgModemCheckStatus();
if (!bResult) { // check twice per LDV
window.external.RunCommand("bin\\sleep 40", BCONT_RUNCMD_HIDDEN);
bResult = ipgModemCheckStatus();
}
ipgModemLogout();
return bResult;
}*/
//***********************************************************************
// Name: ipgInstallModemButtons
// Purpose: Turn on the button bar at the right time
// Parameter: (none)
// Return: (none)
//***********************************************************************
function ipgInstallModemButtons() {
document.all.footer.style.display = "BLOCK";
}
//********************************************************************************************
// Name: ipgModemIsPresentAndConfigured
// Purpose: Test if we can ping the modem
// Parameter: ()
// Return: false if not OK, otherwise true
//*******************************************************************************************
function ipgModemIsPresentAndConfigured() {
var n;
for (n = 0; n < 4; n++)
{
if (document.netobj.PingTest(MODEM_ADDRESS1, 35, 1000, 32)) { // ping Experia Box
return true;
}
else if (document.netobj.PingTest(MODEM_ADDRESS2, 35, 1000, 32)) { // ping Speedtouch 780
return true;
}
}
return false;
}
//********************************************************************************************
// Name: ipgModemConfigure
// Purpose: Configure this modem
// Parameter: ()
// Return: true if OK, else false
//*******************************************************************************************
/*function ipgModemConfigure() {
objpw = new ActiveXObject("sdcuser.tgpassctl");
if (!ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) { // try and login
objpw.close();
return false;
}
var Interface = ipgModemVendorAttribute(gModemDOM,"modem_ini","interface");
var protocol = ipgModemVendorAttribute(gModemDOM,"modem_ini","protocol");
ipgDebug(9,"Interface is "+Interface+" protocol is "+protocol);
objpw.sendSocket(protocol +" ifdetach intf=" + Interface);
window.external.RunCommand("bin\\sleep 2", BCONT_RUNCMD_HIDDEN);
resp = objpw.receiveSocket();
ipgModemLogout();
var sourceFile = ssGetRootPath() + ipgModemVendorAttribute(gModemDOM,"modem_ini","iniSource");
var targetFile = ipgModemVendorAttribute(gModemDOM,"modem_ini","iniTarget");
var ftpFile = ipgModemVendorAttribute(gModemDOM,"modem_ini","ftpcmd");
ipgDebug(9,"Source is "+ sourceFile+" target is "+targetFile +" ftpcmd is "+ftpFile);
try {
stat = window.external.FtpRequest(2, sourceFile, "ftp://" + MODEM_ADDRESS + targetFile,"" ,"" , 8000);
errCode = window.external.GetLastError(); // if we got an error, then try ms ftp
} catch(er) {
errCode = 999;
}
if (errCode > 0) {
//ipgDebug(1,"FTPRequest returned "+errCode);
var ftpdir = ssGetRootPath() + "install/inc/st570/";
var dir =ssGetRootPath() + "install\\inc\\st570\\ini";
var target = "c:\\";
window.external.CopyDir(dir, target,0);
ipgDebug (9, "ftp -s:" + ftpdir + ftpFile + " " + MODEM_ADDRESS);
window.external.RunCommand("ftp -s:" + ftpdir + ftpFile + " " + MODEM_ADDRESS , BCONT_RUNCMD_HIDDEN);
window.external.DeleteFile("c:\\adsl_nat.ini");
}
if (!ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) { // try and login
objpw.close();
return false;
}
// setup file name for settings [use to apply ini file template]
var resp;
resp="";
var shortName = (targetFile.lastIndexOf("/") > -1) ? targetFile.substr( targetFile.lastIndexOf("/") + 1 ) : targetFile;
objpw.sendSocket("config load filename="+shortName.toLowerCase());
window.external.RunCommand("bin\\sleep 2", BCONT_RUNCMD_HIDDEN); //LDV
if (ssGetReg("OS").indexOf("xp") != -1) //LDV
window.external.RunCommand("bin\\refreshwp /s "+ssGetReg("ModemWLCard"), BCONT_RUNCMD_HIDDEN);
window.external.RunCommand("bin\\sleep 12", BCONT_RUNCMD_HIDDEN);
objpw.sendSocket("config save");
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
//resp = ipgModemGetResponse(); LDV
//ipgDebug(9,"save=" + resp); LDV
objpw.sendSocket(protocol+" iflist");
window.external.RunCommand("bin\\sleep 4", BCONT_RUNCMD_HIDDEN);
resp = ipgModemGetResponse();
ipgDebug(9,"iflist resp=" + resp);
//remove test because of delay receiving response
// if (resp.indexOf(Interface)!=-1)
// {
ipgModemSetFirmwareVersion();
ipgModemLogout();
return true;
// }
// else
// {
// ipgModemLogout();
//return false;
// }
} */
//********************************************************************************************
// Name: ipgModemIsPresentAndConfigured2
// Purpose: Determine as best as we can for this modem if it is installed, and configured
// in the case that the cable was initially not connected between pc and modem
// Parameter: ()
// Return: true if present
//*******************************************************************************************
function ipgModemIsPresentAndConfigured2() {
window.external.IpConfig(0); // Release IP address
window.external.IpConfig(1); // Renew IP address
return ipgModemIsPresentAndConfigured();
}
//********************************************************************************************
// Name: ipgModemIsPresent
// Purpose: See if we can reach modem
// Parameter: ()
// Return: true if present
//*******************************************************************************************
function ipgModemIsPresent() {
var oNet = (document.netobj)?document.netobj:new ActiveXObject("SdcUser.SdcNetCheck");
return oNet.PingTest(MODEM_ADDRESS, 35, 3000, 32);
}
//***********************************************************************
// Name: ipgModemConfigureUser
// Purpose: Configure the modem for this user/password
// Test that connection is OK
// Parameter: (none)
// Return: Error message or null if OK
//***********************************************************************
/*function ipgModemConfigureUser() {
ipgDebug(9, "Geen username en wachtwoord meer nodig!");
var bResult = true;
objpw = new ActiveXObject("sdcuser.tgpassctl");
var username = ssGetReg("userid"); var password = Reverse(ssGetReg("password"));
if (ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) {
if (ipgModemConfigUser(username,password,true)) {
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
//bResult = ipgGeneralPingTest();
bResult = ipgIpIflist();
}
ipgModemLogout();
}
return bResult;
}*/
//***********************************************************************
// Name: ipgModemSetFirmwareVersion()
// Purpose: Use CLI commands to retreive the firmware version and set to registry
// Parameter: none
// Return: none (but sets registry key)
//***********************************************************************
/*function ipgModemSetFirmwareVersion() {
var oReg = new RegExp("[\\s]{2,}|[=>]","g"); // clean result
var resp = "";
try {
objpw.sendSocket("software version");
var resp = ipgModemGetResponse();
resp = resp.replace(oReg," ");
ipgDebug(9,"software is "+resp);
ssSetReg("ModemFirmware", resp);
} catch(e) {
ipgDebug(3,"ST570:ipgModemSetFirmwareVersion() "+e.description);
}
}*/
//***********************************************************************
// Name: ipgMODEM_LIGHTS
// Purpose: return number of modem lights that should be green for OK
// Parameter: none
// Return: number of lights
//***********************************************************************
function ipgMODEM_LIGHTS() {
return "3";
}
//********************************************************************************************
// Name: ipgGetModemConnectDiagnostics
// Purpose: Get diagnostics if available
// Parameter: ()
// Return: Error Code
//*******************************************************************************************
function ipgGetModemConnectDiagnostics() {
return ""; // all diagnostics are generated in configuration methods
}
//***********************************************************************
// Name: ipgModemVPN1Test
// Purpose: Dial VPN1 connection and try to ping server
// Parameter: serverToPing
// Return: true if OK else False
//***********************************************************************
function ipgModemVPN1Test( serverToPing ) {
var bResult = false;
return true;
if (ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD)) {
ipgModemConfigUser(ipgGetVPN1().account,ipgGetVPN1().password,false);
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
bResult = ipgVPN1PingTest();
//ipgModemConfigUser("user@KPN","password",false);
if (!bResult){
ipgModemConfigUser(ipgGetVPN2().account,ipgGetVPN2().password,false);
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
bResult = ipgVPN2PingTest();
//ipgModemConfigUser("user@KPN","password",false);
}
ipgModemLogout();
}
return bResult;
}
//*******************************
// Name: ipgModemLogin
// Purpose: Login to the modem
// Parameter: account, password strings
// Return: true if login OK, else false
//*******************************
/*function ipgModemLogin(account,password) {
try {
objpw = new ActiveXObject("sdcuser.tgpassctl");
objpw.openSocket(MODEM_ADDRESS);
objpw.sendSocket(account);
if (password.length > 0 )
objpw.sendSocket(password);
var resp = ipgModemGetResponse();
ipgDebug(3,resp);
return (resp.toLowerCase().indexOf(LOGIN_SUCCESS.toLowerCase())!=-1);
} catch(e) {
ipgDebug(3,"vpn1:ST570:ipgLoginModem "+e.description);
}
return false;
}*/
//*******************************
// Name: ipgModemCheckStatus
// Purpose: check link status
// Parameter: (none) -- but we must be logged in
// Return: true if up, false if not
//*******************************
/*function ipgModemCheckStatus() {
var oReg = new RegExp("[\\s]{2,}","g"); // despacer regexp
var resp = "";
try {
objpw.sendSocket("adsl info");
resp = ipgModemGetResponse();
resp = resp.replace(oReg," ");
ipgDebug(9,"adsl state is "+resp);
return (resp.toLowerCase().indexOf("modemstate : up")!=-1);
} catch(e) {
ipgDebug(3,"vpn1:ST570:ipgCheckModemStatus "+e.description);
}
return false;
}*/
//*******************************
// Name: ipgModemLogout
// Purpose: Logout
// Parameter: (none)
// Return: (none), no error if not logged in
//*******************************
/*function ipgModemLogout() {
try {
objpw.sendSocket("exit");
objpw.close();
} catch(e) {
ipgDebug(3,"vpn1:ST570:ipgLogoutModem "+e.description);
}
}*/
//*******************************
// Name: ipgModemConfigUser
// Purpose: set userid and password, and parameters into the modem. Must be logged in
// Parameter: login, password strings, commit (true or false)
// Return: (none)
//*******************************
/*function ipgModemConfigUser(account, password, bCommit) {
var bResult = false;
var resp;
var Interface = ipgModemVendorAttribute(gModemDOM,"modem_ini","interface");
var protocol = ipgModemVendorAttribute(gModemDOM,"modem_ini","protocol");
window.external.RunCommand("bin\\sleep 2", BCONT_RUNCMD_HIDDEN);
objpw.sendSocket(protocol +" ifdetach intf="+Interface);
resp = objpw.receiveSocket();
var cmd = protocol+" ifconfig intf="+Interface+" user=$$USERID password=$$PASSWORD status=up retryinterval=25 restart=on"
cmd = cmd.replace("$$USERID", account);
cmd = cmd.replace("$$PASSWORD", password);
ipgDebug(9,"sending " + cmd);
try {
objpw.sendSocket(cmd);
resp = ipgModemGetResponse();
ipgDebug(9,resp);
bResult = true;
} catch(e) {
bResult = false;
ipgDebug(3,"Error in ST570::ipgModemConfigUser was "+e.description);
}
window.external.RunCommand("bin\\sleep 1", BCONT_RUNCMD_HIDDEN);
objpw.sendSocket(protocol+" ifattach intf=" + Interface);
if (bResult && bCommit)
objpw.sendSocket("config save");
return bResult;
}*/
//*******************************
// Name: ipgIpIflist()
// Purpose: Function to check if isp login is successful
// Parameter: none
// Return: (true/false)
//*******************************
/*function ipgIpIflist() {
objpw.sendSocket("ip iflist");
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
var resp = ipgModemGetResponse();
ipgDebug(9,"resp " + resp);
if (resp.toLowerCase().indexOf('down')!=-1)
return false
else
return true;
}*/
//***********************************************************************
// Name: ipgModemGetResponse
// Purpose: Get the response from a sendsocket
// Parameter: (none)
// Return: response string
//***********************************************************************/
/*function ipgModemGetResponse() {
var resp = "";
try {
var response = objpw.receiveSocket();
while(response.length > 0) {
resp += response;
response = objpw.receiveSocket();
}
ipgDebug(9,"Response is "+resp);
return resp;
} catch(e) {
ipgDebug(3,"ST570:ipgModemGetModemResponse() "+e.description);
return '';
}
}*/
//***********************************************************************
// Name: ipgModemGetIP
// Purpose: Get the external IP address from the modem
// Parameter: (none)
// Return: IP address or null string if we can't get it
//***********************************************************************/
/*function ipgModemGetIP() {
var oReg = new RegExp("[\\s]{2,}","g"); // despacer regexp
var resp = "";
var Interface = ipgModemVendorAttribute(gModemDOM,"modem_ini","interface");
objpw = new ActiveXObject("sdcuser.tgpassctl");
ipgModemLogin(MODEM_ACCOUNT, MODEM_PASSWORD);
try {
objpw.sendSocket("ip aplist");
resp = ipgModemGetResponse();
resp = resp.replace(oReg," ");
ipgModemLogout();
var istart = resp.indexOf(Interface); // find the section for our interface
var iend = resp.substr(istart).indexOf("droppkts"); // find end of section
if (istart==-1 || iend==-1) return ""; // parsing problem -> config error?
var ap = resp.substring(istart,iend+istart).substr( Interface.length + 1);
apList = ap.split(" ");
for( var ndx=0; ndx<apList.length; ndx++ ) {
if (apList[ndx].substr(0,8)=="ip-addr:") {
akvp = apList[ndx].split(":");
ipgDebug(9,"Found ip address of "+akvp[1]);
return akvp[1];
}
}
} catch(e) {
ipgDebug(3,"vpn1:ST570:ipgModemGetIP "+e.description);
}
return "";
}*/
//*******************************
// Name: ipgModemIPAddressInRange
// Purpose: See if the current IP address for any adapter is in range for this modem (OK connection)
// Parameter: none
// Return: true if one adapter has an address in range
//*******************************
function ipgModemIPAddressInRange() {
var netcheck = new ActiveXObject("SdcUser.SdcNetCheck");
var ipaddress = "";
var tempip;
var validIP = new Array();
for (var ndx=0; ndx<198; ndx++) {
tempip = "192.168.2." + (2 + ndx).toString();
validIP[ndx] = tempip;
}
netcheck.GetAdaptersInfo(""); // poll computer for the adapter configuration
var count = netcheck.GetCount(); // total adapters (including dialup);
//for all of those adapters that are FOUND in this way, we can assume they are correctly bound to TCPIP.
netcheck.MoveFirst();
var i;
for (i=0; i < count; i++) {
var thisservicename = netcheck.GetAttribute("AdapterInfo", "ServiceName");
if (!thisservicename) { thisservicename = i; }
ipaddress = netcheck.GetAttribute("AdapterInfo","IPAddress");
ipgDebug(9,"found IP address "+ipaddress);
for (var ndx=0; ndx<validIP.length; ndx++) { // Loop through valid IP addresses to find match
if ( validIP[ndx]==ipaddress) {
netcheck = null;
return true;
}
}
netcheck.MoveNext();
}
netcheck=null;
return false;
}
//*******************************************************************
// Name: ipgModemInstallDrivers
// Purpose: Install the drivers for the ST570 official wireless cards
// Note that the 570 does not need drivers, but the WLAN
// cards do
// Parameter: (none)
// Return: No explicit return but will flow to the correct page
//***********************************************************************
function ipgModemInstallDrivers() {
if (ipgModemAlreadyInstalled()) {
//logging
ssSetReg('AlreadyInstall', 1);
ssGoNextStep();
return false;
}
//logging
ssSetReg('AlreadyInstall', 0);
document.all.status2.style.display = "block";
//LDV 22 Nov - according to Erik ST121 does also a reboot
//if ( ssGetReg("WLanModel") == "108" )
//{
//Prepare for reboot
ssSetInstallRestart();
ssSetReg("CurrentStep",ssGetNameIndex("WLANplug.htm"));
//}
// -- run modem installation silent and hidden
window.external.RunCommand("bin\\sleep 2", BCONT_RUNCMD_HIDDEN);
ipgRunModemInstall( BCONT_RUNCMD_HIDDEN, "exec_" + ssGetReg("WLanModel"));
window.external.RunCommand("bin\\sleep 35", BCONT_RUNCMD_HIDDEN); // margin of safety (CD-ROM spool-up)
window.external.RunCommand("bin\\ipgWaitUntil /a setup.exe /t 180 /r autoprov ",BCONT_RUNCMD_HIDDEN);
var sOS = ssGetOS(); var sOS16bit = "95 98 me ";
if (sOS16bit.indexOf(sOS+" ")%3==0) { // reboot for 16 bit os systems
try {
var oChecker = new ActiveXObject("BContHelper.Services");
var nResult = oChecker.isFileAvailable(ssGetRootPath()+"startup.ini");
while (nResult != 0) {
alert(ipgXLate("putcdback"));
window.external.RunCommand("bin\\sleep 20", BCONT_RUNCMD_HIDDEN);
nResult = oChecker.isFileAvailable(ssGetRootPath()+"startup.ini");
}
oChecker = null;
} catch(e) { ipgDebug(1,"IPBCD:installCD "+e.description); }
ssSetInstallRestart();
ssSetReg("CurrentStep",ssGetNameIndex("WLanplug.htm"));
window.alert(ipgXLate("boot"));
window.external.Reboot();
//---------------------------------------- Loop until reboot
for (var i=0; i<1000; i++)
window.external.RunCommand("bin\\sleep 10", BCONT_RUNCMD_HIDDEN);
alert("system zal nu herstarten"); // should never get here
return;
}
// check if the package seems to be installed...
if (ssGetReg("setup.exe")!="Y" || !ipgModemAlreadyInstalled())
{
//logging
ssSetReg('Fail_drivers', 1);
ipgDebug(1,"experia:Driver installation failed (-s) ");
ssSetFlag("flagReturnDriver",false);
ssGoStep( ssGetNameIndex("er0.htm") );
return false;
}
else
{
//logging
ssSetReg('Fail_drivers', 0);
}
window.external.RunCommand("bin\\sleep 2", BCONT_RUNCMD_HIDDEN);
var stepFwd = ssGetPageIndex() + 2;
ssGoStep( stepFwd );
return true;
}
//********************************************************************************************
// Name: ipgRunModemInstall(Options)
// Purpose: run the modem install program
// Parameter: Run options, modem key
// Return: (none)
//*******************************************************************************************
function ipgRunModemInstall(options, key) {
// --- build path for main installation
//alert("OS is "+ssGetOS());
var runFull = ssGetRootPath() + "extra" + ipgGetDriverValue(gModemDOM,ssGetOS(),key);
var dir = runFull.substring(0,runFull.lastIndexOf("\\"));
var prog = runFull.substr(runFull.lastIndexOf("\\")+1);
var lang = ipgGetLangRegValue().toLowerCase();
// --- run setup ---
window.external.RunCommand(dir + "\\" + prog, BCONT_RUNCMD_ASYNC);
ssSetReg("DriverReboot","YES");
}
//***********************************************************************
// Name: ipgModemAlreadyInstalled
// Purpose: Determine if the driver is already installed
// Parameter: (none)
// Return: true if installed, else false
//***********************************************************************
function ipgModemAlreadyInstalled() {
var Package = ipgModemAttribute(gModemDOM,"packagename_" + ssGetReg("WLanModel"));
if (Package.length > 0) {
var sKey = ipgGetPackageInstalledKey(Package);
return (sKey != "");
}
return false; // if no package, we assume it is not installed
}
Das wel vaag geen modem admin gb en pass.
Maar kpn@user staat er wel in
Gr bernt.