Jump to content

Francesco

Member
  • Posts

    414
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Italy

Posts posted by Francesco

  1. Fix

    In configwizard.js replace


    NavGrid.addRow(i,[configList[i].ordr,ConvertSpecialCharactersToEntities(configList[i].cat),configList[i].uid,ConvertSpecialCharactersToEntities(configList[i].prog)]);

    with


    NavGrid.addRow(i,[configList[i].ordr,GetCategoryTranslation(ConvertSpecialCharactersToEntities(configList[i].cat)),configList[i].uid,ConvertSpecialCharactersToEntities(configList[i].prog)]);

  2. There's also


    else //If program checkbox was checked
    {
    if (!prog[thisChk])
    return; //Ensure checkbox exists
    thisCat=cat[thisChk].toString();
    }

    to replace with


    else //If program checkbox was checked
    {
    if (!prog[thisChk] || document.getElementById("chkbox"+thisChk) == null)
    return; //Ensure checkbox exists
    thisCat=cat[thisChk].toString();
    }

    or the categories wouldn't be checked at startup

  3. In WMI.js replace


    function getOSver()
    {
    position="wmi.js";
    whatfunc="getOSver()";

    if (szOSVerCache==NOT_FOUND) // this function is called often - get it once and cache the result
    {
    var Caption;

    try
    {
    objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");
    colItems=objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
    enumItems=new Enumerator(colItems);
    objItem=enumItems.item();

    Caption=objItem.Caption;
    /*
    alert("BuildNumber="+objItem.BuildNumber+"\n"+
    "BuildType="+objItem.BuildType+"\n"+
    "Caption="+objItem.Caption+"\n"+
    "OperatingSystemSKU="+objItem.OperatingSystemSKU+"\n"+
    "ProductType="+objItem.ProductType+"\n"+
    "Version="+objItem.Version);
    */
    if (Caption.indexOf("Windows 7") != -1) // Still waiting for official name
    szOSVerCache="Win7";
    if (Caption.indexOf("2008") != -1)
    szOSVerCache="08";
    if (Caption.indexOf("Vista") != -1)
    szOSVerCache="Vista";
    if (Caption.indexOf("2003") != -1)
    szOSVerCache="03";
    if (Caption.indexOf("XP") != -1)
    szOSVerCache="XP";
    if (Caption.indexOf("2000") != -1)
    szOSVerCache="2K";
    }
    catch(ex)
    {
    try
    {
    ver=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion");
    }
    catch(ex1)
    {
    try
    {
    ver=WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Version");
    }
    catch(ex2)
    { ; }
    }
    if (ver=="5.0")
    szOSVerCache="2K";
    if (ver=="4.0")
    szOSVerCache="NT";
    if (ver=="Windows 98")
    szOSVerCache="98";
    if (ver=="Windows Millennium Edition")
    szOSVerCache="ME";
    if (ver=="Windows 95")
    szOSVerCache="95";
    }
    }

    return szOSVerCache;
    }

    with


    function getOSvernum()
    {
    try
    {
    return WshShell.RegRead("HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion");
    }
    catch(ex1)
    {
    }
    return NOT_FOUND;
    }


    function getOSver()
    {
    position="wmi.js";
    whatfunc="getOSver()";

    if (szOSVerCache==NOT_FOUND) // this function is called often - get it once and cache the result
    {
    try
    {
    objWMIService=GetObject("winmgmts:\\\\" + "." + "\\root\\CIMV2");
    colItems=objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", wbemFlagReturnImmediately | wbemFlagForwardOnly);
    enumItems=new Enumerator(colItems);
    objItem=enumItems.item();

    var Caption=objItem.Caption;

    if (Caption.indexOf("Windows 8") != -1)
    szOSVerCache="Win8";
    if (Caption.indexOf("Windows 7") != -1)
    szOSVerCache="Win7";
    if (Caption.indexOf("2008") != -1)
    szOSVerCache="08";
    if (Caption.indexOf("Vista") != -1)
    szOSVerCache="Vista";
    if (Caption.indexOf("2003") != -1)
    szOSVerCache="03";
    if (Caption.indexOf("XP") != -1)
    szOSVerCache="XP";
    if (Caption.indexOf("2000") != -1)
    szOSVerCache="2K";
    }
    catch(ex)
    {
    }
    }

    return szOSVerCache;
    }

    In configwizard.js replace


    ConditionsMenuBar.addNewChild("cond_architecture_os", 0, "architecture_getOSver", "getOSver()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 1, "architecture_getSPver", "getSPver()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 2, "architecture_getOSlang", "getOSlang()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 3, "architecture_getOSlocale", "getOSlocale()", false, "", "");

    with


    ConditionsMenuBar.addNewChild("cond_architecture_os", 0, "architecture_getOSver", "getOSver()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 1, "architecture_getOSvernum", "getOSvernum()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 2, "architecture_getSPver", "getSPver()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 3, "architecture_getOSlang", "getOSlang()", false, "", "");
    ConditionsMenuBar.addNewChild("cond_architecture_os", 4, "architecture_getOSlocale", "getOSlocale()", false, "", "");

    and replace


    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 0, "architecture_getOSver", "getOSver()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 1, "architecture_getSPver", "getSPver()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 2, "architecture_getOSlang", "getOSlang()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 3, "architecture_getOSlocale", "getOSlocale()", false, "", "");

    with


    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 0, "architecture_getOSver", "getOSver()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 1, "architecture_getOSvernum", "getOSvernum()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 2, "architecture_getSPver", "getSPver()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 3, "architecture_getOSlang", "getOSlang()", false, "", "");
    GrayedConditionsMenuBar.addNewChild("gcond_architecture_os", 4, "architecture_getOSlocale", "getOSlocale()", false, "", "");

    and add below


    case 'architecture_getOSver':
    HandleConditionsSelectionMenu(!InsertCondValues ? "getOSver()" : 'getOSver()=="'+getOSver()+'"');
    break;

    this code


    case 'architecture_getOSvernum':
    HandleConditionsSelectionMenu(!InsertCondValues ? "getOSvernum()" : 'getOSvernum()=="'+getOSvernum()+'"');
    break;

  4. I already have all the code to recognize win8 but it's pretty pointless since like with vista and win7 nothing that requires reboots works.

    In wmi.js it's


    if (Caption.indexOf("Windows 8") != -1)
    szOSVerCache="Win8";

    and in wpi.hta and core.js it's


    if (getOSver()=="XP" || getOSver()=="Vista" || getOSver()=="Win7" || || getOSver()=="Win8")

    instead of


    if (getOSver()=="XP" || getOSver()=="Vista" || getOSver()=="Win7")

  5. Not change, if you can support both options would be nice

    This MSI LaunchCondition:

    Installed OR (WindowsBuild >= 6002) Windows Vista Service Pack 2 or higher is required to install the Microsoft Camera Codec Pack.

    NOT (VersionNT > 601) This version of the Microsoft Camera Codec Pack is not compatible with Windows 8 or Windows Server 2012. You can get the codec pack through Windows Update on Windows 8. The codec pack is not available for Windows Server 2012.

    In WPI could look like:

    getOSver2()>="6.0.6002"&&getOSver2()<"6.1"

    It would make WPI "future proof". You wont have to add a Win9/10/11 when/if another operating system comes out it will simply work, one would just have to increase the decimal point

    You can already read the windows version number from the registry (HKLM\Software\Microsoft\Windows NT\CurrentVersion\CurrentVersion) also you can't compare versions as strings there's a function for that.

  6. Hi, found an interesting reg file which turns off the UAC, may be it will be useful for You:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000000

    Using RegShot i traced tha to undo this change it is necessary to use this:

    Windows Registry Editor Version 5.00

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System]
    "EnableLUA"=dword:00000001

    But there is one disadvantage: to make this tweak work it is necessary to reboot

    I already figured out how to disable UAC and how to set a task on reboot but until people vote I'm not writing anything since both workarounds are extremely annoying.

  7. Fix

    From installer.hta remove


    <object id="MediaPlayer" name="MediaPlayer" width="215" height="45" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">
    </object>

    and replace


    document.getElementById("MediaPlayer").url=InstallAudioPath;

    with


    document.getElementById("MediaPlayerDIV").innerHTML = '<object id="MediaPlayer" name="MediaPlayer" width="215" height="45" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject"></object>';
    document.getElementById("MediaPlayer").url=InstallAudioPath;

  8. Fix

    In registry_dos.js replace


    function fileVersionGreaterThan(fileVersion1,fileVersion2)
    {
    position="registry_dos.js";
    whatfunc="fileVersionGreaterThan()";

    var split1, split2;

    split1=fileVersion1.toString().split(".");
    split2=fileVersion2.toString().split(".");

    for (var i=0; i<split1.length; i++)
    {
    var split2item=parseInt(split2[i]);
    if ((parseInt(split1[i]) > (isNaN(split2item) ? 0 : split2item)))
    return true;
    }

    return false;
    }

    with


    function fileVersionGreaterThan(fileVersion1,fileVersion2)
    {
    position="registry_dos.js";
    whatfunc="fileVersionGreaterThan()";

    var split1 = fileVersion1.toString().split("."),
    split2 = fileVersion2.toString().split(".");

    for (var i=0; i<split1.length; i++)
    {
    var split1int = parseInt(split1[i]),
    split2int=parseInt(split2[i]);
    if (!isNaN(split2int) && (split1int < split2int))
    return false;
    else if (split1int > (isNaN(split2int) ? 0 : split2int))
    return true;
    }

    return false;
    }

  9. Fix

    In aboutupdate.js replace


    function CheckForUpdate()
    {
    position="aboutupdate.js";
    whatfunc="CheckForUpdate()";

    var iVersion, lVersion;

    UpdateAvailable=false;
    ShowUpdate();

    // if (!loadXMLDoc("http://www.internetepicenter.com/wpi.xml",ExtractUpdateInfo))
    if (!loadXMLDoc("http://www.wpiw.net/downloads/wpi.xml",ExtractUpdateInfo))
    {
    alert(getText(txtUpdateError));
    HideUpdate();

    return;
    }

    Pause(2,0);

    iVersion=ShortVersion.split(".");
    lVersion=UpdateVersion.split(".");

    if (lVersion[0]>iVersion[0])
    UpdateAvailable=true;
    else if (lVersion[0]==iVersion[0] && lVersion[1]>iVersion[1])
    UpdateAvailable=true;
    else if (lVersion[0]==iVersion[0] && lVersion[1]==iVersion[1] && lVersion[2]>iVersion[2])
    UpdateAvailable=true;
    else
    UpdateAvailable=false;

    FillInUpdate();
    document.getElementById("Btn_DownloadUpdate").disabled=!UpdateAvailable; // The opposite
    }

    with


    function CheckForUpdate()
    {
    position="aboutupdate.js";
    whatfunc="CheckForUpdate()";

    UpdateAvailable=false;
    ShowUpdate();

    if (!loadXMLDoc("http://www.wpiw.net/downloads/wpi.xml",ExtractUpdateInfo))
    {
    alert(getText(txtUpdateError));
    HideUpdate();

    return;
    }

    Pause(2,0);

    UpdateAvailable=fileVersionGreaterThan(UpdateVersion,ShortVersion);

    FillInUpdate();
    document.getElementById("Btn_DownloadUpdate").disabled=!UpdateAvailable; // The opposite
    }

  10. Fix

    In check.js replace


    function parentsAreChecked(i)
    {
    position="check.js";
    whatfunc="parentsAreChecked()";

    var j, elem;

    for (j=0; deps[i] && j<deps[i].length; j++) //run through all dependencies of prog[i]
    {
    //find parent's checkbox
    try
    {
    elem=eval("document.all." +deps[i][j]);
    }
    catch(ex)
    {
    return false;
    }

    if (elem != null)
    {
    if (!elem.checked || elem.disabled)
    return false;
    }
    }

    return true;
    }


    function parentsAreEnabled(i)
    {
    position="check.js";
    whatfunc="parentsAreEnabled()";

    var j, elem;

    for (j=0; deps[i] && j<deps[i].length; j++) //run through all dependencies of prog[i]
    {
    //find parent's checkbox
    try
    {
    elem=eval("document.all." +deps[i][j]);
    }
    catch(ex)
    {
    return false;
    }

    if (elem.disabled)
    return false;
    }

    return true;
    }

    with


    function parentsAreChecked(i)
    {
    position="check.js";
    whatfunc="parentsAreChecked()";

    for (var j=0; deps[i] && j<deps[i].length; j++) //run through all dependencies of prog[i]
    {
    var itemIndex=findProgByUID(deps[i][j]);

    if (itemIndex>0)
    {
    var itemCheckbox = document.getElementById("chkbox"+itemIndex);

    if (!itemCheckbox.checked || itemCheckbox.disabled)
    return false;
    }
    }

    return true;
    }


    function parentsAreEnabled(i)
    {
    position="check.js";
    whatfunc="parentsAreEnabled()";

    var j, elem;

    for (j=0; deps[i] && j<deps[i].length; j++) //run through all dependencies of prog[i]
    {
    var itemIndex=findProgByUID(deps[i][j]);

    if (itemIndex>0 && document.getElementById("chkbox"+itemIndex).disabled)
    return false;
    }

    return true;
    }

  11. Fix

    In themes.js replace


    function SetBoxChecked4(id)
    {
    position="themes.js";
    whatfunc="SetBoxChecked4()";

    if (LayoutStyle != 4)
    return;

    if (document.getElementById("lbl"+id).value=="Forced")
    document.getElementById("box"+id).className="forcedBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && !DisableIfDoGray)
    {
    if (document.getElementById("chkbox"+id).checked)
    document.getElementById("box"+id).className="selectedBox";
    else
    document.getElementById("box"+id).className="grayedBox";
    }
    else if (document.getElementById("lbl"+id).value=="IsGray" && DisableIfDoGray)
    document.getElementById("box"+id).className="disabledBox";
    else if (document.getElementById("chkbox"+id).disabled)
    document.getElementById("box"+id).className="disabledBox";
    else
    document.getElementById("box"+id).className="selectedBox";
    }


    function SetBoxUnchecked4(id)
    {
    position="themes.js";
    whatfunc="SetBoxUnchecked4()";

    if (LayoutStyle != 4)
    return;

    if (document.getElementById("lbl"+id).value=="Forced")
    document.getElementById("box"+id).className="forcedBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && !DisableIfDoGray)
    document.getElementById("box"+id).className="grayedBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && DisableIfDoGray)
    document.getElementById("box"+id).className="disabledBox";
    else if (document.getElementById("chkbox"+id).disabled)
    document.getElementById("box"+id).className="disabledBox";
    else
    document.getElementById("box"+id).className="normalBox";
    }


    function SetBoxEnabled4(id)
    {
    position="themes.js";
    whatfunc="SetBoxEnabled4()";

    if (LayoutStyle != 4)
    return;

    // Forced should never be an issue?
    if (document.getElementById("lbl"+id).value=="IsGray" && !DisableIfDoGray)
    document.getElementById("box"+id).className="grayedBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && DisableIfDoGray)
    document.getElementById("box"+id).className="disabledBox";
    else if (document.getElementById("chkbox"+id).checked)
    document.getElementById("box"+id).className="selectedBox";
    else
    document.getElementById("box"+id).className="normalBox";
    }


    function SetBoxDisabled4(id)
    {
    position="themes.js";
    whatfunc="SetBoxDisabled4()";

    if (LayoutStyle != 4)
    return;

    // Forced should never be an issue?
    if (document.getElementById("lbl"+id).value=="IsGray" && !DisableIfDoGray)
    document.getElementById("box"+id).className="grayedBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && DisableIfDoGray)
    document.getElementById("box"+id).className="disabledBox";
    else if (document.getElementById("chkbox"+id).checked)
    document.getElementById("box"+id).className="selectedBox";
    else
    document.getElementById("box"+id).className="disabledBox";
    }

    with


    function RefreshElement4(id)
    {
    position="themes.js";
    whatfunc="RefreshElement4()";

    if (document.getElementById("chkbox"+id).disabled || (document.getElementById("lbl"+id).value=="IsGray" && DisableIfDoGray))
    document.getElementById("box"+id).className="disabledBox";
    else if (document.getElementById("lbl"+id).value=="IsGray" && !document.getElementById("chkbox"+id).checked && (document.getElementById("lbl"+id).value!="Forced"))
    document.getElementById("box"+id).className="grayedBox";
    else if (document.getElementById("lbl"+id).value=="Forced")
    document.getElementById("box"+id).className="forcedBox";
    else if (document.getElementById("chkbox"+id).checked)
    document.getElementById("box"+id).className="selectedBox";
    else
    document.getElementById("box"+id).className="normalBox";
    }

    In check.js replace all occurrences of "SetBoxChecked4", "SetBoxUnchecked4", "SetBoxEnabled4" and "SetBoxDisabled4" with "RefreshElement4"



×
×
  • Create New...