home *** CD-ROM | disk | FTP | other *** search
- //
- // Date Last Modified: Tuesday June 26th, 2007
- //
- // Modified By: Kelsenellenelvian
- //
-
-
- function CreateNavigation()
- {
- position="configwizard.js";
- whatfunc="CreateNavigation()";
-
- if (SortWithinCats)
- configList.sort(byName);
-
- var txt="";
- txt='<table border="0">';
- for (var i=0; i<configList.length && configList[i] != null; i++)
- {
- txt += '<tr>';
- txt += '<td class="opTxt" align="right" valign="top">'+ configList[i].ordr + ' </td>';
- txt += '<td valign="top"><a class="opTxt" onClick="JumpToEntry(' + i + ')">' + configList[i].prog + '</a></td>';
- txt += '</tr>';
- }
- txt += '</table>';
-
- document.getElementById("quickref").innerHTML=txt;
- }
-
-
- function CreateControls()
- {
- position="configwizard.js";
- whatfunc="CreateControls()";
-
- var txt=new String(); txt="";
-
- strFile=wpipath + "\\Common\\configwizardtemplate.htm";
- if (!FileExists(strFile))
- {
- alert(getText(errCouldNotOpenFile)+" '"+strFile+"'.");
- ExitWPI();
- }
- try
- {
- tf=fso.OpenTextFile(strFile, 1);
- while (!tf.AtEndOfStream)
- txt=tf.ReadAll();
- }
- catch (ex)
- { ; }
- finally
- {
- tf.Close();
- }
- document.getElementById("layerconfig").innerHTML=txt;
-
- LocalizeConfigButtonsTexts();
- }
-
-
- function LocalizeConfigButtonsTexts()
- {
- position="configwizard.js";
- whatfunc="LocalizeConfigButtonsTexts()";
-
- document.getElementById("lblNavigation").innerHTML=getText(lblNavigation);
-
- document.getElementById("configFirst").value=getText(btnFirst);
- document.getElementById("configPrevious").value=getText(btnPrevious);
- document.getElementById("configNext").value=getText(btnNext);
- document.getElementById("configLast").value=getText(btnLast);
- document.getElementById("configAdd").value=getText(btnAdd);
- document.getElementById("configClone").value=getText(btnClone);
- document.getElementById("configDelete").value=getText(btnDelete);
-
- document.getElementById("configNewConfig").value=getText(btnNewConfig);
- document.getElementById("configRead").value=getText(btnRead);
- document.getElementById("configSave").value=getText(btnSave);
- document.getElementById("configSaveAs").value=getText(btnSaveAs);
- document.getElementById("configExit").value=getText(btnExit);
- }
-
-
- function LocalizeConfigTexts()
- {
- position="configwizard.js";
- whatfunc="LocalizeConfigTexts()";
-
- document.getElementById("lblName").innerHTML=getText(lblName);
- document.getElementById("lblInstallOrder").innerHTML=getText(lblInstallOrder);
- document.getElementById("lblDescription").innerHTML=getText(lblDescription);
- document.getElementById("lblUniqueID").innerHTML=getText(lblUniqueID);
- document.getElementById("lblDefault").innerHTML=getText(lblDefault);
- document.getElementById("lblCategory").innerHTML=getText(lblCategory);
- document.getElementById("lblForced").innerHTML=getText(lblForced);
- document.getElementById("lblConfigurations").innerHTML=getText(lblConfigurations);
- document.getElementById("lblDependentOf").innerHTML=getText(lblDependentOf);
- document.getElementById("lblExcludes").innerHTML=getText(lblExcludes);
- document.getElementById("lblCondition").innerHTML=getText(lblCondition);
- document.getElementById("lblGrayedCondition").innerHTML=getText(lblGrayedCondition);
- document.getElementById("lblRegistryBefore").innerHTML=getText(lblRegistryBefore);
- document.getElementById("lblCommand1").innerHTML=getText(lblCommand1);
- document.getElementById("lblCommand2").innerHTML=getText(lblCommand2);
- document.getElementById("lblCommand3").innerHTML=getText(lblCommand3);
- document.getElementById("lblCommand4").innerHTML=getText(lblCommand4);
- document.getElementById("lblCommand5").innerHTML=getText(lblCommand5);
- document.getElementById("lblCommand6").innerHTML=getText(lblCommand6);
- document.getElementById("lblCommand7").innerHTML=getText(lblCommand7);
- document.getElementById("lblCommand8").innerHTML=getText(lblCommand8);
- document.getElementById("lblCommand9").innerHTML=getText(lblCommand9);
- document.getElementById("lblCommand10").innerHTML=getText(lblCommand10);
- document.getElementById("lblRegistryAfter").innerHTML=getText(lblRegistryAfter);
- document.getElementById("lblPictureFile").innerHTML=getText(lblPictureFile);
- document.getElementById("lblPictureDetails").innerHTML=getText(lblPictureDetails);
- document.getElementById("lblPictureWidth").innerHTML=getText(lblPictureWidth);
- document.getElementById("lblPictureHeight").innerHTML=getText(lblPictureHeight);
- document.getElementById("lblTextLocation").innerHTML=getText(lblTextLocation);
-
-
- document.getElementById("cbocats").options[0].text=getText(optOther);
- document.getElementById("cbocats").options[1].text=getText(optApplications);
- document.getElementById("cbocats").options[2].text=getText(optDrivers);
- document.getElementById("cbocats").options[3].text=getText(optGames);
- document.getElementById("cbocats").options[4].text=getText(optMultiMedia);
- document.getElementById("cbocats").options[5].text=getText(optOffice);
- document.getElementById("cbocats").options[6].text=getText(optRegistryTweaks);
- document.getElementById("cbocats").options[7].text=getText(optSystem);
- document.getElementById("cbocats").options[8].text=getText(optUtilities);
- var opt = cbocats.getElementsByTagName("OPTGROUP");
- opt[1].label = getText(lblUserDefined);
-
- document.getElementById("textl").options[0].text=getText(optTop);
- document.getElementById("textl").options[1].text=getText(optBottom);
- document.getElementById("textl").options[2].text=getText(optLeft);
- document.getElementById("textl").options[3].text=getText(optRight);
- }
-
-
- function FillInConfig(CreateNav,pos)
- {
- position="configwizard.js";
- whatfunc="FillInConfig()";
-
- if (CreateNav)
- CreateNavigation();
-
- document.getElementById("prog").value=configList[pos].prog;
- document.getElementById("ordr").value=configList[pos].ordr;
- document.getElementById("desc").value=configList[pos].desc;
- document.getElementById("uid").value=configList[pos].uid;
- document.getElementById("dflt").checked=configList[pos].dflt=="yes" ? 1 : 0;
- document.getElementById("cbocats").value=configList[pos].cat;
- document.getElementById("cat").value="";
- document.getElementById("cat").style.visibility='hidden';
- document.getElementById("forc").checked=configList[pos].forc=="yes" ? 1 : 0;
- document.getElementById("SelectConfigs").value="blank";
- document.getElementById("configs").value=configList[pos].configs;
- document.getElementById("deps").value=configList[pos].deps;
- document.getElementById("excl").value=configList[pos].excl;
- document.getElementById("cond").value=configList[pos].cond;
- document.getElementById("gcond").value=configList[pos].gcond;
- document.getElementById("regb").value=configList[pos].regb;
- document.getElementById("cmd1").value=configList[pos].cmd1;
- document.getElementById("cmd2").value=configList[pos].cmd2;
- document.getElementById("cmd3").value=configList[pos].cmd3;
- document.getElementById("cmd4").value=configList[pos].cmd4;
- document.getElementById("cmd5").value=configList[pos].cmd5;
- document.getElementById("cmd6").value=configList[pos].cmd6;
- document.getElementById("cmd7").value=configList[pos].cmd7;
- document.getElementById("cmd8").value=configList[pos].cmd8;
- document.getElementById("cmd9").value=configList[pos].cmd9;
- document.getElementById("cmd10").value=configList[pos].cmd10;
- document.getElementById("rega").value=configList[pos].rega;
- document.getElementById("picf").value=configList[pos].picf;
- document.getElementById("picw").value=configList[pos].picw;
- document.getElementById("pich").value=configList[pos].pich;
- document.getElementById("textl").value=configList[pos].textl;
-
- TogglePictureGadgets();
-
- FillUID(configList[pos].prog);
- }
-
-
- function CopyConfig(pos)
- {
- position="configwizard.js";
- whatfunc="CopyConfig()";
-
- configList[pos].prog=document.getElementById("prog").value;
- configList[pos].ordr=document.getElementById("ordr").value;
- configList[pos].desc=document.getElementById("desc").value;
- configList[pos].uid=document.getElementById("uid").value;
- configList[pos].dflt=document.getElementById("dflt").checked ? "yes" : "no";
- configList[pos].cat=document.getElementById("cbocats").value;
- if (configList[pos].cat=="other")
- configList[pos].cat=document.getElementById("cat").value;
- configList[pos].forc=document.getElementById("forc").checked ? "yes" : "no";
- configList[pos].configs=document.getElementById("configs").value;
- configList[pos].deps=document.getElementById("deps").value;
- configList[pos].excl=document.getElementById("excl").value;
- configList[pos].cond=document.getElementById("cond").value;
- configList[pos].gcond=document.getElementById("gcond").value;
- configList[pos].regb=document.getElementById("regb").value;
- configList[pos].cmd1=document.getElementById("cmd1").value;
- configList[pos].cmd2=document.getElementById("cmd2").value;
- configList[pos].cmd3=document.getElementById("cmd3").value;
- configList[pos].cmd4=document.getElementById("cmd4").value;
- configList[pos].cmd5=document.getElementById("cmd5").value;
- configList[pos].cmd6=document.getElementById("cmd6").value;
- configList[pos].cmd7=document.getElementById("cmd7").value;
- configList[pos].cmd8=document.getElementById("cmd8").value;
- configList[pos].cmd9=document.getElementById("cmd9").value;
- configList[pos].cmd10=document.getElementById("cmd10").value;
- configList[pos].rega=document.getElementById("rega").value;
- configList[pos].picf=document.getElementById("picf").value;
- configList[pos].picw=document.getElementById("picw").value;
- configList[pos].pich=document.getElementById("pich").value;
- configList[pos].textl=document.getElementById("textl").value;
- }
-
-
- function clearProgram(entry)
- {
- position="configwizard.js";
- whatfunc="clearProgram()";
-
- entry.prog="";
- entry.ordr="";
- entry.desc="";
- entry.uid="";
- entry.dflt="yes";
- entry.cat="Applications";
- entry.forc="no";
- entry.configs="";
- entry.deps="";
- entry.excl="";
- entry.cond="";
- entry.gcond="";
- entry.regb="";
- entry.cmd1="";
- entry.cmd2="";
- entry.cmd3="";
- entry.cmd4="";
- entry.cmd5="";
- entry.cmd6="";
- entry.cmd7="";
- entry.cmd8="";
- entry.cmd9="";
- entry.cmd10="";
- entry.rega="";
- entry.picf="";
- entry.picw="";
- entry.pich="";
- entry.textl="";
- }
-
-
- function ToggleAllGadgets(state)
- {
- position="configwizard.js";
- whatfunc="ToggleAllGadgets()";
-
- document.getElementById("prog").disabled=false;
- document.getElementById("ordr").disabled=state;
- document.getElementById("desc").disabled=state;
- document.getElementById("uid").disabled=state;
- document.getElementById("dflt").disabled=state;
- document.getElementById("cbocats").disabled=state;
- document.getElementById("cat").disabled=state;
- document.getElementById("cat").style.visibility='hidden';
- document.getElementById("forc").disabled=state;
- document.getElementById("SelectConfigs").disabled=state;
- document.getElementById("configs").disabled=state;
- document.getElementById("deps").disabled=state;
- document.getElementById("excl").disabled=state;
- document.getElementById("cond").disabled=state;
- document.getElementById("gcond").disabled=state;
- document.getElementById("regb").disabled=state;
- document.getElementById("cmd1").disabled=state;
- document.getElementById("cmd2").disabled=state;
- document.getElementById("cmd3").disabled=state;
- document.getElementById("cmd4").disabled=state;
- document.getElementById("cmd5").disabled=state;
- document.getElementById("cmd6").disabled=state;
- document.getElementById("cmd7").disabled=state;
- document.getElementById("cmd8").disabled=state;
- document.getElementById("cmd9").disabled=state;
- document.getElementById("cmd10").disabled=state;
- document.getElementById("rega").disabled=state;
- document.getElementById("picf").disabled=state;
- ToggleGenUID(state);
- ToggleFileRequesters(state);
- ToggleUSSFs(state);
- TogglePictureGadgets();
- ToggleDefaultImages(state);
- }
-
-
- function TogglePictureGadgets()
- {
- position="configwizard.js";
- whatfunc="TogglePictureGadgets()";
-
- document.getElementById("picw").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
- document.getElementById("pich").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
- document.getElementById("textl").disabled=(document.getElementById("picf").disabled || document.getElementById("picf").value=="" ? 1 : 0);
-
- if (document.getElementById("picf").value=="")
- {
- configList[cpos].picw=null;
- configList[cpos].pich=null;
- configList[cpos].textl=null;
-
- document.getElementById("picw").value=null;
- document.getElementById("pich").value=null;
- document.getElementById("textl").value=null;
- }
- else
- {
- document.getElementById("picw").value=configList[cpos].picw;
- document.getElementById("pich").value=configList[cpos].pich;
- document.getElementById("textl").value=configList[cpos].textl;
- }
- }
-
-
- function ToggleGenUID(state)
- {
- position="configwizard.js";
- whatfunc="ToggleGenUID()";
-
- if (state)
- {
- document.getElementById("GenUIDShow").style.display='none';
- document.getElementById("GenUIDHide").style.display='block';
- }
- else
- {
- document.getElementById("GenUIDShow").style.display='block';
- document.getElementById("GenUIDHide").style.display='none';
- }
- }
-
-
- function ToggleFileRequesters(state)
- {
- position="configwizard.js";
- whatfunc="ToggleFileRequesters()";
-
- if (state)
- {
- document.getElementById("regbShow").style.display='none';
- document.getElementById("regbHide").style.display='block';
- document.getElementById("cmd1Show").style.display='none';
- document.getElementById("cmd1Hide").style.display='block';
- document.getElementById("cmd2Show").style.display='none';
- document.getElementById("cmd2Hide").style.display='block';
- document.getElementById("cmd3Show").style.display='none';
- document.getElementById("cmd3Hide").style.display='block';
- document.getElementById("cmd4Show").style.display='none';
- document.getElementById("cmd4Hide").style.display='block';
- document.getElementById("cmd5Show").style.display='none';
- document.getElementById("cmd5Hide").style.display='block';
- document.getElementById("cmd6Show").style.display='none';
- document.getElementById("cmd6Hide").style.display='block';
- document.getElementById("cmd7Show").style.display='none';
- document.getElementById("cmd7Hide").style.display='block';
- document.getElementById("cmd8Show").style.display='none';
- document.getElementById("cmd8Hide").style.display='block';
- document.getElementById("cmd9Show").style.display='none';
- document.getElementById("cmd9Hide").style.display='block';
- document.getElementById("cmd10Show").style.display='none';
- document.getElementById("cmd10Hide").style.display='block';
- document.getElementById("regaShow").style.display='none';
- document.getElementById("regaHide").style.display='block';
- document.getElementById("picfShow").style.display='none';
- document.getElementById("picfHide").style.display='block';
- }
- else
- {
- document.getElementById("regbShow").style.display='block';
- document.getElementById("regbHide").style.display='none';
- document.getElementById("cmd1Show").style.display='block';
- document.getElementById("cmd1Hide").style.display='none';
- document.getElementById("cmd2Show").style.display='block';
- document.getElementById("cmd2Hide").style.display='none';
- document.getElementById("cmd3Show").style.display='block';
- document.getElementById("cmd3Hide").style.display='none';
- document.getElementById("cmd4Show").style.display='block';
- document.getElementById("cmd4Hide").style.display='none';
- document.getElementById("cmd5Show").style.display='block';
- document.getElementById("cmd5Hide").style.display='none';
- document.getElementById("cmd6Show").style.display='block';
- document.getElementById("cmd6Hide").style.display='none';
- document.getElementById("cmd7Show").style.display='block';
- document.getElementById("cmd7Hide").style.display='none';
- document.getElementById("cmd8Show").style.display='block';
- document.getElementById("cmd8Hide").style.display='none';
- document.getElementById("cmd9Show").style.display='block';
- document.getElementById("cmd9Hide").style.display='none';
- document.getElementById("cmd10Show").style.display='block';
- document.getElementById("cmd10Hide").style.display='none';
- document.getElementById("regaShow").style.display='block';
- document.getElementById("regaHide").style.display='none';
- document.getElementById("picfShow").style.display='block';
- document.getElementById("picfHide").style.display='none';
- }
- }
-
-
- function ToggleUSSFs(state)
- {
- position="configwizard.js";
- whatfunc="ToggleUSSFs()";
-
- if (state)
- {
- document.getElementById("USSF1Show").style.display='none';
- document.getElementById("USSF1Hide").style.display='block';
- document.getElementById("USSF2Show").style.display='none';
- document.getElementById("USSF2Hide").style.display='block';
- document.getElementById("USSF3Show").style.display='none';
- document.getElementById("USSF3Hide").style.display='block';
- document.getElementById("USSF4Show").style.display='none';
- document.getElementById("USSF4Hide").style.display='block';
- document.getElementById("USSF5Show").style.display='none';
- document.getElementById("USSF5Hide").style.display='block';
- document.getElementById("USSF6Show").style.display='none';
- document.getElementById("USSF6Hide").style.display='block';
- document.getElementById("USSF7Show").style.display='none';
- document.getElementById("USSF7Hide").style.display='block';
- document.getElementById("USSF8Show").style.display='none';
- document.getElementById("USSF8Hide").style.display='block';
- document.getElementById("USSF9Show").style.display='none';
- document.getElementById("USSF9Hide").style.display='block';
- document.getElementById("USSF10Show").style.display='none';
- document.getElementById("USSF10Hide").style.display='block';
- }
- else
- {
- document.getElementById("USSF1Show").style.display='block';
- document.getElementById("USSF1Hide").style.display='none';
- document.getElementById("USSF2Show").style.display='block';
- document.getElementById("USSF2Hide").style.display='none';
- document.getElementById("USSF3Show").style.display='block';
- document.getElementById("USSF3Hide").style.display='none';
- document.getElementById("USSF4Show").style.display='block';
- document.getElementById("USSF4Hide").style.display='none';
- document.getElementById("USSF5Show").style.display='block';
- document.getElementById("USSF5Hide").style.display='none';
- document.getElementById("USSF6Show").style.display='block';
- document.getElementById("USSF6Hide").style.display='none';
- document.getElementById("USSF7Show").style.display='block';
- document.getElementById("USSF7Hide").style.display='none';
- document.getElementById("USSF8Show").style.display='block';
- document.getElementById("USSF8Hide").style.display='none';
- document.getElementById("USSF9Show").style.display='block';
- document.getElementById("USSF9Hide").style.display='none';
- document.getElementById("USSF10Show").style.display='block';
- document.getElementById("USSF10Hide").style.display='none';
- }
- }
-
-
- function ToggleDefaultImages(state)
- {
- position="configwizard.js";
- whatfunc="ToggleDefaultImages()";
-
- if (state)
- {
- document.getElementById("DefaultImageShow").style.display='none';
- document.getElementById("DefaultImageHide").style.display='block';
- }
- else
- {
- document.getElementById("DefaultImageShow").style.display='block';
- document.getElementById("DefaultImageHide").style.display='none';
- }
- }
-
-
- function ToggleControlGadgets(state)
- {
- position="configwizard.js";
- whatfunc="ToggleControlGadgets()";
-
- document.getElementById("configFirst").disabled=state;
- document.getElementById("configPrevious").disabled=state;
- document.getElementById("configNext").disabled=state;
- document.getElementById("configLast").disabled=state;
- document.getElementById("configAdd").disabled=state;
- document.getElementById("configDelete").disabled=state;
- document.getElementById("configFile").disabled=state;
- document.getElementById("configNewConfig").disabled=state;
- document.getElementById("configRead").disabled=state;
- document.getElementById("configSave").disabled=state;
- document.getElementById("configSaveAs").disabled=state;
- document.getElementById("configExit").disabled=state;
- }
-
-
- function FillInConfigFile()
- {
- position="configwizard.js";
- whatfunc="FillInConfigFile()";
-
- document.getElementById("configFile").value=configFile;
- }
-
-
- function JumpToEntry(pos)
- {
- position="configwizard.js";
- whatfunc="JumpToEntry()";
-
- CopyConfig(cpos);
- cpos=pos;
- FillInConfig(false,cpos);
- }
-
-
- function FirstEntry()
- {
- position="configwizard.js";
- whatfunc="FirstEntry()";
-
- CopyConfig(cpos);
- cpos=0;
- FillInConfig(false,cpos);
- }
-
-
- function PreviousEntry()
- {
- position="configwizard.js";
- whatfunc="PreviousEntry()";
-
- if (cpos>0)
- {
- CopyConfig(cpos);
- cpos--;
- FillInConfig(false,cpos);
- }
- }
-
-
- function NextEntry()
- {
- position="configwizard.js";
- whatfunc="NextEntry()";
-
- if (cpos<configList.length-1)
- {
- CopyConfig(cpos);
- cpos++;
- FillInConfig(false,cpos);
- }
- }
-
-
- function LastEntry()
- {
- position="configwizard.js";
- whatfunc="LastEntry()";
-
- CopyConfig(cpos);
- cpos=configList.length-1;
- FillInConfig(false,cpos);
- }
-
-
- function AddEntry()
- {
- position="configwizard.js";
- whatfunc="AddEntry()";
-
- CopyConfig(cpos);
- cpos=configList.length-1;
- cpos++;
- configList[cpos]=new program(cpos);
- clearProgram(configList[cpos]);
- configList[cpos].prog="--- New ---";
- FillInConfig(true,cpos);
- ToggleAllGadgets(true);
- if (SortWithinCats)
- FirstEntry();
- else
- LastEntry();
- document.getElementById("prog").focus();
- }
-
-
- function CloneEntry()
- {
- position="configwizard.js";
- whatfunc="CloneEntry()";
-
- var temp=cpos;
-
- CopyConfig(cpos);
- cpos=configList.length-1;
- cpos++;
- configList[cpos]=new program(pn);
- clearProgram(configList[cpos]);
- CopyConfig(cpos);
- configList[cpos].prog += "-2";
- configList[cpos].ordr = "";
- configList[cpos].uid += "-2";
- cpos=temp;
- FillInConfig(true,cpos);
- if (SortWithinCats)
- NextEntry();
- else
- LastEntry();
- document.getElementById("prog").focus();
- }
-
-
- function DeleteEntry()
- {
- position="configwizard.js";
- whatfunc="DeleteEntry()";
-
- if (!confirm("Really delete '" + configList[cpos].prog + "' ?"))
- return;
-
- configList.splice(cpos,1);
- if (cpos>configList.length-1)
- {
- cpos=configList.length-1;
- }
-
- if (cpos==-1)
- {
- ConfigDefaults();
-
- return;
- }
-
- FillInConfig(true,cpos);
- }
-
-
- function HandleNameChange()
- {
- position="configwizard.js";
- whatfunc="HandleNameChange()";
-
- CopyConfig(cpos);
- if (document.getElementById("uid").value=="")
- {
- GenUID(1);
- ToggleAllGadgets(false);
- }
- else
- {
- GenUID(0);
- }
-
- CreateNavigation();
- FindEntry();
- document.getElementById("ordr").focus();
- }
-
-
- function HandleInstallOrder()
- {
- position="configwizard.js";
- whatfunc="HandleInstallOrder()";
-
- CopyConfig(cpos);
- CreateNavigation();
- document.getElementById("desc").focus();
- }
-
-
- function GenUID(mode)
- {
- position="configwizard.js";
- whatfunc="GenUID()";
-
- var name=document.getElementById("prog").value;
-
- if (mode==0)
- {
- if (document.getElementById("uid").value != "" || document.getElementById("uid").value != null)
- return;
- }
- name=name.replace(/\W/g,"").toUpperCase().substr(0,25);
- document.getElementById("uid").value=name;
-
- CopyConfig(cpos);
- FindEntry();
- ToggleAllGadgets(false);
- document.getElementById("uid").focus();
- }
-
-
- function FillUID(currentprogram)
- {
- position="configwizard.js";
- whatfunc="FillUID()";
-
- document.getElementById("cboDeps").innerHTML = "";
- document.getElementById("cboExcl").innerHTML = "";
-
- var opt = document.createElement("option");
- opt.value = "blank";
- opt.text = "";
- document.getElementById("cboDeps").options.add(opt);
-
- var opt = document.createElement("option");
- opt.value = "blank";
- opt.text = "";
- document.getElementById("cboExcl").options.add(opt);
-
- for (var i=0; i<configList.length && configList[i] != null; i++)
- {
- if (configList[i].uid != "" && configList[i].prog != currentprogram)
- {
- var opt = document.createElement("option");
- opt.value = configList[i].uid;
- opt.text = configList[i].prog;
- document.getElementById("cboDeps").options.add(opt);
-
- var opt = document.createElement("option");
- opt.value = configList[i].uid;
- opt.text = configList[i].prog;
- document.getElementById("cboExcl").options.add(opt);
- }
- }
- }
-
-
- function HandleDependentOf()
- {
- position="configwizard.js";
- whatfunc="HandleDependentOf()";
-
- var n = document.getElementById("cboDeps").selectedIndex; // Which menu item is selected
- var val = document.getElementById("cboDeps")[n].value; // Return string value of menu item
- var txt="";
-
- if (document.getElementById("cboDeps").value != "blank")
- {
- txt=document.getElementById("deps").value;
- if (txt=="" && txt.indexOf(val) == -1)
- {
- txt += document.getElementById("cboDeps").value;
- document.getElementById("deps").value=txt;
- }
- else if (txt != "" && txt.indexOf(val) == -1)
- {
- txt += ",";
- txt += document.getElementById("cboDeps").value;
- document.getElementById("deps").value=txt;
- }
- }
-
- document.getElementById("cboDeps").value="blank";
- }
-
-
- function HandleExcludes()
- {
- position="configwizard.js";
- whatfunc="HandleExcludes()";
-
- var n = document.getElementById("cboExcl").selectedIndex; // Which menu item is selected
- var val = document.getElementById("cboExcl")[n].value; // Return string value of menu item
- var txt="";
-
- if (document.getElementById("cboExcl").value != "blank")
- {
- txt=document.getElementById("excl").value;
- if (txt=="" && txt.indexOf(val) == -1)
- {
- txt += document.getElementById("cboExcl").value;
- document.getElementById("excl").value=txt;
- }
- else if (txt != "" && txt.indexOf(val) == -1)
- {
- txt += ",";
- txt += document.getElementById("cboExcl").value;
- document.getElementById("excl").value=txt;
- }
- }
-
- document.getElementById("cboExcl").value="blank";
- }
-
-
- function HandleConditionsSelection(which)
- {
- position="configwizard.js";
- whatfunc="HandleConditionsSelection()";
-
- var n = document.getElementById("cboConditions"+which).selectedIndex;
- var val = document.getElementById("cboConditions"+which)[n].value;
- var gad="", txt="";
-
- if (which==1)
- gad="cond";
- else
- gad="gcond";
-
- if (document.getElementById("cboConditions"+which).value != "blank")
- {
- txt=document.getElementById(gad).value;
- if (txt=="")
- {
- txt += document.getElementById("cboConditions"+which).value;
- document.getElementById(gad).value=txt;
- }
- else
- {
- txt += " ";
- txt += document.getElementById("cboConditions"+which).value;
- document.getElementById(gad).value=txt;
- }
-
- document.getElementById("cboConditions"+which).value="blank";
- document.getElementById(gad).focus();
- }
- }
-
-
- function HandleCommandsSelection(which)
- {
- position="configwizard.js";
- whatfunc="HandleCommandsSelection()";
-
- var n = document.getElementById("cboCommands"+which).selectedIndex;
- var val = document.getElementById("cboCommands"+which)[n].value;
- var txt="";
-
- if (document.getElementById("cboCommands"+which).value != "blank")
- {
- txt=document.getElementById("cmd"+which).value;
- if (txt=="")
- {
- txt += document.getElementById("cboCommands"+which).value;
- document.getElementById("cmd"+which).value=txt;
- }
- else
- {
- txt += " ";
- txt += document.getElementById("cboCommands"+which).value;
- document.getElementById("cmd"+which).value=txt;
- }
-
- document.getElementById("cboCommands"+which).value="blank";
- document.getElementById("cmd"+which).focus();
- }
- }
-
-
- //Tony add to trim string from browse and added function call to each browse
- function trimString(str)
- {
- position="configwizard.js";
- whatfunc="trimString()";
-
- var trimpath;
- var trimpathvar;
-
- //Set up switch statements to check if str starts with an environmental path and replace i.e. c:\windows as %windir%
- if (str.indexOf(wpipath) != -1)
- {
- trimpath=wpipath;
- trimpathvar="%wpipath%"; //Could have used %cdrom%
- }
- else if (str.indexOf(root) != -1)
- {
- trimpath=root;
- trimpathvar="%root%";
- }
- else if (str.indexOf(sysdir) != -1)
- {
- trimpath=sysdir;
- trimpathvar="%sysdir%";
- }
- else if (str.indexOf(windir) != -1)
- {
- trimpath=windir;
- trimpathvar="%windir%";
- }
- else if (str.indexOf(programfiles) != -1)
- {
- trimpath=programfiles;
- trimpathvar="%programfiles%";
- }
- else if (str.indexOf(temp) != -1)
- {
- trimpath=temp;
- trimpathvar="%temp%";
- }
- else
- {
- //tempName="\"%wpipath%"+tempName.substring(theStart+1,tempName.length)+"\"";
- trimpath=sysdrv;
- trimpathvar="%wpipath%"; //Default from before...Could have used %cdrom%
- }
-
- str=str.replace(trimpath, '/\s'); //remove the trimpath
- str = "\"" + trimpathvar +str.substring(theStart+1,str.length)+"\"";
- return str;
- }
-
-
- function clearregbBrowse()
- {
- position="configwizard.js";
- whatfunc="clearregbBrowse()";
-
- document.getElementById("div_regbBrowse").innerHTML="";
- document.getElementById("div_regbBrowse").innerHTML='<input id="regbBrowse" type="file" style="display:none;">';
- }
-
-
- function SetRegbPath()
- {
- position="configwizard.js";
- whatfunc="SetRegbPath()";
-
- if (document.getElementById("regbBrowse").value != "")
- {
- tempName=document.getElementById("regbBrowse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("regb").value=tempName;
- }
- }
-
-
- function clearcmd1Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd1Browse()";
-
- document.getElementById("div_cmd1Browse").innerHTML="";
- document.getElementById("div_cmd1Browse").innerHTML='<input id="cmd1Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd1Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd1Path()";
-
- if (document.getElementById("cmd1Browse").value != "")
- {
- tempName=document.getElementById("cmd1Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("cmd1").value=tempName;
- }
- }
-
-
- function clearcmd2Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd2Browse()";
-
- document.getElementById("div_cmd2Browse").innerHTML="";
- document.getElementById("div_cmd2Browse").innerHTML='<input id="cmd2Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd2Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd2Path()";
-
- if (document.getElementById("cmd2Browse").value != "")
- {
- tempName=document.getElementById("cmd2Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("cmd2").value=tempName;
- }
- }
-
-
- function clearcmd3Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd3Browse()";
-
- document.getElementById("div_cmd3Browse").innerHTML="";
- document.getElementById("div_cmd3Browse").innerHTML='<input id="cmd3Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd3Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd3Path()";
-
- if (document.getElementById("cmd3Browse").value != "")
- {
- tempName=document.getElementById("cmd3Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("cmd3").value=tempName;
- }
- }
-
-
- function clearcmd4Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd4Browse()";
-
- document.getElementById("div_cmd4Browse").innerHTML="";
- document.getElementById("div_cmd4Browse").innerHTML='<input id="cmd4Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd4Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd4Path()";
-
- if (document.getElementById("cmd4Browse").value != "")
- {
- tempName=document.getElementById("cmd4Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
-
- document.getElementById("cmd4").value=tempName;
- }
- }
-
-
- function clearcmd5Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd5Browse()";
-
- document.getElementById("div_cmd5Browse").innerHTML="";
- document.getElementById("div_cmd5Browse").innerHTML='<input id="cmd5Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd5Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd5Path()";
-
- if (document.getElementById("cmd5Browse").value != "")
- {
- tempName=document.getElementById("cmd5Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("cmd5").value=tempName;
- }
- }
-
-
- function clearcmd6Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd6Browse()";
-
- document.getElementById("div_cmd6Browse").innerHTML="";
- document.getElementById("div_cmd6Browse").innerHTML='<input id="cmd6Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd6Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd6Path()";
-
- if (document.getElementById("cmd6Browse").value != "")
- {
- tempName=document.getElementById("cmd6Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
- document.getElementById("cmd6").value=tempName;
- }
- }
-
- function clearcmd7Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd7Browse()";
-
- document.getElementById("div_cmd7Browse").innerHTML="";
- document.getElementById("div_cmd7Browse").innerHTML='<input id="cmd7Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd7Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd7Path()";
-
- if (document.getElementById("cmd7Browse").value != "")
- {
- tempName=document.getElementById("cmd7Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
-
- document.getElementById("cmd7").value=tempName;
- }
- }
-
- function clearcmd8Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd8Browse()";
-
- document.getElementById("div_cmd8Browse").innerHTML="";
- document.getElementById("div_cmd8Browse").innerHTML='<input id="cmd8Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd8Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd8Path()";
-
- if (document.getElementById("cmd8Browse").value != "")
- {
- tempName=document.getElementById("cmd8Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
-
- document.getElementById("cmd8").value=tempName;
- }
- }
-
- function clearcmd9Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd9Browse()";
-
- document.getElementById("div_cmd9Browse").innerHTML="";
- document.getElementById("div_cmd9Browse").innerHTML='<input id="cmd9Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd9Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd9Path()";
-
- if (document.getElementById("cmd9Browse").value != "")
- {
- tempName=document.getElementById("cmd9Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
-
- document.getElementById("cmd9").value=tempName;
- }
- }
-
- function clearcmd10Browse()
- {
- position="configwizard.js";
- whatfunc="clearcmd10Browse()";
-
- document.getElementById("div_cmd10Browse").innerHTML="";
- document.getElementById("div_cmd10Browse").innerHTML='<input id="cmd10Browse" type="file" style="display:none;">';
- }
-
-
- function SetCmd10Path()
- {
- position="configwizard.js";
- whatfunc="SetCmd10Path()";
-
- if (document.getElementById("cmd10Browse").value != "")
- {
- tempName=document.getElementById("cmd10Browse").value;
- if (theStart=tempName.indexOf(":") != -1)
- tempName = trimString(tempName);
-
- document.getElementById("cmd10").value=tempName;
- }
- }
- function HandleUSSF(cmd)
- {
- position="configwizard.js";
- whatfunc="HandleUSSF()";
-
- var path, temp;
-
- if (document.getElementById("cmd" + cmd).value != "")
- {
- path=document.getElementById("cmd" + cmd).value;
- path=path.replace(/\"/g,"");
- temp=document.getElementById ("cmd" + cmd).value;
- temp=temp.replace(/\"/g,"");
- temp=ReplacePath(temp);
-
- if (FileExists(temp))
- {
- try
- {
- interval = window.setInterval("USSFCheck()",200);
- // For silent usage for parsing entire folder: 0 - GUI, 1 - small box, 2 - silent
- WshShell.Run('"' + USSFcmd + '" "' + temp + '" "' + path + '" ' + cmd + (USSFSilentMode ? ' 2' : ' 0') , 1, true);
- Pause(0,300);
- window.clearInterval(interval);
- }
- catch (ex)
- {
- window.clearInterval(interval);
- alert(getText(txtUSSFfailure));
- }
- }
- else
- alert(getText(errCouldNotOpenFile)+"\n'"+temp+"'.");
- }
- }
-
-
- function USSFCheck()
- {
- position="configwizard.js";
- whatfunc="USSFCheck()";
-
- try
- {
- var aux;
-
- for (var x = 1; x <= 6; x++)
- {
- aux = WshShell.RegRead('HKEY_CURRENT_USER\\Software\\WPI\\USSF_cmd' + x);
- if (aux != 'default')
- document.getElementById('cmd' + x).value = aux;
- }
- }
- catch (ex)
- {
- alert(getText(txtUSSFfailure));
- }
- }
-
-
- function clearregaBrowse()
- {
- position="configwizard.js";
- whatfunc="clearregaBrowse()";
-
- document.getElementById("div_regaBrowse").innerHTML="";
- document.getElementById("div_regaBrowse").innerHTML='<input id="regaBrowse" type="file" style="display:none;">';
- }
-
-
- function SetRegaPath()
- {
- position="configwizard.js";
- whatfunc="SetRegaPath()";
-
- if (document.getElementById("regaBrowse").value != "")
- {
- tempName=document.getElementById("regaBrowse").value;
- if (theStart=tempName.indexOf(":") != -1)
- //tempName="\"%wpipath%"+tempName.substring(theStart+1,tempName.length)+"\""; //Tony add - Commented out original code
- tempName = trimString(tempName); //Tony add - trimString is a new function that will trim the relative path properly.
-
- document.getElementById("rega").value=tempName;
- }
- }
-
-
- function clearpicfBrowse()
- {
- position="configwizard.js";
- whatfunc="clearpicfBrowse()";
-
- document.getElementById("div_picfBrowse").innerHTML="";
- document.getElementById("div_picfBrowse").innerHTML='<input id="picfBrowse" type="file" style="display:none;">';
- }
-
-
- function GetPictureName()
- {
- position="configwizard.js";
- whatfunc="GetPictureName()";
-
- var lastSlash, tempName;
-
- tempName=document.getElementById("picfBrowse").value;
- lastSlash=tempName.lastIndexOf("\\");
-
- BrowseName=tempName.substring(lastSlash+1,tempName.length);
- }
-
-
- function SetPicturePath()
- {
- position="configwizard.js";
- whatfunc="SetPicturePath()";
-
- if (document.getElementById("picfBrowse").value != "")
- {
- GetPictureName();
- document.getElementById("picf").value=BrowseName;
-
- configList[cpos].picw=128;
- configList[cpos].pich=128;
- configList[cpos].textl='Top';
-
- document.getElementById("picw").value=128;
- document.getElementById("pich").value=128;
- document.getElementById("textl").value='Top';
- }
- }
-
-
- function HandleDefaultImage()
- {
- position="configwizard.js";
- whatfunc="HandleDefaultImage()";
-
- configList[cpos].picf="InstallPackage.png";
- configList[cpos].picw=128;
- configList[cpos].pich=128;
- configList[cpos].textl="Bottom";
-
- document.getElementById("picf").value=configList[cpos].picf;
- document.getElementById("picw").value=configList[cpos].picw;
- document.getElementById("pich").value=configList[cpos].pich;
- document.getElementById("textl").value=configList[cpos].textl;
-
- TogglePictureGadgets();
- }
-
-
- function FindEntry()
- {
- position="configwizard.js";
- whatfunc="FindEntry()";
-
- for (var i=0; i<configList.length && configList[i] != null; i++)
- {
- if (configList[i].uid==document.getElementById("uid").value)
- {
- cpos=i;
- FillInConfig(false,cpos);
- break;
- }
- }
- }
-
-
- function HandleCatSelection()
- {
- position="configwizard.js";
- whatfunc="HandleCatSelection()";
-
- if (document.getElementById("cbocats").value=="other")
- {
- document.getElementById("cat").style.visibility="visible";
- document.getElementById("cat").value="--- New ---";
- document.getElementById("cat").focus();
- }
- else
- document.getElementById("cat").style.visibility="hidden";
- if (document.getElementById("cbocats").value=="---")
- {
- alert(getText(errSelectACategory));
- document.getElementById("cbocats").value=configList[cpos].cat;
- }
- }
-
-
- function HandleNewCat()
- {
- position="configwizard.js";
- whatfunc="HandleNewCat()";
-
- var opt = document.createElement("option");
-
- opt.value = document.getElementById("cat").value;
- opt.text = noTags(opt.value);
- document.getElementById("cbocats").options.add(opt);
- Pause(0, 50);
- document.getElementById("cbocats").selectedIndex = document.getElementById("cbocats").length - 1;
- }
-
-
- function HandleConfigSelection()
- {
- position="configwizard.js";
- whatfunc="HandleConfigSelection()";
-
- var txt="";
-
- if (document.getElementById("SelectConfigs").value != "blank")
- {
- txt=document.getElementById("configs").value;
- if (txt != "")
- txt += ",";
- txt += document.getElementById("SelectConfigs").value;
- document.getElementById("configs").value=txt;
- }
-
- document.getElementById("SelectConfigs").value="blank";
- }
-
-
- function ConfigTemplateIntoTextlines()
- {
- position="configwizard.js";
- whatfunc="ConfigTemplateIntoTextLines()";
-
- var txt=new String();
- var line=new String();
- var textline=0;
-
- ConfigRowTextLines.push('');
- strFile=wpipath + "\\Common\\configwizardtemplate_config.htm";
- if (!FileExists(strFile))
- {
- alert(getText(errCouldNotOpenFile)+" '"+strFile+"'.");
- ExitWPI();
- }
- try
- {
- tf=fso.OpenTextFile(strFile, 1);
- txt="";
- while (!tf.AtEndOfStream)
- {
- line=tf.ReadLine();
- txt=(line + "\n");
- txt=ConfigRowTextLines[textline] + txt;
- ConfigRowTextLines[textline]=txt;
- }
- }
- catch (ex)
- { ; }
- finally
- {
- tf.Close();
- }
- }
-
-
- function CreateConfigRow()
- {
- position="configwizard.js";
- whatfunc="CreateConfigRow()";
-
- var txt=new String(); txt="";
-
- if (ConfigRowTextLines.length<=0)
- ConfigTemplateIntoTextlines();
-
- for (var i=0; i<ConfigRowTextLines.length-1; i++)
- txt += ConfigRowTextLines[i];
- txt += ConfigRowTextLines[ConfigRowTextLines.length-1];
-
- return txt;
- }
-
-
- function InsertCatsValues()
- {
- position="configwizard.js";
- whatfunc="InsertCatsValues()";
-
- var cats = GetCats();
-
- for (var i=0; i<cats.length; i++)
- {
- if (cats[i] != "Applications" && cats[i] != "Drivers" && cats[i] != "Games" && cats[i] != "MultiMedia" && cats[i] != "Office" && cats[i] != "Registry Tweaks" && cats[i] != "System" && cats[i] != "Utilities" && cats[i])
- {
- var opt = document.createElement("option");
-
- opt.value = cats[i];
- opt.text = noTags(cats[i]);
- document.getElementById("cbocats").options.add(opt);
- }
- }
- }
-
-
- function InsertConfigsValues()
- {
- position="configwizard.js";
- whatfunc="InsertConfigsValues()";
-
- for (var i=0; i<Configurations.length; i++)
- {
- var opt=document.createElement("option");
-
- opt.value=Configurations[i];
- opt.text=noTags(Configurations[i]);
- document.getElementById("SelectConfigs").options.add(opt);
- }
- }
-
-
- function GetConfigValue(inVal, isNum)
- {
- position="configwizard.js";
- whatfunc="GetConfigValue()";
-
- var txt=new String();
-
- txt=inVal;
- txt=txt.replace(/\\/g,"\\\\");
-
- if (!isNum && txt != "")
- {
- txt=txt.replace(/'/g,"\\'");
- txt=("'" + txt + "'");
- }
-
- return txt;
- }
-
-
- function WriteConfigValue(tf, fName, inVal, isNum)
- {
- position="configwizard.js";
- whatfunc="WriteConfigValue()";
-
- if (inVal==null || inVal=="")
- return;
-
- var txt=new String();
-
- txt=(fName + "[pn]=[" + GetConfigValue(inVal, isNum) + "];");
- txt=txt.replace(/''/g,"'");
- tf.WriteLine(txt);
- }
-
-
- function byOrder(a, b)
- {
- position="configwizard.js";
- whatfunc="byOrder()";
-
- return(a.prog.value - b.prog.value);
- }
-
-
- function byName(a, b)
- {
- position="configwizard.js";
- whatfunc="byName()";
-
- var x=a.prog.toLowerCase();
- var y=b.prog.toLowerCase();
-
- return ((x < y) ? -1 : ((x > y) ? 1 : 0));
- }
-
-
- function ConfigDefaults()
- {
- position="configwizard.js";
- whatfunc="ConfigDefaults()";
-
- pn=1;
- cpos=0;
- configList[0]=new program(pn);
- clearProgram(configList[0]);
- ToggleAllGadgets(true);
- configList[cpos].prog="--- New ---";
- FillInConfig(true,cpos);
- FirstEntry();
- document.getElementById("prog").focus();
- }
-
-
- function NewConfig()
- {
- position="configwizard.js";
- whatfunc="NewConfig()";
-
- var temp;
-
- temp=prompt(getText(txtSaveConfigAs),configFile);
- if (temp != null)
- {
- configFile=temp;
- SetConfigPath(true);
- configList=[];
- cpos=0;
- configList[cpos]=new program(pn);
- clearProgram(configList[cpos]);
- ToggleAllGadgets(true);
- configList[cpos].prog="--- New ---";
- FillInConfig(true,cpos);
-
- SaveConfig();
-
- ReadConfig();
- }
- }
-
-
- function configClearReadBrowse()
- {
- position="configwizard.js";
- whatfunc="configClearReadBrowse()";
-
- document.getElementById("div_configReadBrowse").innerHTML="";
- document.getElementById("div_configReadBrowse").innerHTML='<input id="configReadBrowse" type="file" style="display:none;">';
- }
-
-
- function HandleReadConfig()
- {
- position="configwizard.js";
- whatfunc="HandleReadConfig()";
-
- if (document.getElementById("configReadBrowse").value != "")
- {
- SetConfigPath(false);
- ReadConfig();
- }
- }
-
-
- function SetConfigPath(mode)
- {
- position="configwizard.js";
- whatfunc="SetConfigPath()";
-
- var i, txt;
-
- if (!mode)
- {
- configFile=document.getElementById("configReadBrowse").value;
-
- i=configFile.indexOf('\\WPI\\WPIScripts\\');
- if (i != -1)
- {
- txt="./WPIScripts/"+configFile.substr(i+16,configFile.length);
- configFile=txt;
- }
- }
- else
- {
- // Nothing for Save As... right now
- }
- }
-
-
- function GetConfigPath()
- {
- position="configwizard.js";
- whatfunc="GetConfigPath()";
-
- var temp;
-
- temp=prompt(getText(txtSaveConfigAs),configFile);
- if (temp != null)
- {
- configFile=temp;
- SetConfigPath(true);
- SaveConfig();
- }
- }
-
-
- function ReadConfig()
- {
- position="configwizard.js";
- whatfunc="ReadConfig()";
-
- var line=new String();
- var opt=new String();
- var val=new String();
- var i, txt;
-
- pn=1;
- strFile=configFile;
- if (FileExists(strFile))
- {
- configList=[];
- try
- {
- tf=fso.OpenTextFile(strFile, 1);
- while (!tf.AtEndOfStream)
- {
- line=tf.ReadLine();
- if (line.search("^ *$")==0)
- continue; // empty line
- if (line.search("^ *//")==0)
- continue; // comments
- if (line.search("^ *pn")==0)
- continue; // pn++
- line=line.replace(/^var /g,"");
- line=line.replace(/^ */g,"");
-
- opt=line.substring(0,line.indexOf("["));
- val=line.substring(line.indexOf("=")+1, line.length);
- val=val.replace(/^ *\[ */,"").replace(/^ *' */,"");
- val=val.replace(/ *] *$/,"").replace(/ *' *$/,"");
- val=val.replace(/ *]; *$/,"").replace(/ *' *$/,"");
- val=val.replace(/\\\\/g,"\\");
- val=val.replace(/\\'/g,"'");
- switch (opt)
- {
- case "prog":
- configList[pn-1]=new program(pn);
- clearProgram(configList[pn-1]);
- configList[pn-1].prog=val;
- pn++;
- break;
-
- case "ordr":
- configList[pn-2].ordr=val;
- break;
-
- case "desc":
- configList[pn-2].desc=val;
- break;
-
- case "uid":
- configList[pn-2].uid=val;
- break;
-
- case "dflt":
- configList[pn-2].dflt=val;
- break;
-
- case "cat":
- configList[pn-2].cat=val;
- break;
-
- case "forc":
- configList[pn-2].forc=val;
- break;
-
- case "configs":
- configList[pn-2].configs=val;
- break;
-
- case "deps":
- val=val.replace (/ *' *, *' */gi,",");
- configList[pn-2].deps=val;
- break;
-
- case "excl":
- val=val.replace (/ *' *, *' */gi,",");
- configList[pn-2].excl=val;
- break;
-
- case "cond":
- configList[pn-2].cond=val;
- break;
-
- case "gcond":
- configList[pn-2].gcond=val;
- break;
-
- case "regb":
- configList[pn-2].regb=val;
- break;
-
- case "cmd1":
- configList[pn-2].cmd1=val;
- break;
-
- case "cmd2":
- configList[pn-2].cmd2=val;
- break;
-
- case "cmd3":
- configList[pn-2].cmd3=val;
- break;
-
- case "cmd4":
- configList[pn-2].cmd4=val;
- break;
-
- case "cmd5":
- configList[pn-2].cmd5=val;
- break;
-
- case "cmd6":
- configList[pn-2].cmd6=val;
- break;
-
- case "cmd7":
- configList[pn-2].cmd7=val;
- break;
-
- case "cmd8":
- configList[pn-2].cmd8=val;
- break;
-
- case "cmd9":
- configList[pn-2].cmd9=val;
- break;
-
- case "cmd10":
- configList[pn-2].cmd10=val;
- break;
-
- case "rega":
- configList[pn-2].rega=val;
- break;
-
- case "picf":
- configList[pn-2].picf=val;
- break;
-
- case "picw":
- if (configList[pn-2].picf)
- configList[pn-2].picw=val;
- break;
-
- case "pich":
- if (configList[pn-2].picf)
- configList[pn-2].pich=val;
- break;
-
- case "textl":
- if (configList[pn-2].picf)
- configList[pn-2].textl=val;
- break;
- }
- }
- }
- catch (ex)
- { ; }
- finally
- {
- tf.Close();
- }
- }
- else
- {
- CreateControls();
- CreateNavigation();
-
- document.getElementById("configGuts").innerHTML=CreateConfigRow();
- document.getElementById("configTemplateBG").style.backgroundImage='url('+wpipath+'\\Themes\\'+Theme+'\\OptionsBg.gif)';
-
- ConfigDefaults();
-
- LocalizeConfigTexts();
-
- InsertCatsValues();
- InsertConfigsValues();
-
- pn=1;
- cpos=0;
- FillInConfig(true,cpos);
-
- return;
- }
-
- if (SortWithinCats)
- configList.sort(byName);
-
- CreateControls();
- CreateNavigation();
- FillInConfigFile();
-
- document.getElementById("configGuts").innerHTML=CreateConfigRow();
- document.getElementById("configTemplateBG").style.backgroundImage='url('+wpipath+'\\Themes\\'+Theme+'\\OptionsBg.gif)';
-
- LocalizeConfigTexts();
-
- InsertCatsValues();
- InsertConfigsValues();
-
- cpos=0;
- // FillInConfig(true,cpos);
- FillInConfig(false,cpos);
- }
-
-
- function SaveConfig()
- {
- position="configwizard.js";
- whatfunc="SaveConfig()";
-
- var form, txt;
-
- strFile=configFile;
-
- try
- {
- tf=fso.CreateTextFile(strFile, true);
-
- ToggleControlGadgets(true);
- document.getElementById("layerconfig").style.cursor='wait';
-
- tf.WriteLine("//---------------------------------------------------------------------------------------------");
- tf.WriteLine("// Reference ... prog[0] won't be used. It's just an example.");
- tf.WriteLine("// Look in program.js to see explanation of these properties.");
- tf.WriteLine("//--------------------------------------------------------------------------------------------- ");
- tf.WriteLine("// pn=0; // start value for prog numbering");
- tf.WriteLine("// prog[pn]=['ProgramName'];");
- tf.WriteLine("// ordr[pn]=[0];");
- tf.WriteLine("// desc[pn]=['Description'];");
- tf.WriteLine("// uid[pn]=['APP1'];");
- tf.WriteLine("// dflt[pn]=['no'];");
- tf.WriteLine("// cat[pn]=['Application Category'];");
- tf.WriteLine("// forc[pn]=['false'];");
- tf.WriteLine("// configs[pn]=['List of configs to be auto checked. Comma seperated'];");
- tf.WriteLine("// deps[pn]=[];");
- tf.WriteLine("// excl[pn]=[];");
- tf.WriteLine("// cond[pn]=['Javascript Conditional Statement'];");
- tf.WriteLine("// gcond[pn]=['Javascript Conditional Statement to gray item'];");
- tf.WriteLine("// regb[pn]=['Registry Key Path'];");
- tf.WriteLine("// cmd1[pn]=['CommandLine 1'];");
- tf.WriteLine("// cmd2[pn]=['CommandLine 2'];");
- tf.WriteLine("// cmd3[pn]=['CommandLine 3'];");
- tf.WriteLine("// cmd4[pn]=['CommandLine 4'];");
- tf.WriteLine("// cmd5[pn]=['CommandLine 5'];");
- tf.WriteLine("// cmd6[pn]=['CommandLine 6'];");
- tf.WriteLine("// cmd7[pn]=['CommandLine 7'];");
- tf.WriteLine("// cmd8[pn]=['CommandLine 8'];");
- tf.WriteLine("// cmd9[pn]=['CommandLine 9'];");
- tf.WriteLine("// cmd10[pn]=['CommandLine 10'];");
- tf.WriteLine("// rega[pn]=['Registry Key Path'];");
- tf.WriteLine("// picf[pn]=['Picture File'];");
- tf.WriteLine("// picw[pn]=['Width'];");
- tf.WriteLine("// pich[pn]=['Height'];");
- tf.WriteLine("// textl[pn]=['Text Location'];");
- tf.WriteLine("// pn++;");
- tf.WriteLine("");
- tf.WriteLine("//---------------------------------------------------------------------------------------------");
- tf.WriteLine("// Your programs here ...");
- tf.WriteLine("//---------------------------------------------------------------------------------------------");
- tf.WriteLine("pn=1;");
-
- CopyConfig(cpos);
- if (SortWithinCats)
- configList.sort(byName);
-
- for (var i=0; i<configList.length && configList[i] != null; i++)
- {
- WriteConfigValue(tf, "prog",configList[i].prog);
- WriteConfigValue(tf, "ordr", configList[i].ordr,1);
- WriteConfigValue(tf, "desc", configList[i].desc);
-
- txt=GetConfigValue(configList[i].uid);
- txt=txt.replace(/ */g,"");
- WriteConfigValue(tf, "uid", txt, 1);
-
- WriteConfigValue(tf, "dflt", configList[i].dflt);
- WriteConfigValue(tf, "cat", configList[i].cat);
- WriteConfigValue(tf, "forc", configList[i].forc);
- WriteConfigValue(tf, "configs", configList[i].configs);
-
- txt=GetConfigValue(configList[i].deps);
- txt=txt.replace(/ */g,"");
- txt=txt.replace(/'/g,",");
- txt=txt.replace(/,,/g,",");
- txt=txt.replace(/,/g,"','");
- txt=txt.replace(/^',/,"").replace(/,'$/,"");
- WriteConfigValue(tf, "deps", txt, 1);
-
- txt=GetConfigValue(configList[i].excl);
- txt=txt.replace(/ */g,"");
- txt=txt.replace(/'/g,",");
- txt=txt.replace(/,,/g,",");
- txt=txt.replace(/,/g,"','");
- txt=txt.replace(/^',/,"").replace(/,'$/,"");
- WriteConfigValue(tf, "excl", txt, 1);
-
- WriteConfigValue(tf, "cond", configList[i].cond);
- if (configList[i].gcond != "FileExists('%programfiles%\')")
- WriteConfigValue(tf, "gcond",configList[i].gcond);
- WriteConfigValue(tf, "regb", configList[i].regb);
- WriteConfigValue(tf, "cmd1", configList[i].cmd1);
- WriteConfigValue(tf, "cmd2", configList[i].cmd2);
- WriteConfigValue(tf, "cmd3", configList[i].cmd3);
- WriteConfigValue(tf, "cmd4", configList[i].cmd4);
- WriteConfigValue(tf, "cmd5", configList[i].cmd5);
- WriteConfigValue(tf, "cmd6", configList[i].cmd6);
- WriteConfigValue(tf, "cmd7", configList[i].cmd7);
- WriteConfigValue(tf, "cmd8", configList[i].cmd8);
- WriteConfigValue(tf, "cmd9", configList[i].cmd9);
- WriteConfigValue(tf, "cmd10", configList[i].cmd10);
- WriteConfigValue(tf, "rega", configList[i].rega);
- WriteConfigValue(tf, "picf", configList[i].picf);
- WriteConfigValue(tf, "picw", configList[i].picw);
- WriteConfigValue(tf, "pich", configList[i].pich);
- WriteConfigValue(tf, "textl", configList[i].textl);
-
- tf.WriteLine("pn++;");
- tf.WriteLine("");
- }
- tf.WriteLine("//---------------------------------------------------------------------------------------------");
- tf.WriteLine("// End of program definitions ...");
- tf.WriteLine("//---------------------------------------------------------------------------------------------");
- }
- catch (ex)
- {
- alert(getText(errCouldNotSaveFile)+"\n"+strFile);
-
- return;
- }
- tf.Close();
-
- // alert(getText(txtConfigFileSaved));
- Pause(0,500);
- document.getElementById("layerconfig").style.cursor='default';
-
- ToggleControlGadgets(false);
- }
-
-
- function ShowConfig()
- {
- position="configwizard.js";
- whatfunc="ShowConfig()";
-
- ManualSection="Config";
- HideLayers();
- document.getElementById("InstallButton").style.visibility='hidden';
- document.getElementById("layerconfig").style.display='block';
-
- ReadConfig();
- }
-
-
- function HideConfig()
- {
- position="configwizard.js";
- whatfunc="HideConfig()";
-
- WshShell.RegWrite("HKEY_CURRENT_USER\\Software\\WPI\\ConfigFile",configFile);
-
- document.location.reload();
- }
-
-
- function ToggleConfig()
- {
- position="configwizard.js";
- whatfunc="ToggleConfig()";
-
- if (document.getElementById("layerconfig").style.display == 'none')
- ShowConfig();
- else
- HideConfig();
- }
-