Jump to content

[Feature] TimedWaitForWindow and CloseWindow


Recommended Posts

Description

An alternative to abruptly terminating processes with TASKKILL.

Changes

In jscript.js before

function TimedWaitForProgram(ImageName,HowLong)

add

function TimedWaitForWindow(WindowName,HowLong){ 	position="jscript.js";	whatfunc="TimedWaitForWindow()";		RunCmd('"' + wpipath + '\\Tools\\WPI Tool.exe" /Action=WaitForWindow /WindowName="' + WindowName + '" /Timeout=' + HowLong, false, true);}

In configwizard.js replace

CommandsMenuBar.addNewChild("jscript_dos", 3, "jscript_setEnvVar", "setEnvVar()", false, "", "");	CommandsMenuBar.addNewChild("jscript_dos", 4, "jscript_removeEnvVar", "removeEnvVar()", false, "", "");	CommandsMenuBar.addNewChild("jscript_dos", 5, "jscript_FormatDrive", "FormatDrive()", false, "", "");

with

CommandsMenuBar.addNewChild("jscript_dos", 3, "jscript_TimedWaitForWindow", "TimedWaitForWindow()", false, "", "");					CommandsMenuBar.addNewChild("jscript_dos", 4, "jscript_setEnvVar", "setEnvVar()", false, "", "");					CommandsMenuBar.addNewChild("jscript_dos", 5, "jscript_removeEnvVar", "removeEnvVar()", false, "", "");					CommandsMenuBar.addNewChild("jscript_dos", 6, "jscript_FormatDrive", "FormatDrive()", false, "", "");

and

CommandsMenuBar.addNewChild("cmd_other", 3, "other_sleep", "Sleep", false, "", "");     CommandsMenuBar.addNewChild("cmd_other", 4, "other_reboot", "Reboot", false, "", "");

with

CommandsMenuBar.addNewChild("cmd_other", 3, "other_closewindow", "CloseWindow", false, "", ""); 			CommandsMenuBar.addNewChild("cmd_other", 4, "other_sleep", "Sleep", false, "", ""); 			CommandsMenuBar.addNewChild("cmd_other", 5, "other_reboot", "Reboot", false, "", "");

and before

case 'jscript_CreateRegKey':

add

case 'jscript_TimedWaitForWindow':			HandleCommandsSelectionMenu('{JSCRIPT}=TimedWaitForProgram("Setup",10)');			break;

and before

case 'other_sleep':

add

case 'other_closewindow':			HandleCommandsSelectionMenu("{CLOSEWINDOW} WindowName");			break;

In installer.js before

case 'SLEEP':

add

case 'CLOSEWINDOW':				cmd="\"" + wpipath + "\\Tools\\WPI Tool.exe\" /Action=CloseWindow /WindowName=\"" + cmd + "\"";				fsoCmd=true;				break;

In the Tools folder add the WPI Tool.exe attached to this post

WPI Tool.exe

Edited by Francesco
Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...