Jump to content

For testing!


Recommended Posts


Please try this on multiple drives and networks. It automatically trims the path down so no need for editing them!!!

Works fine, but how can i cange the %wpipath% into my own path (%AppsRoot%)??

Link to comment
Share on other sites

@sp00f

Works fine, but how can i cange the %wpipath% into my own path (%AppsRoot%)??

You could use %root% instead of %AppsRoot% or you can change the code in configwizard.js at line 824 and 827 to reflect your new name.

	else if (str.indexOf(root) != -1)
{
trimpath=root;
trimpathvar="%root%";
}

Link to comment
Share on other sites

@sp00f
Works fine, but how can i cange the %wpipath% into my own path (%AppsRoot%)??

You could use %root% instead of %AppsRoot% or you can change the code in configwizard.js at line 824 and 827 to reflect your new name.

	else if (str.indexOf(root) != -1)
{
trimpath=root;
trimpathvar="%root%";
}

thx :hello:

But doesnt work

Edited by sp00f
Link to comment
Share on other sites

Did you ever have %AppsRoot% working in previous versions? You probably would have defined that variable and used it within the "ReplacePath" function in core.js. How did you define that variable?

yes i always use %AppsRoot%

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

var i, rs = new String(v);

rs = rs.replace(/%wpipath%/gi, wpipath); // Replace WPI's special environment variables
rs = rs.replace(/%root%/gi, root); // WPI parent folder

if (hdd=="")
rs = rs.replace(/%cdrom%/gi, cddrv); // started from cdrom
else
rs = rs.replace(/%cdrom%/gi, hdd); // not started from cdrom

rs = rs.replace(/%sysdir%/gi, sysdir); // same as before
rs = rs.replace(/%dospath%/gi, dospath); // new variable
rs = rs.replace(/%oslang%/gi, oslang); // operating system language code
rs = rs.replace(/%reboot% /gi, 'shutdown.exe -r -f -t '); // force a reboot after X seconds
rs = rs.replace(/%reboot%/gi, 'shutdown.exe -r -f -t 0'); // force a reboot now
rs = rs.replace(/%sleep%/gi, wpipath+"\\Tools\\Sleep.exe"); // Pause for x seconds

rs = rs.replace(/%extract%/gi, '"'+wpipath+"\\WPIScripts\\ExtractToPath.vbs"+'"'); // Archive Extraction

And how do i change this?

Edited by sp00f
Link to comment
Share on other sites

@sp00f

Didn't see where %AppsRoot% was defined for you but, In the ConfigWizard.js code for trimming paths, place AppsRoot at the top of the list so the function doesn't resolve to one of the other variables before it gets to yours...it will resolve to the first condition met in the switch statement.

Example:

	if (str.indexOf(root) != -1)
{
trimpath=AppsRoot;
trimpathvar="%AppsRoot%";
}
else if (str.indexOf(wpipath) != -1)
{
trimpath=wpipath;
trimpathvar="%wpipath%"; //Could have used %cdrom%
}
...the rest of the function

If still no luck, go back and check that the AppsRoot variable is defined as something. I'll try to walk through the steps if I were going to create a new variable...

In Globals.js, define the variable - I've added this to line 105

	var AppsRoot = new String();

In Core.js, resolve and set AppsRoot to the path you would like (lines 19 and 20), I've used the Install Path for this example:

	// %AppsRoot%
AppsRoot = wpipath+"\\Install";

In Core.js, set up variable for ReplacePath (line 334):

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

var i, rs = new String(v);

rs = rs.replace(/%wpipath%/gi, wpipath); // Replace WPI's special environment variables
rs = rs.replace(/%root%/gi, root); // WPI parent folder
rs = rs.replace(/%AppsRoot%/gi, AppsRoot);
...the rest of the function

That should do it!

Link to comment
Share on other sites

  • 5 weeks later...
@sp00f

Didn't see where %AppsRoot% was defined for you but, In the ConfigWizard.js code for trimming paths, place AppsRoot at the top of the list so the function doesn't resolve to one of the other variables before it gets to yours...it will resolve to the first condition met in the switch statement.

Example:

	if (str.indexOf(root) != -1)
{
trimpath=AppsRoot;
trimpathvar="%AppsRoot%";
}
else if (str.indexOf(wpipath) != -1)
{
trimpath=wpipath;
trimpathvar="%wpipath%"; //Could have used %cdrom%
}
...the rest of the function

If still no luck, go back and check that the AppsRoot variable is defined as something. I'll try to walk through the steps if I were going to create a new variable...

In Globals.js, define the variable - I've added this to line 105

	var AppsRoot = new String();

In Core.js, resolve and set AppsRoot to the path you would like (lines 19 and 20), I've used the Install Path for this example:

	// %AppsRoot%
AppsRoot = wpipath+"\\Install";

In Core.js, set up variable for ReplacePath (line 334):

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

var i, rs = new String(v);

rs = rs.replace(/%wpipath%/gi, wpipath); // Replace WPI's special environment variables
rs = rs.replace(/%root%/gi, root); // WPI parent folder
rs = rs.replace(/%AppsRoot%/gi, AppsRoot);
...the rest of the function

That should do it!

Doesnt work for me :(

Link to comment
Share on other sites

sp00f,

Any chance of showing us how you were defining %AppsRoot% previously and what your folder structure is? May help in trying to figure out why it's not working for you.

BTW: Thanks Kel for adding the code to WPI v6.1! Once again, another great release of WPI!

Link to comment
Share on other sites

I use WPI in Vista, and to run it i have this in my autounattend.xml, in 4.Specialize, RunSynchronous:

cmd /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\AppsRoot.txt SETX AppsRoot %i:\ -m"

AppsRoot.txt is in the root of the dvd.

So my paths look like this (Example) :

%AppsRoot%\Install\WPI\install\oemlogo\INTELcore2OEM.exe

Edited by sp00f
Link to comment
Share on other sites

sp00f,

How is that variable being exposed to WPI...I don't think it can the way you are implementing it. You'll have to read it into WPI even if you make it an environment variable (look in core.js:function=ReplacePath for samples of creating your own variables and globals.js for reading in environment variables).

Link to comment
Share on other sites

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...