Help - Search - Members - Calendar
Full Version: WPI problem by installation
MSFN Forums > Member Contributed Projects > Windows Post-Install Wizard (WPI) > Bug tracker

   
Google Internet Forums Unattended CD/DVD Guide
Paladin Dante
Hallo,

da mein Engllisch leider nicht so atemberaubend ist hoffe ich das ihr mir auch in deutsch weiterhelfen könnt.

Ich habe mir mit WPI 5.1 lokal auf meinem Rechner eine DVD zusammengestellt und sie anschließend komplett auf einen DVD-RW Rohling gebrannt. Wenn ich nun die WPI.hta starte und ich dann ein Programm davon installieren möchte bekomme ich folgende Fehlermeldung:


JavaScript Error Report

Message: 'InstallWindow.documen:.getElementById(...)' ist Null oder kein Objekt
Url: File:///U:/WPI.hta
File: core.js
Function: Pause()
Line: 34




meine core.js

CODE
function WPIPath()
{
    position="core.js";
    whatfunc="WPIPath()";

    var p = new String(); p="";

    p = unescape(document.location);
    p = p.substring(0,p.lastIndexOf("/")) + "/";
    p = p.replace("file:///","").replace(/\//g,"\\");

    return p;
}


function getText(par)
{
    position="core.js";
    whatfunc="getText()";

    if (par[Language])
        return par[Language];

    return par['en'];
}

>>>>DAS WÄRE ZEILE 34<<<<
function FileExists(filespec)
{
    position="core.js";
    whatfunc="FileExists()";

    return fso.FileExists(filespec);
}


function Pause(secs,milli)
{
    position="core.js";
    whatfunc="Pause()";

    var SleepShell = new ActiveXObject("WScript.Shell");
    var duration, sleepCmd;

    duration="-m " + ((secs*1000)+milli);
    sleepCmd=wpipath+"Tools\\Sleep.exe";
    SleepShell.Run('"'+sleepCmd+'" '+duration,0,true);

// If you have any issues with security prompts on Server 2003, use this line
//    SleepShell.Run('cmd /c "'+sleepCmd+'" '+duration,0,true);
}



Ich hoffe mir kann dabei jemand von euch weiterhelfen, da ich keine Lösung für das Problem gefunden habe.


Gruß
Paladin Dante
Dynaletik
Hast Du schon WPI 5.2 probiert, inklusive der Fixes, die im gepinnten Bug Thread gepostet sind? Wenn Du das einmal testen könntest wäre das super. Ich denke, dass der Fehler in WPI 5.3 gefixt sein wird, Du kannst also auch ein paar Tage warten.
Paladin Dante
Hallo Dynaletik,

nein das habe ich noch nicht ausprobiert, aber ich werde es jetzt gleich nachholen und mich dann nochmal melden.


Danke für den Hinweis.


Gruß
Paladin Dante
Paladin Dante
So, nachdem ich mir WPI 5.2 und die Releases dazu gedownloadet habe, habe ich meine Installationsdatei, die config.js und die useroptions.js übernommen. Anschließend habe ich dann WPI (WPI.hta) gestartet und folgende fehlermeldung erhalten:

In den Script auf dieser Seite ist ein Fehler aufgetreten.
Zeile: 43
Zeichen: 3
Fehler: 'undefined' ist Null oder kein Objekt
Code: 0
URL: file:///U:/WPI.hta



meine WPI.hta:

CODE
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Windows Post-Install Wizard</title>
<meta HTTP-EQUIV="MSThemeCompatible" content="yes">
<HTA:APPLICATION ID="oWPI"
application="yes"
applicationName="Windows Post-Install Wizard"
border="none"
borderStyle="normal"
caption="yes"
contextMenu="yes"
icon="./wpi.ico"
innerBorder="no"
maximizeButton="yes"
minimizeButton="yes"
navigable="yes"
scroll="no"
scrollFlat="no"
selection="no"
showInTaskBar="yes"
singleInstance="yes"
sysMenu="yes"
version="5.0"
windowState="maximize" />

<script type="text/javascript" src="./WPIScripts/globals.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/core.js" application="yes">
</script>

<script type="text/javascript">
wpipath=WPIPath();

WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\CheckExeSignatures","no");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\Download\\RunInvalidSignatures","dword:00000001");
WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Associations\\LowRiskFileTypes",".js;.zip;.rar;.nfo;.txt;.exe;.bat;.com;.cmd;.reg;.msi;.hta;.htm;.html;.gif;.bmp;.jpg;.avi;.mpg;
.mpeg;.mov;.mp3;.m3u;.wav;");
</script>

<script type="text/javascript">
var fullpath, regexpSearch, argLine, WPIcmdArgs;

