June 24, 200719 yr Please try this on multiple drives and networks. It automatically trims the path down so no need for editing them!!!
June 27, 200719 yr 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%)??
June 27, 200719 yr @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%"; }
June 28, 200719 yr @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, 200719 yr by sp00f
June 28, 200719 yr 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?
June 30, 200719 yr 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, 200719 yr by sp00f
June 30, 200719 yr Thanks Kel,This works perfect for me using internal/external HD. Have not tried yet using NAS.
June 30, 200719 yr @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!
July 30, 200719 yr @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
July 30, 200719 yr 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!
July 31, 200719 yr 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, 200719 yr by sp00f
August 2, 200719 yr 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).
Create an account or sign in to comment