Kelsenellenelvian Posted June 24, 2007 Posted June 24, 2007 Please try this on multiple drives and networks. It automatically trims the path down so no need for editing them!!!
sp00f Posted June 27, 2007 Posted June 27, 2007 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%)??
Kelsenellenelvian Posted June 27, 2007 Author Posted June 27, 2007 The same way you did before maybe???
lawrenca Posted June 27, 2007 Posted June 27, 2007 @sp00fWorks 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%"; }
sp00f Posted June 28, 2007 Posted June 28, 2007 (edited) @sp00fWorks 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 But doesnt work Edited June 28, 2007 by sp00f
lawrenca Posted June 28, 2007 Posted June 28, 2007 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?
sp00f Posted June 30, 2007 Posted June 30, 2007 (edited) 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 ExtractionAnd how do i change this? Edited June 30, 2007 by sp00f
mr_smartepants Posted June 30, 2007 Posted June 30, 2007 Thanks Kel,This works perfect for me using internal/external HD. Have not tried yet using NAS.
lawrenca Posted June 30, 2007 Posted June 30, 2007 @sp00fDidn'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 functionIf 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 functionThat should do it!
sp00f Posted July 30, 2007 Posted July 30, 2007 @sp00fDidn'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 functionIf 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 functionThat should do it!Doesnt work for me
lawrenca Posted July 30, 2007 Posted July 30, 2007 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!
sp00f Posted July 31, 2007 Posted July 31, 2007 (edited) 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 July 31, 2007 by sp00f
lawrenca Posted August 2, 2007 Posted August 2, 2007 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).
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now