Jump to content

WPI 5,3 js.generate error ( same since 5,1 )


Recommended Posts

Hi wixfigura,

I had exactly the same error since wpi 5.1.

Make sure you have the file '$winnt$.inf' in your system32 folder in windows.

That was the problem I had because after an unattended install of windows

i always deleted some files automatically included that file.

It also didn't work with a standalone cd or dvd of WPI.

When I putted back that '$winnt$.inf' file everything worked normal.

Maybe this could help you? :}

Link to comment
Share on other sites


Yeah - thats it!!! Now it works! I havent found that $winnt$.inf so Ive made an empty one. Whats that file for, if it works with nothing inside? And what does WPI do with a file that needs nothing inside? Ive searched inside the WPIscript Files and installer - file, but nothing to find. ????

Link to comment
Share on other sites

Yeah - thats it!!! Now it works! I havent found that $winnt$.inf so Ive made an empty one. Whats that file for, if it works with nothing inside? And what does WPI do with a file that needs nothing inside? Ive searched inside the WPIscript Files and installer - file, but nothing to find. ????

Well glad for you it works now, it took me some time to figure it out why WPI 5.1 to 5.3 didn't work on my machine. Simply because of that file I was missing. Accordingly to line 120 in generate.js that file is indeed needed. This wasn't so in older versions of WPI (before 5.1).

Greetz :yes:

Link to comment
Share on other sites

Hey guys, I'm saying since 2 weeks that the problem is lying there... :rolleyes:

@wixfigura: Would you have replied to my questions that it would have been fixed in 5.3...

This $winnt$.inf file is written by windows setup with the variables used during installation (most of them are coming from winnt.sif).

In there, the dospath variable records the location of the source of the windows files actually used during installation.

The code added in 5.1 was a new feature allowing the use of that location as a variable in WPI.

Compared to the %CDROM% variable, it has the big advantage to exist whatever the type of install is (CD-based, HDD-based, network installation, local source, etc.), and doesn't require the use of the marker files such as wpi.hta, win51 or drivers.cab.

@wixfigura: DJPro deleted the file. what about you? How come you don't have it? nLite?

Use the fix below to keep going without minding for that file (it will skip the variable if the file is not found):

* New ReplacePath() function in generate.js:

function ReplacePath(v)
{
position="generate.js";
whatfunc="ReplacePath()";

var i;
var rs = new String();

cddrv = FindCDRom();
sysdir = WshEnv("WINDIR") + "\\system32";

var dospath = new String();
//Exact location from which windows was installed (works with CD-based install & winnt(32).exe based install)
if (FileExists(sysdir + "\\$winnt$.inf"))
{
var winntinf=fso.OpenTextFile(sysdir + "\\$winnt$.inf", 1);
// It's recorded in the 'dospath' directive of the [data] section of \system32\$winnt$.inf.
var matches = winntinf.ReadAll().match(/\ndospath=(.*)/i);
winntinf.Close();
if (matches)
{
dospath=matches[1];
if (dospath.substring(dospath.length - 2, dospath.length - 1)=="\\") //dospath may have a trailing slash ... or not (depending on the location)
dospath = dospath.substring(0, dospath.length - 2); // So let's remove it if it's there
}
}

rs = v;
//Replace WPI's special environment variables
rs = rs.replace(/%wpipath%/gi,wpipath);
// same as before
rs = rs.replace(/%cdrom%/gi, cddrv);
// same as before
rs = rs.replace(/%sysdir%/gi, sysdir);
rs = rs.replace(/%dospath%/gi, dospath);
//Replace other (standard) environment variables (either global or defined in the process calling WPI)
var envarname, envvars = rs.match(/%[^ %\f\n\r\t\v]+%/gi);
// find ALL substrings enclosed in '%' and not containing '%' itself or a white space character
if (envvars)
// if any match
{
for(i=0; i<envvars.length; i++)
// loop on the matches
{
envarname=envvars[i].substring(1, envvars[i].length - 1);
// strip the match from its enclosing '%'
rs = rs.replace(envvars[i],WshEnv(envarname));
// replace it by the corresponding environment variable
}
}

return rs;
}

Edited by Djé
Link to comment
Share on other sites

Ok, problem solved and updated.

The default line for gcond[] was there before I took over the programming. There is no real reason for it to be there, just to save a little typing. I will update the code to not save it in the config.js file if not used. The guy that added the gcond put that code in there.

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...