Jump to content

lawrenca

Member
  • Posts

    129
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    United States

Posts posted by lawrenca

  1. Another mod today after a bit of feedback.

    -added logic to detect Network Drive (mapped or not) and whether run from CD-ROM

    -Fixed problem with not updated environment variable

    1. Assumes you are administrator on machine to make the registry entries required by WPI. Will add code for check with message to cancel later.

    2. Assumes you have Z as an available drive to Map...you can change this in the AutoIT script if you wish.

    3. Still need to add some tweaks for error handling.

    4. Need to modify the generate.js file to accomodate the newly imported %wpipath% and also add references to apps in config.js

    Removed code from wpi.au3 and attachments for new reply found at:

    http://www.msfn.org/board/index.php?s=&sho...ndpost&p=459322

  2. Oneless,

    You can also use the condition statement to check for existence:

    cond[pn]=[WshShell.regRead("YourRegistryKeyandSubKeyHere")==YourKeyValueHere&quot]

    to check for non-existence:

    cond[pn]=[!WshShell.regRead("YourRegistryKeyandSubKeyHere")==YourKeyValueHere&quot]

    sample:

    cond[pn]=[!WshShell.regRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB873339\DisplayName")==Windows XP Hotfix - KB873339]

  3. This is a sample from my config.js file:

    ;This FileExists condition checks to make sure I have the file available on my CD/DVD and the

    !WshShell.regRead checks to make sure the registry entry is not present...not installed on my machine...

    WshShell.regRead would check to see if the registry entry was present

    cond[pn]=['FileExists("%CDROM%\\Install\\AWEs\\AC130H_2.05.31\\setup.exe") && !WshShell.regRead("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\AC-130H\\DisplayName")=="AC-130H PFPS AWE"']

    ;This is a duplicate entry in my config.js file that will actually change the font color of the WPI checkbox entry and launch a different command if the registry entry is found...it is only dependent on the registry entry and not on file existence.

    cond[pn]=['WshShell.regRead("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\AC-130H\\DisplayName")=="AC-130H PFPS AWE"']

    ;This is the line that will change the font

    prog[pn]=['<font color=FF9900">AC-130H AWE 2.05.31 Uninstall</font&gt]

    ;as opposed to my original application installation entry

    prog[pn]=['AC-130H AWE 2.05.31']

    ;Below is the 2 complete entries I've included in my config.js file

    prog[pn]=['<font color="FF9900">AC-130H AWE 2.05.31 Uninstall</font>']
    uid[pn]=['AC130HUninstall']
    picw[pn]=['128']
    pich[pn]=['128']
    desc[pn]=['•Uninstall AC-130H PFPS AWE']
    textl[pn]=['Bottom']
    texti[pn]=['1']
    ordr[pn]=[700]
    cmd1[pn]=['"C:\\WINDOWS\\IsUninst.exe -fC:\\PFPS\\Ac130h\\AC-130H_UNINSTAL.isu" -a -y -s']
    cond[pn]=['WshShell.regRead("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\AC-130H\\DisplayName")=="AC-130H PFPS AWE"']
    configs[pn]=['No']
    cat[pn]=['Uninstall']
    pn++

    prog[pn]=['AC-130H AWE 2.05.31']
    uid[pn]=['AC130HAWE20531']
    picw[pn]=['128']
    pich[pn]=['128']
    desc[pn]=['•Prepare AC-130H mission data']
    textl[pn]=['Bottom']
    texti[pn]=['1']
    ordr[pn]=[700]
    cmd1[pn]=['"%CDROM%\\Install\\AWEs\\AC130H_2.05.31\\setup.exe" /SMS /s']
    dflt[pn]=['yes']
    cond[pn]=['FileExists("%CDROM%\\Install\\AWEs\\AC130H_2.05.31\\setup.exe") && !WshShell.regRead("HKLM\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\AC-130H\\DisplayName")=="AC-130H PFPS AWE"']
    configs[pn]=['yes']
    cat[pn]=['AWEs']
    pn++

    ;One last important change that must be made to your boxes.js file, unless you want to see several dialogs "treating statement as a false condition". You must comment out or delete the condition presenting you this dialog box (3rd line from the bottom of the render block of code (//alert("Error in condition statement for " + prog + ":\n\n" + cond + "\n\nTreating as a false condition.");)

    //
    // Render
    //
    debug("Rendering of boxes started",1); tabs++;
    txt += ('<a name="#pg1"></a>');
    txt += ('<table class="tclass" cellspacing=0 cellpadding=0><tr class="rtclass"><td width="' + colwidth + '%" valign="top" nowrap>');
    for (i=1; (prog[i]!=null); i++) // for defined programs do ...
    {
    // We only display things that pass condition tests, unless we are in debug mode.
    //
    if(cond[i] && cond[i][0]) {
    var c = unescape(replpath(cond[i][0]).replace(/\\/g, "\\\\"));
    try {
    if(!eval©) {
    debug("Condition failed: " + c + " -- not rendering " + prog[i], 1);
    continue;
    }
    } catch(e) {
    //alert("Error in condition statement for " + prog[i] + ":\n\n" + cond[i] + "\n\nTreating as a false condition.");
    continue;

×
×
  • Create New...