Help - Search - Members - Calendar
Full Version: Bug in determining %ROOT%?
MSFN Forums > Member Contributed Projects > Windows Post-Install Wizard (WPI)

   
Google Internet Forums Unattended CD/DVD Guide
AlBundy33
In core.js defaultWPI() you get the ROOT with
CODE
    // %root%
    root=fso.GetParentFolderName(wpipath);
    if (root.indexOf(":")==1)
        root=root.substr(0,2);

But ROOT should be used to get the WPI-parentfolder.
My folder-structure looks like this
CODE
Drive:\any\directory
  - WPI (only with contents from the download-package)
  - Tools (my additional Tools)
  - Applications
     - Common
     - Multimedia
     - Microsoft
     - ...

And my commands look like this:
CODE
%ROOT%\Applications\Multimedia\...


But with the Bug above my commands does not work. :-(
Only with
CODE
root=fso.GetParentFolderName(wpipath);

all works fine.

Al
mritter
You are correct. The person that originally brought it to my attention (number of backslashes needed), and myself, have WPI only 1 folder deep, so the code for us is correct. Change it to this:

CODE
    // %root%
    root=fso.GetParentFolderName(wpipath);
    if (root.substr(root.length-1,1)=="\\")
        root=root.substr(0,root.length-1);


Will be updated in dowload package, as well.
AlBundy33
Thanks - this works for me.

Btw: How do you debug your code?
To find out what was wrong I used a lot of alerts. :-/

Al
mritter
The more I thought about, the more I remembered why I did it the original way.

To me, root means the very beginning, as in C: or D:, no matter how deeply buried WPI is.

Parent would mean one folder up from the starting place.

Lawrenca came up with the original code, and like me, we are just one folder deep, so it worked for us. That is just how we envisioned a "standard" dvd to be laid out:

D:
---I386
---Install
------Tools
------Utilities
------etc.
---WPI
------Install (could be here also)


Not like this:

D:
---I386
------Software
---------WPI
---------Apps
---------Utilitiies


But, too each his own. Nothing is written in stone.
gbmacman
This is also applicable when running from a network share. I also think of root as C:\, Y:\. I would prefer the variable be named WPIROOT to eliminate any confusion. I like that you grouped it in 7.2.
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.