fullpath = new String(unescape(document.location));
fullpath = fullpath.replace("file://","").replace(/\//g,"\\\\");
regexpSearch = new RegExp('^"'+fullpath+'"',"i");
argLine = new String(oWPI.commandLine.replace(regexpSearch,''));

if (argLine)
{
var std = '\\S+|".+"'; //standard argument w/o Whitespace, or quoted (optionally prefixed)
var num = '\\d+'; //numeric argument
var Quoted = '"([a-z]:|\\.{1,2})(\\\\[^"*/:<>?\\\\|]+)+\\.js"'; //path to .js file, quoted
var NoWSpc = '([a-z]:|\\.{1,2})(\\\\[^ "*/:<>?\\\\|]+)+\\.js'; //path to .js file, no Whitespace
var optionsPattern = 'options=('+NoWSpc+'|'+Quoted+'|[^ "*/:<>?\\\\|]+\\.js)';
var configPattern = 'config=('+NoWSpc+'|'+Quoted+'|[^ "*/:<>?\\\\|]+\\.js)';
var checkOLPattern = 'check=('+std+')';
var timerPattern = 'timer=('+num+')';
cmdLinePattern = '^( +('+optionsPattern+'|'+configPattern+'|'+checkOLPattern+'|'+timerPattern+'|('+num+')|('+std+')))*$'; //any combination of the above, with spaces inbetween
regexpSearch = new RegExp(cmdLinePattern,"i");
WPIcmdArgs = argLine.match(regexpSearch);
if (WPIcmdArgs && WPIcmdArgs[3]) //We've got a match on a config .js file (if > 1 match, only the last one is recorded)
{
optionsFile = WPIcmdArgs[3];
if (optionsFile.substr(0, 1) == '"') //remove quotes if any
optionsFile = optionsFile.substring(1, optionsFile.length - 1);
if (optionsFile.indexOf('\\') == -1) //no path -> in WPIScripts
optionsFile=".\\WPIScripts\\"+optionsFile;
if (!FileExists(optionsFile)) //Is it valid?
optionsFile = '';
}
if (WPIcmdArgs && WPIcmdArgs[8]) //We've got a match on an option .js file (if > 1 match, only the last one is recorded)
{
configFile = WPIcmdArgs[8];
if (configFile.substr(0, 1) == '"') //remove quotes if any
configFile = configFile.substring(1, configFile.length - 1);
if (configFile.indexOf('\\') == -1) //no path -> in WPIScripts
configFile=".\\WPIScripts\\"+configFile;
if (!FileExists(configFile)) //Is it valid?
configFile = '';
}
if (WPIcmdArgs && WPIcmdArgs[13]) //We've got a match on a check on load option
{
checkOL = WPIcmdArgs[13];
if (checkOL.substr(0, 1) == '"') //remove quotes if any
checkOL = checkOL.substring(1, checkOL.length - 1);
}
if (WPIcmdArgs && WPIcmdArgs[14] && WPIcmdArgs[14] <= 3600) //We've got a match on a timer seconds option
{
timerSecs = WPIcmdArgs[14];
}
// For backwards compatibilty only. Will be removed in the future.
if (WPIcmdArgs && WPIcmdArgs[15] && WPIcmdArgs[15] <= 3600) //We've got a match on a number. This is for the timer.
{
timerSecs = WPIcmdArgs[15];
}
if (WPIcmdArgs && WPIcmdArgs[16]) //We've got a match on a generic argument. Give it to CheckOnLoad.
checkOL = WPIcmdArgs[16];
}

if (!FileExists(optionsFile)) //No argument or invalid file
{
try //have a look in the registry
{
optionsFile=WshShell.RegRead("HKEY_CURRENT_USER\\Software\\WPI\\OptionsFile");
}
catch(ex) //nothing up there
{; }
if (!FileExists(optionsFile)) //No reg key or invalid file
optionsFile = optionsDefault; //... so let's take the default location
}
else
optionsFile = optionsFile.replace(/\\/g, '/');

if (!FileExists(configFile)) //Same goes for the config file
{
try
{
configFile=WshShell.RegRead("HKEY_CURRENT_USER\\Software\\WPI\\ConfigFile");
}
catch(ex)
{; }
if (!FileExists(configFile))
configFile = configDefault;
}
else
configFile = configFile.replace(/\\/g, '/');
</script>

<script type="text/javascript">
var line=new String();
var num=1;

if (FileExists(optionsFile))
{
try
{
tf = fso.OpenTextFile(optionsFile, 1);
while (num==1 && !tf.AtEndOfStream)
{
line = tf.ReadLine();
if (line != "// WPI Options 5.0+")
{
alert("This 'useroptions.js' file is not a v5.0 compatible file.\n\nDelete the file and start WPI again.");
ExitWPI();
}
num++;
}
}
catch(ex)
{; }
finally
{
tf.Close();
}
}
</script>
<script type="text/javascript">
document.write('<script type="text/javascript" src="'+optionsFile+'" application="yes">');
</script>
</script> <!-- Yes, two closing tags -->

<script type="text/javascript">
var args="";

if (MonitorResolution != 0 || MonitorDepth != 0 || MonitorRefresh != 0)
{
strFile=wpipath+"Tools\\ResChange.exe";
if (FileExists(strFile))
{
if (MonitorResolution != 0)
{
switch(MonitorResolution)
{
case 800:
args += "-width=800 -height=600 ";
break;

case 1024:
args += "-width=1024 -height=768 ";
break;

case 1280:
args += "-width=1280 -height=1024 ";
break;

case 1600:
args += "-width=1600 -height=1200 ";
break;
}
}
if (MonitorDepth != 0)
{
args += "-depth=";
if (MonitorDepth==999)
{
args += "max ";
}
else
{
args += MonitorDepth+" ";
}
}
if (MonitorRefresh != 0)
{
args += "-refresh=";
if (MonitorRefresh==999)
{
args += "max";
}
else
{
args += MonitorRefresh;
}
}
args += " -quiet -force";
WshShell.Run('"'+strFile+'" '+args,0,true);
}
else
{
alert("'Tools\\ResChange.exe' does not exist.");
ExitWPI();
}
}

if (InstallFonts)
{
strFile=wpipath+"Tools\\Fonts\\FontInstaller.exe";
if (FileExists(strFile))
{
WshShell.Run('"'+strFile+'"',0,true);
}
else
{
alert("'Tools\\Fonts\\FontInstaller.exe' does not exist.");
ExitWPI();
}
}
</script>

<script type="text/javascript">
document.write('<script type="text/javascript" src="'+configFile+'" application="yes">');
</script>
</script> <!-- Yes, two closing tags -->

<script type="text/javascript" src="./Lang/lang_en.js" application="yes">
</script>
<script type="text/javascript">
if (!FileExists(wpipath+"Lang\\lang_"+Language+".js"))
{
Language="en";
}
if (Language != 'en')
{
document.write('<script type="text/javascript" src="./Lang/lang_'+Language+'.js" application="yes">');
}
</script>
</script> <!-- Yes, two closing tags -->

<script type="text/javascript">
if (checkOL)
CheckOnLoad=checkOL;

if (timerSecs)
{
alert("HEre");
Timer=true;
Seconds=timerSecs;
}
</script>

<script type="text/javascript" src="./WPIScripts/main.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/tips.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/api.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/program.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/optionswizard.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/configwizard.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/generate.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/installer.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/installer_log.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/boxes.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/check.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/timers.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/selecthandler.js" application="yes">
</script>
<script type="text/javascript" src="./WPIScripts/patchFile.js" application="yes">
</script>

<script type="text/javascript">
window.onerror = handleErrors; // or null to suppress error message

function handleErrors(msg, url, line)
{
var errorString = "JavaScript Error Report\n\n";

errorString += " Message: "+msg+"\n";
errorString += " Url: "+url+"\n";
errorString += " File: "+position+"\n";
errorString += "Function: "+whatfunc+"\n";
errorString += " Line: "+(line-1);
alert(errorString);

return true;
}
</script>

<script type="text/javascript">
main();

if (!LoadThemedContent())
ExitWPI();
</script>

</head>
</html>



Nach dem Bestätigen des Fehlers startet WPI das Interface ganz normal und es lassen sich dich Programme installieren.


Gruß
Paladin Dante

EDIT: changed to codebox - tain
Kelsenellenelvian
I don't understand german at all but I think this is what you want...

In wpi.hta line 43 replace

CODE
fullpath = fullpath.replace("file://","").replace(/\//g,"\\\\");


with
CODE
fullpath = fullpath.replace("file:///","").replace(/\//g,"\\ <file:///> ");
Pliek
QUOTE (Kelsenellenelvian @ Aug 3 2006, 04:14 PM) *
I don't understand german at all but I think this is what you want...

In wpi.hta line 43 replace

CODE
fullpath = fullpath.replace("file://","").replace(/\//g,"\\\\");


with
CODE
fullpath = fullpath.replace("file:///","").replace(/\//g,"\\ <file:///> ");

So why is this fix not official, and set in your topic first message "Fixes and adjustments so far:" ?? confused.gif
Kelsenellenelvian
Because this fix breaks the command line arguments.
Paladin Dante
Hi Kelsenellenelvian,

I have the line 43 replaced, but no effect -- the same error! sad.gif


Have you an other idea?
Pliek
QUOTE (Paladin Dante @ Aug 4 2006, 08:45 AM) *
Hi Kelsenellenelvian,

I have the line 43 replaced, but no effect -- the same error! sad.gif


Have you an other idea?


Yes add fix 1,2,3,4. thumbup.gif
Paladin Dante
Yeah, that was it.

Thank you my hero "Pliek" smile.gif
Pliek
LOL. whistling.gif
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.