You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6835 lines
204 KiB
6835 lines
204 KiB
<HTML>
|
|
<HEAD>
|
|
<TITLE>Microsoft Out-of-Box Experience</TITLE>
|
|
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<LINK REL="stylesheet" TYPE="text/css" HREF="setup\oobestyl.css">
|
|
|
|
<!-- Begin Agent Specific Code -->
|
|
|
|
<!-- The majority of the Agent code is in AgtCore.js -->
|
|
<!-- The AgtXXXX.js files contain all of the script -->
|
|
<!-- code that needs to be localized. -->
|
|
<!-- NOTE: Agent is not initialized until the first -->
|
|
<!-- time someone clicks on the Assistant image. -->
|
|
|
|
<script language=jscript src="AgtCore.js"></script>
|
|
<script language=jscript src="AgtScrpt.js"></script>
|
|
|
|
<!-- Agent Event Handler Declarations -->
|
|
|
|
<script language=jscript for=Agent event="Command(userInput)")>
|
|
Agent_OnCommand(userInput);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="Hide(characterID)">
|
|
Agent_OnHide(characterID);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="IdleStart(characterID)">
|
|
Agent_OnIdleStart(characterID);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="IdleComplete(characterID)">
|
|
Agent_OnIdleComplete(characterID);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="Bookmark(id)">
|
|
Agent_OnBookmark(id);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="Click(characterID, button, shift, x, y)">
|
|
Agent_OnClick(characterID, button, shift, x, y);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="DragComplete(characterID, button, shift, x, y)">
|
|
Agent_OnDragComplete(characterID, button, shift, x, y);
|
|
</script>
|
|
|
|
<script language=jscript for=Agent event="RequestComplete(request)">
|
|
Agent_OnRequestComplete(request);
|
|
</script>
|
|
|
|
|
|
<!-- End Agent Specific Code -->
|
|
|
|
<!-- Windows Media Player sends this event upon any error it encounters -->
|
|
<script language=jscript for=IntroAnimation event="error()">
|
|
if (IntroAnimation.playState!=3)
|
|
{
|
|
VideoGoNext('Error');
|
|
}
|
|
</Script>
|
|
|
|
<!-- Windows Media Player sends this event upon any changes in the play state -->
|
|
<script language=jscript for=IntroAnimation event="PlayStateChange(bResult)">
|
|
if (bResult==3)
|
|
{
|
|
trace("PlayStateChange " + bResult);
|
|
try
|
|
{
|
|
IntroAnimation.fullscreen = "true";
|
|
}
|
|
catch(err)
|
|
{
|
|
var temp = "EXCEPTION THROWN: WMP control failed to go to full screen.";
|
|
temp += "\rerror name: " + err.name;
|
|
temp += "\rmessage: " + err.message;
|
|
temp += "\rnumber: " + err.number;
|
|
temp += "\rdescription: " + err.description;
|
|
trace(temp);
|
|
}
|
|
g_fHasPlayed=true;
|
|
}
|
|
else if ( g_fHasPlayed || (bResult==8) )
|
|
{
|
|
trace("PlayStateChange " + bResult);
|
|
VideoGoNext('PlayStateChanged');
|
|
}
|
|
</script>
|
|
|
|
<script language=jscript src="mousetut.js"></script>
|
|
|
|
<script language=jscript src="oobeutil.js"></script>
|
|
|
|
<script language=jscript src="migrate.js"></script>
|
|
|
|
<script language=jscript src="dialmgr.js"></script>
|
|
|
|
<script language=jscript src="error.js"></script>
|
|
|
|
<script language=jscript src="icsmgr.js"></script>
|
|
|
|
<script language=jscript src="isptype.js"></script>
|
|
|
|
<script language=jscript src="iconnect.js"></script>
|
|
|
|
<script language=jscript src="dslmain.js"></script>
|
|
|
|
<script language=jscript src="sconnect.js"></script>
|
|
|
|
<script language=jscript>
|
|
|
|
// This is intended to hold all the script needed
|
|
// in the default & offline OOBE HTML pages.
|
|
//
|
|
// We want to separate the layout (HTML) from the script.
|
|
// At the same time, it's helpful to have all the code
|
|
// in one place to make it easier to understand the flow
|
|
// from page to page.
|
|
|
|
var APP_OOBE_MODE = 0;
|
|
var APP_MSN_MODE = 4;
|
|
var APP_DESKTOP_MODE = 2;
|
|
|
|
// Windows Media Player variable
|
|
var g_fHasPlayed = false;
|
|
var g_VideoEvent = null;
|
|
|
|
// Status location constants
|
|
var STATUS_ISP = 0; // Do either MSN or local OEM offer
|
|
var STATUS_PRECONFIG = 1; // Do the pre-configured OEM INS file
|
|
var STATUS_NONE = 2; // Don't do any ISP offer
|
|
var STATUS_OFF = 3; // Don't connect to the Internet
|
|
var STATUS_MAX = 4;
|
|
// var SNDX_WELCOME = 0;
|
|
var SNDX_MSN_ISP = 1;
|
|
var SNDX_MSN_REG = 2;
|
|
var SNDX_MSN_FINISH = 3;
|
|
var SNDX_OEM_REG = 1;
|
|
var SNDX_OEM_ISP = 2;
|
|
var SNDX_OEM_FINISH = 3;
|
|
var SNDX_NONE_REG = 1;
|
|
var SNDX_NONE_FINISH = 2;
|
|
var SNDX_OFF_EULA = 1;
|
|
var SNDX_OFF_PID = 2;
|
|
var SNDX_OFF_FINISH = 3;
|
|
|
|
// OLD STATUS PANE FOR B1
|
|
// var SNDX_WELCOME = 0;
|
|
// var SNDX_HW1 = 1;
|
|
// var SNDX_HW2 = 2;
|
|
// var SNDX_HW3 = 3;
|
|
// var SNDX_LEGAL1 = 4;
|
|
// var SNDX_LEGAL2 = 5;
|
|
// var SNDX_REG1 = 6;
|
|
// var SNDX_REG2 = 7;
|
|
// var SNDX_ISP = 8;
|
|
// var SNDX_FINI = 9;
|
|
|
|
// For the new status pane, don't allow half way status
|
|
var SNDX_WELCOME = 0;
|
|
var SNDX_HW = 1;
|
|
var SNDX_LEGAL = 2;
|
|
var SNDX_REG = 3;
|
|
var SNDX_ISP = 4;
|
|
var SNDX_IDENTITIES = 5;
|
|
var SNDX_FINI = 6;
|
|
|
|
// holds non-checkpoint next navigation
|
|
var g_SimpleNavMap = null;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// CheckPoint
|
|
//
|
|
// Constructor for CheckPoint object.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function CheckPoint(strURL, i1, i2, i3, i4)
|
|
{
|
|
this.strURL = strURL;
|
|
this.rgindex = new Array(STATUS_MAX);
|
|
this.rgindex[STATUS_ISP] = i1;
|
|
this.rgindex[STATUS_PRECONFIG] = i2;
|
|
this.rgindex[STATUS_NONE] = i3;
|
|
this.rgindex[STATUS_OFF] = i4;
|
|
}
|
|
|
|
var curCKPT = 1;
|
|
var CKPT_ANIMATION = curCKPT++;
|
|
var CKPT_HWCHK = curCKPT++;
|
|
var CKPT_WELCOME = curCKPT++;
|
|
var CKPT_MOUSETUT1 = curCKPT++;
|
|
var CKPT_IMETUTORIAL = curCKPT++;
|
|
var CKPT_OEMHW = curCKPT++;
|
|
var CKPT_REGION_KEYBD = curCKPT++;
|
|
var CKPT_REGKB_COMMIT = curCKPT++;
|
|
var CKPT_TIMEZONE = curCKPT++;
|
|
var CKPT_EULA = curCKPT++;
|
|
var CKPT_EULA_DECLINE = curCKPT++;
|
|
var CKPT_PRODUCTKEY = curCKPT++;
|
|
var CKPT_BADPRODUCTKEY = curCKPT++;
|
|
var CKPT_COMPNAME = curCKPT++;
|
|
var CKPT_SECPASS = curCKPT++;
|
|
var CKPT_JNDOMAIN = curCKPT++;
|
|
var CKPT_ICSCHOICE = curCKPT++;
|
|
var CKPT_HOMENETWIZPROMPT = curCKPT++;
|
|
var CKPT_DSLMAIN = curCKPT++;
|
|
var CKPT_DSLPPPOE = curCKPT++;
|
|
var CKPT_DSLBROADBAND = curCKPT++;
|
|
var CKPT_CONGRATS = curCKPT++;
|
|
var CKPT_ACTIVATION = curCKPT++;
|
|
var CKPT_REGISTER1 = curCKPT++;
|
|
var CKPT_REGISTER3 = curCKPT++;
|
|
var CKPT_ACT_MSG = curCKPT++;
|
|
var CKPT_ICONN = curCKPT++;
|
|
var CKPT_ISPSIGNUP = curCKPT++;
|
|
var CKPT_MIGLIST = curCKPT++;
|
|
var CKPT_ISPDIAL = curCKPT++;
|
|
var CKPT_REFDIAL = curCKPT++;
|
|
var CKPT_MIGDIAL = curCKPT++;
|
|
var CKPT_REGDIAL = curCKPT++;
|
|
var CKPT_ISPTYPE = curCKPT++;
|
|
var CKPT_ICONNECT = curCKPT++;
|
|
var CKPT_SCONNECT = curCKPT++;
|
|
var CKPT_OEMISP = curCKPT++;
|
|
var CKPT_OEMCUST = curCKPT++;
|
|
var CKPT_IDENTITIES2 = curCKPT++;
|
|
var CKPT_DONE = curCKPT++;
|
|
var CKPT_MAX = curCKPT; // ALWAYS set this to be the biggest value!
|
|
|
|
var dnCKPT = new Array(CKPT_MAX);
|
|
|
|
|
|
// Checkpoint breadcrumbs
|
|
var g_CurrentCKPT = null;
|
|
var g_DialCKPT = null;
|
|
var HKEY_LOCAL_MACHINE = 0x80000002;
|
|
var REGISTERED_OWNER_KEY = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion";
|
|
var REGISTERED_OWNER_VALUE = "RegisteredOwner";
|
|
var OOBE_MAIN_REG_KEY = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Setup\\OOBE";
|
|
var CLSID_FLASH_PLAYER = "{D27CDB6E-AE6D-11cf-96B8-444553540000}";
|
|
var PROGID_FLASH_PLAYER = "ShockwaveFlash.ShockwaveFlash";
|
|
var CKPT_REG_KEY = "\\CKPT";
|
|
var TOS_REG_VALUE = "TopOfStack";
|
|
|
|
// Preferred connection registry settings
|
|
var PREFCONN_REG_VALUE = "PreferredConnection";
|
|
|
|
var POWERDOWN_SHUTDOWN = 0;
|
|
var POWERDOWN_REBOOT = 1;
|
|
|
|
// CheckDialReady errors
|
|
var ERR_COMM_NO_ERROR = 0;
|
|
var ERR_COMM_OOBE_COMP_MISSING = 1;
|
|
var ERR_COMM_UNKNOWN = 2; // Unknown error, check input parameters
|
|
var ERR_COMM_NOMODEM = 3; // There is no modem installed
|
|
var ERR_COMM_RAS_TCP_NOTINSTALL = 4;
|
|
var ERR_COMM_ISDN = 5;
|
|
var ERR_COMM_PHONE_AND_ISDN = 6;
|
|
|
|
// Dialing errors. Look at raserror.h for details
|
|
var DERR_DIALTONE = 680;
|
|
var DERR_BUSY = 676;
|
|
var DERR_VOICEANSWER = 677;
|
|
var DERR_NOANSWER = 678;
|
|
var DERR_NO_CARRIER = 679;
|
|
var DERR_HARDWARE_FAILURE = 630; // modem turned off
|
|
var DERR_PORT_ALREADY_OPEN = 602; // procomm/hypertrm/RAS has COM port
|
|
var DERR_PORT_OR_DEVICE = 692; // got this when hypertrm had the device open -- jmazner
|
|
var DERR_PPP_TIMEOUT = 718;
|
|
var DERR_REMOTE_DISCONNECT = 629; // Connection interrupted
|
|
|
|
// Types of dialing using ISP files. e.g. Dial to registration, ISP, referral server
|
|
var CONNECTED_REFFERAL = 1
|
|
var CONNECTED_ISP_SIGNUP = 2
|
|
var CONNECTED_ISP_MIGRATE = 3
|
|
var CONNECTED_REGISTRATION = 4
|
|
|
|
// Computer name page return codes
|
|
//
|
|
var COMPNAME_SUCCESS = 0;
|
|
var COMPNAME_INVALIDNAME = 1;
|
|
|
|
// Finish errors
|
|
//
|
|
// These MUST be kept in sync with the values in MSOBMAIN.H.
|
|
//
|
|
var FINISH_OK = 0x00000000;
|
|
var FINISH_REBOOT = 0x00000001;
|
|
var FINISH_BAD_PID = 0x00000002;
|
|
var FINISH_BAD_EULA = 0x00000004;
|
|
var FINISH_BAD_STAMP = 0x00000008;
|
|
|
|
// Net Join Status
|
|
//
|
|
// These MUST be kept in sync with the values in MSOBMAIN.H.
|
|
//
|
|
var JOIN_STATUS_UNKNOWN = 0;
|
|
var JOIN_STATUS_UNJOINED = 1;
|
|
var JOIN_STATUS_WORKGROUP = 2;
|
|
var JOIN_STATUS_DOMAIN = 3;
|
|
|
|
// Language reboot return codes
|
|
var LANGUAGE_REBOOT_NEVER = 0;
|
|
var LANGUAGE_REBOOT_NOW = 1;
|
|
var LANGUAGE_REBOOT_END = 2;
|
|
|
|
// Dictionary compare modes
|
|
var COMPAREMODE_BINARY = 0;
|
|
var COMPAREMODE_TEXT = 1;
|
|
|
|
// on-the-fly button hiding
|
|
var HIDE_BACK = 0x0001;
|
|
var HIDE_NEXT = 0x0002;
|
|
var HIDE_CANCEL = 0x0004;
|
|
var HIDE_RESTORE = 0x0008;
|
|
|
|
// keycode consts
|
|
var KeyEsc = 0x1B;
|
|
var KeyEnter = 0xD;
|
|
var KeyBackSpc = 0x8;
|
|
var KeyDelete = 0x2E;
|
|
var KeyTab = 0x9;
|
|
var KeyDwnArrow = 0x28;
|
|
var KeyUpArrow = 0x26;
|
|
var KeyLeftArrow = 0x25;
|
|
var KeyRightArrow = 0x27;
|
|
|
|
// BUGBUG temp GUIDs
|
|
var NOLAUNCHISPSIGNUP = "{C37D92A5-CA34-11d2-B71C-00C04F794977}";
|
|
var MSNCOMPLETED = "{1C0A22F2-CB6B-11d2-B544-00A0C949DA70}";
|
|
var LANGUAGECOMPLETED = "{F744DA40-617C-11D3-8B99-00A0C91E7F3C}";
|
|
var MS_REGISTRATION = "{1C956940-8617-11D3-8B99-00A0C91E7F3C}";
|
|
var OEM_REGISTRATION = "{ECD24360-B210-11D3-8B99-00A0C91E7F3C}";
|
|
|
|
// window.external object caches
|
|
var TapiObj = null;
|
|
var InfoObj = null;
|
|
var EulaObj = null;
|
|
var LangObj = null;
|
|
var PidObj = null;
|
|
var StatusObj = null;
|
|
var DirObj = null;
|
|
var ApiObj = null;
|
|
var SysClockObj = null;
|
|
var RegisterObj = null;
|
|
var FileSystemObj = null;
|
|
var g_Identities2_OK;
|
|
|
|
// Localizeable strings for username.htm "Personalize your copy of Windows"
|
|
var L_Blank_Text = "";
|
|
var L_Administrator_Text = "ADMINISTRATOR";
|
|
var L_Guest_Text = "GUEST";
|
|
|
|
// general globals and status
|
|
var g_strISPFile = "";
|
|
var g_bStartup;
|
|
var g_LastButtonText = null;
|
|
var g_FirstFocusElement = null;
|
|
var g = null;
|
|
var g_SpecialChars = ".'-` ";
|
|
var g_OOBEDir = "file://" + window.external.API.get_SystemDirectory() + "\\oobe\\";
|
|
var g_OOBEDirPath = window.external.API.get_SystemDirectory() + "\\oobe\\";
|
|
var g_bRedial = false;
|
|
var g_LineProblem = 0;
|
|
var g_bFirstServerError = true;
|
|
var g_status = STATUS_OFF;
|
|
var g_ServerErrorCount = 0;
|
|
var g_IMEExists = false;
|
|
var g_OEMAddBackURL = "";
|
|
var g_DialingAvailableInCountry = true;
|
|
var g_ModalDialogUp = false;
|
|
var bKeyboardPresent = true;
|
|
var bMousePresent = true;
|
|
var g_OEMNameStr = window.external.Signup.get_OEMName();
|
|
var g_bTapiDone = false;
|
|
var g_CompNameChangeComplete = false;
|
|
var g_fFirewallRequired = false;
|
|
var g_bIsSetupUpgrade = false;
|
|
var g_bInHighScreenRes = false;
|
|
|
|
// We use the DisplayIcsCongratsPage so that we wont come back
|
|
// to the congratulations page after passing it.
|
|
var DisplayIcsCongratsPage = true;
|
|
|
|
|
|
// We use g_DidWePassWelcomePage so that the users will not see the mouse tutorial
|
|
// again if the users clicked next on the welcome page and then back again. This variable is set to true in the GoNext function.
|
|
var g_DidWePassWelcomePage = false;
|
|
|
|
|
|
// Mandatory Initialization Code
|
|
if (null == FileSystemObj) {
|
|
FileSystemObj = new ActiveXObject("Scripting.FileSystemObject");
|
|
}
|
|
|
|
if (null == ApiObj)
|
|
{
|
|
ApiObj = new Object;
|
|
ApiObj = window.external.API;
|
|
}
|
|
if (null == StatusObj)
|
|
{
|
|
StatusObj = new Object;
|
|
StatusObj = window.external.Status;
|
|
}
|
|
if (null == DirObj)
|
|
{
|
|
DirObj = new Object;
|
|
DirObj = window.external.Directions;
|
|
}
|
|
if (null == InfoObj)
|
|
{
|
|
InfoObj = new Object;
|
|
InfoObj = window.external.UserInfo;
|
|
}
|
|
if (null == TapiObj)
|
|
{
|
|
TapiObj = new Object;
|
|
TapiObj = window.external.Tapi;
|
|
}
|
|
if (null == RegisterObj)
|
|
{
|
|
RegisterObj = new Object;
|
|
RegisterObj = window.external.Register;
|
|
}
|
|
if (null == SysClockObj)
|
|
{
|
|
SysClockObj = new Object;
|
|
SysClockObj = window.external.SystemClock;
|
|
SysClockObj.Init();
|
|
}
|
|
|
|
if (null == LangObj)
|
|
{
|
|
LangObj = new Object;
|
|
LangObj = window.external.Language;
|
|
}
|
|
|
|
// END Initialization Code
|
|
|
|
// another global, need DirObj first though
|
|
var g_AgentDisabled = (DirObj.get_AgentDisabled() || DirObj.get_IntroOnly());
|
|
|
|
var L_ContStr_Text="To continue, click";
|
|
var L_NextStr_Text="Next";
|
|
var L_Period_Text=".";
|
|
var L_ClickNextLocStr_Text=""; // for localizers to add stuff without affecting L_Period_Text
|
|
|
|
var L_NextStrTopPercent_Text="83%";
|
|
var L_ClickNextStrTopPercent800_Text="78%";
|
|
var L_ClickNextStrTopPercent1024_Text="84%";
|
|
var L_ClickNextStrLeftPercent_Text="30%";
|
|
|
|
var g_ClickNextStr = " "
|
|
|
|
var g_ClickNextStrWelcome = "";
|
|
|
|
// Set up labelS for various getting connected Congratulations.
|
|
var L_ConnectedDefaultHeading_Text = "Congratulations";
|
|
var L_ConnectedNoInternetHeading_Text = "Could not find the Internet";
|
|
|
|
var L_ConnectedDefault_Text = "You are now connected to the Internet.";
|
|
var L_ConnectedViaICS_Text = "You are now connected to the Internet using ICS connection.";
|
|
var L_ConnectedViaDSLCable_Text = "You are now connected to the Internet via your DSL/Cable connection.";
|
|
var L_ConnectedViaLAN_Text = "You are now connected to the Internet using your LAN connection.";
|
|
var L_ConnectedNoInternet_Text = "Windows was not able to connect to the Internet using your network hardware. You can connect to the Internet later by clicking the Start button, then click <B>Internet</B>. Please click the <B>Next</B> button below to continue setting up Windows.";
|
|
|
|
|
|
var g_Congrats_Type_Heading = L_ConnectedDefaultHeading_Text;
|
|
var g_Congrats_Type = L_ConnectedDefault_Text;
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// logError
|
|
//
|
|
// Log information from an error object. trace will send the info to
|
|
// setuplog.txt and the debugger. If
|
|
// HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\OOBE\MsDebug=DWORD:1
|
|
// an alert will be displayed as well.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function logError(funcName, errObj)
|
|
{
|
|
trace( "Exception in " + funcName
|
|
+ " (" + errObj.number.toString(16) + ") "
|
|
+ errObj.description + "\n"
|
|
);
|
|
if (true == DebugObj.get_MsDebugMode())
|
|
{
|
|
alert("OOBE ERROR\n"
|
|
+ "\n Function: " + funcName
|
|
+ "\n Error: " + errObj.number.toString(16)
|
|
+ "\nDescription: " + errObj.description
|
|
);
|
|
}
|
|
}
|
|
|
|
var g_ip_regex = /^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/
|
|
|
|
function validate_ip_addr(ip_addr)
|
|
{
|
|
ip_re = new RegExp(g_ip_regex);
|
|
if (! ip_re.test(ip_addr))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
ip_a = parseInt(RegExp.$1);
|
|
ip_b = parseInt(RegExp.$2);
|
|
ip_c = parseInt(RegExp.$3);
|
|
ip_d = parseInt(RegExp.$4);
|
|
|
|
if ( (ip_a < 1 || ip_a > 223)
|
|
|| (ip_b < 0 || ip_b > 255)
|
|
|| (ip_c < 0 || ip_c > 255)
|
|
|| (ip_d < 0 || ip_d > 255)
|
|
)
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
} // validate_ip_addr
|
|
|
|
function validate_subnet_mask(subnet_mask)
|
|
{
|
|
ip_re = new RegExp(g_ip_regex);
|
|
if (! ip_re.test(subnet_mask))
|
|
{
|
|
return false;
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
|
|
} // validate_subnet_mask
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// IMETut1.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// imetut_LoadMe
|
|
//
|
|
// onload event handler for IMETut1.htm.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function imetut_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
g_FirstFocusElement = g.btnNextText;
|
|
|
|
if (1 != DirObj.get_DoRegionalKeyboard())
|
|
HideButtons(HIDE_BACK);
|
|
|
|
InitNewButtons();
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// welcome.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// Start_OnKeyPress
|
|
//
|
|
// onkeypress handler for welcome.htm
|
|
//
|
|
// Treats the Enter key like the Next button. Filters out invalid keys.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function Start_OnKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Treat the enter key like the next button
|
|
if ((g.event.keyCode == KeyEnter) && (g.btnNext.disabled == false))
|
|
{
|
|
GoNext();
|
|
}
|
|
else
|
|
{
|
|
KeyPressIsValid();
|
|
}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// CompName.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
var g_ComputerDescription = null;
|
|
// Function: CompName_LoadMe
|
|
// Description: This function is called after CompName.htm is loaded to
|
|
// initialize display and state.
|
|
//
|
|
function CompName_LoadMe()
|
|
{
|
|
|
|
InitFrameRef();
|
|
|
|
|
|
if (null != g.lblCompName)
|
|
{
|
|
g.lblCompName.className = "text-primary";
|
|
}
|
|
|
|
if (null != g.lblCompDesc)
|
|
{
|
|
g.lblCompDesc.className = "text-primary";
|
|
}
|
|
|
|
if (null != g.txtCompName)
|
|
{
|
|
g.txtCompName.value = ApiObj.get_ComputerName( );
|
|
g_FirstFocusElement = g.txtCompName;
|
|
g_FirstFocusElement.select();
|
|
}
|
|
else
|
|
{
|
|
g_FirstFocusElement = g.btnNext;
|
|
}
|
|
|
|
// Make sure the Computername edit field is enabled
|
|
g.txtCompName.style.backgroundColor='#ffffff';
|
|
g.txtCompName.disabled=false;
|
|
|
|
g.txtCompDesc.style.backgroundColor='#ffffff';
|
|
g.txtCompDesc.disabled=false;
|
|
|
|
g_FirstFocusElement.focus();
|
|
|
|
InitNewButtons();
|
|
}
|
|
|
|
// Function: CompName_OnNext
|
|
// Description: Determines whether the name the user has entered is different
|
|
// from the current system name. If it is, the new system name is saved and
|
|
// true is returned indicating that the system needs to be rebooted.
|
|
//
|
|
|
|
function CompName_OnNext()
|
|
{
|
|
if (ApiObj.ValidateComputername(g.txtCompName.value))
|
|
{
|
|
if (null != g.lblCompName)
|
|
{
|
|
g.lblCompName.className = "text-primary";
|
|
}
|
|
|
|
if (ApiObj.get_ComputerName() != g.txtCompName.value)
|
|
{
|
|
ApiObj.set_ComputerName(g.txtCompName.value);
|
|
// tell oobe that the user change the name.
|
|
window.external.ComputerNameDifferent();
|
|
PopCKPT(CKPT_COMPNAME);
|
|
PushCKPT(CKPT_SECPASS);
|
|
}
|
|
|
|
// Disable the Computername edit field
|
|
g.txtCompName.style.backgroundColor='#dddddd';
|
|
g.txtCompName.disabled=true;
|
|
|
|
g.txtCompDesc.style.backgroundColor='#dddddd';
|
|
g.txtCompDesc.disabled=true;
|
|
g_ComputerDescription = g.txtCompDesc.value;
|
|
|
|
// Give the system some time to paint and then call the function
|
|
// which start the process as a thread.
|
|
//
|
|
window.setTimeout("CompName_ChangeComplete(true);",50);
|
|
return COMPNAME_SUCCESS;
|
|
}
|
|
else
|
|
{
|
|
if (null != g.lblCompName)
|
|
{
|
|
g.lblCompName.className = "text-error";
|
|
}
|
|
|
|
if (null != g.txtCompName)
|
|
{
|
|
g_FirstFocusElement = g.txtCompName;
|
|
}
|
|
|
|
if (null != g.btnNext)
|
|
{
|
|
g.btnNext.disabled=false;
|
|
}
|
|
if (null != g.btnBack)
|
|
{
|
|
g.btnBack.disabled=false;
|
|
}
|
|
if (null != g.btnSkip)
|
|
{
|
|
g.btnSkip.disabled=false;
|
|
}
|
|
|
|
g.lblCompNameError.style.display = "inline";
|
|
g.spnCompName_Primary21.className = "text-error";
|
|
|
|
InitNewButtons();
|
|
|
|
if (null != g_FirstFocusElement)
|
|
{
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
return COMPNAME_INVALIDNAME;
|
|
}
|
|
}
|
|
|
|
function ServicesStartedDone()
|
|
{
|
|
g.document.body.style.cursor = "default";
|
|
// Remove this page from the checkpoint history. WinLogon will
|
|
// have started services dependent on the computer name so we don't
|
|
// want to let the user change it again.
|
|
//
|
|
PopCKPT(CKPT_COMPNAME);
|
|
|
|
// Update the status menu, need to do this after the services are started
|
|
InitStatusMenu();
|
|
GoNavigate(CKPT_SECPASS);
|
|
}
|
|
|
|
// Function: CompName_ChangeComplete
|
|
// Description: Notifies msobmain that the computer name change is complete and
|
|
// initializes the status menu.
|
|
//
|
|
// This is code common to all cases where the computer name page is skipped.
|
|
//
|
|
function CompName_ChangeComplete(Thread)
|
|
{
|
|
if (g_CompNameChangeComplete) return;
|
|
|
|
g_CompNameChangeComplete = true;
|
|
|
|
if (! window.external.get_RetailOOBE())
|
|
{
|
|
if (g_ComputerDescription)
|
|
{
|
|
ApiObj.set_ComputerDesc(g_ComputerDescription);
|
|
}
|
|
window.external.ComputerNameChangeComplete(Thread);
|
|
}
|
|
if (!Thread)
|
|
{
|
|
// since this is sync call do this here. In the async case it is done
|
|
// in the function which is called when the thread finishes. ServicesStartedDone
|
|
//
|
|
// Update the status menu, need to do this after the services are started
|
|
InitStatusMenu();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// Welcome.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Function: Start_LoadMe
|
|
// Description: This function is called after start.htm is
|
|
// loaded. we then initialize Items on the page.
|
|
// we also populate the edits with any values already
|
|
// found in the registry.
|
|
//
|
|
|
|
function Start_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
g.btnNext.disabled = false;
|
|
|
|
var strOEMName = g_OEMNameStr;
|
|
|
|
var FirstName=window.external.UserInfo.get_FirstName();
|
|
var LastName=window.external.UserInfo.get_LastName();
|
|
var NameStr = "";
|
|
|
|
if((FirstName.length>0) || (LastName.length>0)) {
|
|
|
|
// get the right # of spaces b/w words
|
|
// The name formed here should be done the same was as the owner name in
|
|
// Save_Registered_owner.
|
|
|
|
if(FirstName!=null) {
|
|
NameStr=FirstName;
|
|
}
|
|
if(LastName!=null && LastName!="") {
|
|
if(NameStr!="") {
|
|
var L_UserFullName_Text = "%1 %2";
|
|
NameStr = ApiObj.FormatMessage(L_UserFullName_Text, NameStr, LastName);
|
|
} else {
|
|
NameStr=LastName;
|
|
}
|
|
}
|
|
}
|
|
|
|
if (!window.external.get_RetailOOBE())
|
|
{
|
|
if (strOEMName.length != 0)
|
|
{
|
|
if (NameStr != "")
|
|
{
|
|
var L_NameAndOEM_Text = "Welcome %1, thank you for purchasing this computer from %2 featuring Microsoft Windows XP.";
|
|
|
|
g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndOEM_Text, NameStr, strOEMName);
|
|
}
|
|
else
|
|
{
|
|
var L_OEM_Text = "Thank you for purchasing this computer from %1 featuring Microsoft Windows XP.";
|
|
|
|
g.welcome_namestr.innerText = ApiObj.FormatMessage(L_OEM_Text, strOEMName);
|
|
}
|
|
}
|
|
else // No OEM name
|
|
{
|
|
if (NameStr != "")
|
|
{
|
|
var L_NameAndGen_Text = "Welcome %1, thank you for purchasing this computer featuring Microsoft Windows XP.";
|
|
|
|
g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndGen_Text, NameStr);
|
|
}
|
|
else
|
|
{
|
|
var L_Gen_Text = "Thank you for purchasing this computer featuring Microsoft Windows XP.";
|
|
|
|
g.welcome_namestr.innerText = L_Gen_Text;
|
|
}
|
|
}
|
|
}
|
|
else // Retail
|
|
{
|
|
if (NameStr != "")
|
|
{
|
|
var L_NameAndXP_Text = "Welcome %1, thank you for purchasing Microsoft Windows XP.";
|
|
|
|
g.welcome_namestr.innerText = ApiObj.FormatMessage(L_NameAndXP_Text, NameStr);
|
|
}
|
|
}
|
|
|
|
g.WelcomePageText.style.display="inline";
|
|
|
|
InitNewButtons();
|
|
|
|
if (DirObj.get_DoWelcomeFadeIn())
|
|
{
|
|
// this entire 'junkspan' sequence is done so that the necessary DLL's for blendtrans
|
|
//(ddraw.dll/ddrawex.dll/dxtmsft.dll/dxtrans.dll/atl.dll) are preloaded before the
|
|
// real blend is done after the movie
|
|
|
|
junkspan.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
|
|
junkspan.filters[0].duration=0.1;
|
|
junkspan.filters[0].enabled=true;
|
|
junkspan.filters[0].Apply();
|
|
junkspan.style.backgroundColor="red";
|
|
junkspan.style.display="inline";
|
|
junkspan.filters[0].Play();
|
|
|
|
junkspan.style.display="none";
|
|
junkspan.filters[0].enabled=false;
|
|
junkspan.style.filter=null;
|
|
|
|
// transition still not visible on direct boot, too much disk activity
|
|
// 7 seconds appears to be visible. may need to fine tune that 4.5 number.
|
|
// want to consider machine speed as well, longer number may be too long
|
|
// for slow machine? (or you may need longer, since it takes longer to load?)
|
|
// want fast machine to work well
|
|
|
|
RunWelcomeFadeIn(3.0);
|
|
|
|
}
|
|
else
|
|
{
|
|
g_FirstFocusElement.focus();
|
|
window.setTimeout("Agent_Activate('Welcome');",1000);
|
|
}
|
|
|
|
}
|
|
|
|
function RunWelcomeFadeIn(duration)
|
|
{
|
|
OOBEDocBody.style.cursor = "wait";
|
|
if (ScreenFrame.style.display != "none")
|
|
{
|
|
// need to turn off so fade transition is visible
|
|
// needed if nav'ing from USB pages
|
|
ScreenFrame.style.display = "none";
|
|
}
|
|
|
|
ScreenFrame.style.filter="blendTrans(duration=10.0)"; // 10.0 is junk placeholder
|
|
ScreenFrame.filters[0].duration=duration;
|
|
ScreenFrame.filters[0].enabled=true;
|
|
ScreenFrame.onfilterchange=DisableScreenTransition;
|
|
ScreenFrame.filters[0].Apply();
|
|
|
|
ScreenFrame.style.display = "inline";
|
|
ScreenFrame.filters[0].Play();
|
|
}
|
|
|
|
function DisableScreenTransition()
|
|
{
|
|
// called when transition completed
|
|
OOBEDocBody.style.cursor = "default";
|
|
|
|
ScreenFrame.filters[0].enabled=false;
|
|
ScreenFrame.style.filter=null;
|
|
|
|
g_FirstFocusElement.focus();
|
|
window.setTimeout("Agent_Activate('Welcome');",1000);
|
|
}
|
|
|
|
// Function: Start_CheckEdits
|
|
// Description: This function is called everytime an OnClick
|
|
// event fires on the page. This is done so if the user
|
|
// loses focus from one of the edits we can push them
|
|
// in the right direction and hint them along the way
|
|
// Or if all elements are filled then we enabled
|
|
// the next button or if any value is 0 then we
|
|
// disable the next button
|
|
//
|
|
function Start_CheckEdits()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if ((g.event.srcElement != g.edt_FirstName) &&
|
|
(g.event.srcElement != g.edt_LastName))
|
|
{
|
|
Start_CheckEnableNextButton();
|
|
}
|
|
}
|
|
|
|
// Function: Start_CheckEnableNextButton
|
|
// Description: This function is called everytime a keyup
|
|
// event fires on a edit box for first, middle, or last
|
|
// name. We then see if we should enable or disable the
|
|
// next button based on if every field has a value.
|
|
// First || Last
|
|
//
|
|
function Start_CheckEnableNextButton()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Start_CheckLengthRequirement() &&
|
|
Start_CheckLengthNotEqualSpaces())
|
|
{
|
|
g.btnNext.disabled = false;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.disabled = true;
|
|
}
|
|
InitNewButtons();
|
|
}
|
|
|
|
function Start_CheckLengthRequirement()
|
|
{
|
|
if ((g.edt_FirstName.value.length != 0) ||
|
|
(g.edt_LastName.value.length != 0))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function Start_CheckLengthNotEqualSpaces()
|
|
{
|
|
if ((g.edt_FirstName.value.length != NumberOfSpaces(g.edt_FirstName.value)) ||
|
|
(g.edt_LastName.value.length != NumberOfSpaces(g.edt_LastName.value)))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
// END welcome.htm
|
|
|
|
// activate.htm //////
|
|
|
|
function ActivationRadioClicked()
|
|
{
|
|
// if they click on either button, enable the Next button
|
|
if(g.btnNext.disabled && (g.rb_act_1.checked || g.rb_act_2.checked))
|
|
{
|
|
g.btnNext.onmouseover = HandleNextButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleNextButtonMouseOut;
|
|
g.btnNext.onmousedown = HandleNextButtonMouseDown;
|
|
g.btnNext.className="newbuttonsNext";
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = GoNext;
|
|
g.btnNext.focus();
|
|
}
|
|
}
|
|
|
|
function Activation_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (!(g.rb_act_1.checked || g.rb_act_2.checked))
|
|
g.btnNext.disabled = true;
|
|
|
|
var numberdaysleft = "";
|
|
try
|
|
{
|
|
numberdaysleft = window.external.GetActivationDaysLeft();
|
|
}
|
|
catch(e)
|
|
{
|
|
numberdaysleft = "0";
|
|
}
|
|
|
|
g.Number_Days_Left1.innerText = numberdaysleft;
|
|
|
|
InitNewButtons();
|
|
g_FirstFocusElement = g.rb_txt1;
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
// acterror.htm ////
|
|
|
|
function acterror_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
var L_ActerrorTitle1_Text = "Thank you";
|
|
var L_ActerrorDescr1_Text = "Windows has been activated.";
|
|
|
|
var L_ActerrorTitle2_Text = "Online activation could not be completed";
|
|
var L_ActerrorDescr2_Text = "The product key being used to activate this copy of Windows has exceeded the maximum number of allowed activations. This can occur if the product key has been used to activate a different computer.";
|
|
|
|
var numberdaysleft = "";
|
|
try
|
|
{
|
|
numberdaysleft = window.external.GetActivationDaysLeft();
|
|
}
|
|
catch(e)
|
|
{
|
|
numberdaysleft = "0";
|
|
}
|
|
|
|
g.acterror_s1.style.visibility="visible"; // Default Title: "Our online activation center could not be reached"
|
|
|
|
if (g_ActivationStatus == ERR_ACT_SUCCESS)
|
|
{
|
|
// Change to title1 and description1
|
|
g.acterror_s1.innerText = L_ActerrorTitle1_Text;
|
|
g.acterror_description.innerHTML = L_ActerrorDescr1_Text;
|
|
g.acterror_description.style.display="inline";
|
|
g.acterror_carriagereturn.style.display="inline";
|
|
}
|
|
else if (g_ActivationStatus == ERR_ACT_USED_PID)
|
|
{
|
|
// Change to title2 and description2
|
|
g.acterror_s1.innerText = L_ActerrorTitle2_Text;
|
|
g.acterror_description.innerHTML = L_ActerrorDescr2_Text;
|
|
g.acterror_description.style.display="inline";
|
|
g.acterror_carriagereturn.style.display="inline";
|
|
|
|
g.acterror_description2.style.display="inline";
|
|
g.Number_Days_Left2a.innerText = numberdaysleft;
|
|
g.Number_Days_Left2b.innerText = numberdaysleft;
|
|
}
|
|
else
|
|
{
|
|
g.acterror_description3.style.display="inline";
|
|
g.Number_Days_Left3a.innerText = numberdaysleft;
|
|
g.Number_Days_Left3b.innerText = numberdaysleft;
|
|
|
|
}
|
|
|
|
InitNewButtons();
|
|
g_FirstFocusElement = g.btnNext;
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
// reg1.htm ////
|
|
|
|
function Reg1EnableNextButton()
|
|
{
|
|
g.btnNext.onmouseover = HandleNextButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleNextButtonMouseOut;
|
|
g.btnNext.onmousedown = HandleNextButtonMouseDown;
|
|
g.btnNext.className="newbuttonsNext";
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = GoNext;
|
|
g.btnNext.focus();
|
|
}
|
|
|
|
function Reg1RadioClicked()
|
|
{
|
|
if (g.btnNext.disabled)
|
|
{
|
|
if (g_OEMRadioDisplayed && g_fRegWithMS)
|
|
{
|
|
if((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
|
|
Reg1EnableNextButton();
|
|
}
|
|
else
|
|
{
|
|
Reg1EnableNextButton();
|
|
}
|
|
}
|
|
}
|
|
|
|
var g_Reg1PostToMSSelectDone = false;
|
|
var g_Reg1PostToOEMSelectDone = false;
|
|
function Reg1SaveRadioState()
|
|
{
|
|
if (g_fRegWithMS)
|
|
{
|
|
g_Reg1PostToMSSelectDone = true;
|
|
if (g.rb_reg_ms_yes.checked)
|
|
g_PostToMSValueHolder = true;
|
|
else if (g.rb_reg_ms_no.checked)
|
|
g_PostToMSValueHolder = false;
|
|
else
|
|
g_Reg1PostToMSSelectDone = false;
|
|
}
|
|
else
|
|
{
|
|
g_PostToMSValueHolder = false;
|
|
}
|
|
|
|
if (g_OEMRadioDisplayed)
|
|
{
|
|
g_Reg1PostToOEMSelectDone = true;
|
|
if (g.rb_reg_oem_yes.checked)
|
|
g_PostToOEMValueHolder=true;
|
|
else if (g.rb_reg_oem_no.checked)
|
|
g_PostToOEMValueHolder=false;
|
|
else
|
|
g_Reg1PostToOEMSelectDone = false;
|
|
}
|
|
else
|
|
{
|
|
g_PostToOEMValueHolder=false;
|
|
}
|
|
}
|
|
|
|
var g_fRegWithMS = true;
|
|
var g_OEMRadioDisplayed = false;
|
|
function Reg1_LoadMe()
|
|
{
|
|
var L_Title1_Text = "Ready to register with %1?";
|
|
var L_Title2_Text = "Ready to register with %1 and %2?";
|
|
var L_Intro1_Text = "Register online with %1, and we'll notify you of new products, product updates, events, promotions, and special offers that you may be interested in. <b>Registration is optional.</b>";
|
|
var L_Intro2_Text = "Register online with %1 and %2, and we'll notify you of new products, product updates, events, promotions, and special offers that you may be interested in. <b>Registration is optional.</b>";
|
|
var L_Question_Text = "Are you ready to register online with %1?";
|
|
var L_Answer_Text = "Y<u>e</u>s, I'd like to register with %1 now";
|
|
var L_Privacy_Text = "Show me <a TABINDEX=6 id='txtOEMReglink' style='text-decoration:underline;' href='javascript:window.parent.navigatetoPrivacy();'>the %1 Registration Privacy Statement</a>.";
|
|
|
|
InitFrameRef();
|
|
|
|
g.OEMRow1.style.display="none";
|
|
g.OEMRow2.style.display="none";
|
|
g.OEMRow3.style.display="none";
|
|
g.MSRow1.style.display="none";
|
|
g.MSRow2.style.display="none";
|
|
g.MSRow3.style.display="none";
|
|
|
|
if (1 == RegisterObj.get_PostToOEM)
|
|
{
|
|
if (g_OEMNameStr!="")
|
|
{
|
|
// if users says Yes or No to Activation, do some dynamic text manipulation to correct text grammar.
|
|
if (g_fRegWithMS)
|
|
{
|
|
g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title2_Text, g_OEMNameStr, L_MS_Text);
|
|
g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro2_Text, g_OEMNameStr, L_MS_Text);
|
|
}
|
|
else
|
|
{
|
|
g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title1_Text, g_OEMNameStr);
|
|
g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro1_Text, g_OEMNameStr);
|
|
}
|
|
|
|
// Show the OEM Registration radio buttons, its text, and the OEM Privacy Policy.
|
|
g.reg1_oem_TxtQuestion.innerText = ApiObj.FormatMessage(L_Question_Text, g_OEMNameStr);
|
|
g.reg1_spn3.innerHTML = ApiObj.FormatMessage(L_Answer_Text, g_OEMNameStr);
|
|
g.Reg1oem5.innerHTML = ApiObj.FormatMessage(L_Privacy_Text, g_OEMNameStr);
|
|
g.OEMRow1.style.display="inline";
|
|
g.OEMRow2.style.display="inline";
|
|
g.OEMRow3.style.display="inline";
|
|
g.reg1_oem_TxtQuestion.style.visibility="visible";
|
|
g.Reg1oem1.style.visibility="visible";
|
|
g.Reg1oem2.style.visibility="visible";
|
|
g.Reg1oem3.style.visibility="visible";
|
|
g.Reg1oem4.style.visibility="visible";
|
|
g.Reg1oem5.style.display="inline";
|
|
g_FirstFocusElement = g.rb_reg_oem_yes;
|
|
g_OEMRadioDisplayed = true;
|
|
}
|
|
else
|
|
{
|
|
g.Reg1Title.innerText = L_MissingOEMName_Text;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
g.Reg1Title.innerText = ApiObj.FormatMessage(L_Title1_Text, L_MS_Text);
|
|
g.Reg1Intro.innerHTML = ApiObj.FormatMessage(L_Intro1_Text, L_MS_Text);
|
|
}
|
|
|
|
// if users says Yes to Activation, we show the MS Registration radio button, its text, and the MS Privacy Policy.
|
|
if (g_fRegWithMS)
|
|
{
|
|
g.MSRow1.style.display="inline";
|
|
g.MSRow2.style.display="inline";
|
|
g.MSRow3.style.display="inline";
|
|
|
|
g.reg1_ms_TxtQuestion.style.visibility="visible";
|
|
g.rb_reg_ms_yes.style.visibility="visible";
|
|
g.reg1_txt1.style.visibility="visible";
|
|
g.rb_reg_ms_no.style.visibility="visible";
|
|
g.reg1_txt2.style.visibility="visible";
|
|
g.Reg1Info.style.display="inline";
|
|
g.Reg1MS1.style.display="inline";
|
|
g_FirstFocusElement = g.rb_reg_ms_yes;
|
|
}
|
|
else
|
|
{
|
|
// This is to solve the problem of whenever a user says Yes to Activation,
|
|
// then yes to MS and OEM Registration in Reg1 (assuming posttooem=1),
|
|
// then clicks back and selected No to Activation then clicked next.
|
|
// Reg1 will have the OEM registration radio buttons, the MS radio buttons
|
|
// are hidden, but it's value internally is set to true. So we need to set
|
|
// it to false.
|
|
g_PostToMS = false;
|
|
g_PostToMSValueHolder = false;
|
|
|
|
InfoObj.set_MSOffer(false);
|
|
InfoObj.set_OtherOffer(false);
|
|
}
|
|
|
|
g.Reg1Title.style.visibility="visible";
|
|
g.Reg1Intro.style.visibility="visible";
|
|
|
|
// We use the following code to restore the checkbox selection whenever we go back to this page.
|
|
if (g_Reg1PostToMSSelectDone)
|
|
{
|
|
if (g_PostToMSValueHolder)
|
|
g.rb_reg_ms_yes.checked = true;
|
|
else
|
|
g.rb_reg_ms_no.checked = true;
|
|
}
|
|
|
|
if (g_Reg1PostToOEMSelectDone)
|
|
{
|
|
if (g_PostToOEMValueHolder)
|
|
g.rb_reg_oem_yes.checked = true;
|
|
else
|
|
g.rb_reg_oem_no.checked = true;
|
|
}
|
|
|
|
|
|
// We use the following code to determine if we need to enable the Next button or not.
|
|
if ((g_OEMRadioDisplayed) && (g_fRegWithMS))
|
|
{
|
|
if ((g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked) && (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked))
|
|
Reg1EnableNextButton();
|
|
else
|
|
g.btnNext.disabled = true;
|
|
}
|
|
else if ((!g_OEMRadioDisplayed) && (g_fRegWithMS))
|
|
{
|
|
if (g.rb_reg_ms_yes.checked || g.rb_reg_ms_no.checked)
|
|
Reg1EnableNextButton();
|
|
else
|
|
g.btnNext.disabled = true;
|
|
}
|
|
else if ((g_OEMRadioDisplayed) && (!g_fRegWithMS))
|
|
{
|
|
if (g.rb_reg_oem_yes.checked || g.rb_reg_oem_no.checked)
|
|
Reg1EnableNextButton();
|
|
else
|
|
g.btnNext.disabled = true;
|
|
}
|
|
|
|
InitNewButtons();
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
|
|
// oempriv.htm //////
|
|
|
|
function OEMPrivacyPolicy(SimpleBack, SimpleNext)
|
|
{
|
|
var L_Privacy1_Text = "%1 Privacy Statement";
|
|
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.btnBack;
|
|
InitNewButtons(SimpleBack, SimpleNext);
|
|
|
|
g.spn_privacy_oemname1.innerText = ApiObj.FormatMessage(L_Privacy1_Text, g_OEMNameStr);
|
|
g.spn_privacy_oemname2.innerText = g_OEMNameStr;
|
|
g.spn_privacy_oemname3.innerText = g_OEMNameStr;
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
|
|
// reg2.htm //////
|
|
|
|
var g_Reg2EmailName="";
|
|
var g_Reg2MachineName="";
|
|
var g_Reg2PW="";
|
|
|
|
function Reg2SaveSettings() {
|
|
// restore fields
|
|
g_Reg2EmailName= g.emailname.value;
|
|
g_Reg2MachineName= g.machinename.value;
|
|
g_Reg2PW=g.passwd.value;
|
|
}
|
|
|
|
function Reg2_LoadMe() {
|
|
InitFrameRef();
|
|
g_FirstFocusElement = g.emailname;
|
|
|
|
// restore fields
|
|
g.emailname.value = g_Reg2EmailName;
|
|
g.machinename.value = g_Reg2MachineName;
|
|
g.passwd.value = g_Reg2PW;
|
|
|
|
|
|
InitNewButtons();
|
|
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
|
|
function Reg2_RemindMe()
|
|
{
|
|
// BUGBUG: need to fill in later
|
|
/*
|
|
Following Windows Welcome, Microsoft will send you an e-mail message explaining how to retrieve your password. You can then register Windows from the Start menu.
|
|
*/
|
|
}
|
|
|
|
function Default_radioClicked()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
g.btnNext.disabled = false;
|
|
InitNewButtons();
|
|
}
|
|
|
|
//// reg3.htm ///////////////////////
|
|
|
|
var g_PostToMS = true;
|
|
var g_PostToOEM = true;
|
|
var POST_TO_OEM = 1;
|
|
var POST_TO_MS = 2;
|
|
var g_PostToMSValueHolder = g_PostToMS;
|
|
var g_PostToOEMValueHolder = g_PostToOEM;
|
|
|
|
var StateAbbrevs = new Array("","AL","AK","AZ","AR","CA","CO","CT","DC","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","PR","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY");
|
|
var FullStateNames = new Array("Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Washington, D.C.","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Puerto Rico","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming");
|
|
var ProvinceNames = new Array("","Alberta","British Columbia","Manitoba","New Brunswick","Newfoundland","Northwest Territories","Nova Scotia","Nunavut","Ontario","Prince Edward Island","Quebec","Saskatchewan","Yukon");
|
|
|
|
// need ability to map state name string to index into StateAbbrevs
|
|
var g_StateName2IndexMap= new ActiveXObject("Scripting.Dictionary");
|
|
g_StateName2IndexMap.CompareMode = COMPAREMODE_TEXT;
|
|
var g_ProvinceName2IndexMap= new ActiveXObject("Scripting.Dictionary");
|
|
g_ProvinceName2IndexMap.CompareMode = COMPAREMODE_TEXT;
|
|
|
|
// windows scripting host -- used to send fake keybd events for keyboard helper on PID page
|
|
var WshShell = new ActiveXObject("WScript.Shell");
|
|
|
|
// init hash table
|
|
var ii;
|
|
for(ii=1;ii<=FullStateNames.length;ii++) {
|
|
// add both full name and abbrev to hash table
|
|
g_StateName2IndexMap.Add(FullStateNames[ii-1].toUpperCase(),ii);
|
|
g_StateName2IndexMap.Add(StateAbbrevs[ii].toUpperCase(),ii);
|
|
|
|
if(ii < ProvinceNames.length) {
|
|
g_ProvinceName2IndexMap.Add(ProvinceNames[ii].toUpperCase(),ii);
|
|
}
|
|
}
|
|
|
|
var L_Postal_Text = "Postal or <u>Z</u>IP code:";
|
|
var L_AsteriskPostal_Text = "*Postal or <u>Z</u>IP code:";
|
|
var L_Province_Text= "State/<u>P</u>rovince:";
|
|
var L_AsteriskProvince_Text= "*State/<u>P</u>rovince:";
|
|
|
|
var L_Canada_Text="Canada";
|
|
var L_UnitedStates_Text="United States";
|
|
|
|
function Reg3UserCountryChanged() {
|
|
// AGENT: notify Agent of the change
|
|
|
|
Agent_OnSelectChange(g.selCountry);
|
|
|
|
g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
|
|
if(g_Country == L_UnitedStates_Text) {
|
|
// when changing to US, try to translate any textbox string to state index
|
|
if(g.UserStateTextBox.value!="") {
|
|
var res=g_StateName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
|
|
if(res!=null) {
|
|
g.selUSState.selectedIndex=res;
|
|
}
|
|
}
|
|
g.selCAProvince.style.display="none";
|
|
g.UserStateTextBox.style.display="none";
|
|
|
|
if(g.selUSState.style.display!="inline") {
|
|
g.selUSState.style.display="inline";
|
|
}
|
|
|
|
//g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
|
|
//g.StateLabel.innerHTML = L_AsteriskProvince_Text;
|
|
g.Reg3StateProvinceOptional.style.display="none";
|
|
g.Reg3ZipPostalCodeOptional.style.display="none";
|
|
// g.StateLabel.htmlFor="selUSState";
|
|
|
|
|
|
} else if(g_Country == L_Canada_Text) {
|
|
// when changing to Canada, try to translate any textbox string to province index
|
|
if(g.UserStateTextBox.value!="") {
|
|
var res=g_ProvinceName2IndexMap.Item(g.UserStateTextBox.value.toUpperCase());
|
|
if(res!=null) {
|
|
g.selCAProvince.selectedIndex=res;
|
|
}
|
|
}
|
|
g.selUSState.style.display="none";
|
|
g.UserStateTextBox.style.display="none";
|
|
g.selCAProvince.style.display="inline";
|
|
//g.LabelZIP.innerHTML = L_AsteriskPostal_Text;
|
|
//g.StateLabel.innerHTML = L_AsteriskProvince_Text;
|
|
g.Reg3StateProvinceOptional.style.display="none";
|
|
g.Reg3ZipPostalCodeOptional.style.display="none";
|
|
// g.StateLabel.htmlFor="selCAProvince";
|
|
|
|
} else {
|
|
g.selUSState.style.display="none";
|
|
g.selCAProvince.style.display="none";
|
|
g.UserStateTextBox.style.display="inline";
|
|
g.LabelZIP.innerHTML = L_Postal_Text;
|
|
g.StateLabel.innerHTML = L_Province_Text;
|
|
g.Reg3StateProvinceOptional.style.display="inline";
|
|
|
|
if (IsFarEastLocale())
|
|
{
|
|
g.FE_Reg3ZipPostalCodeOptional.style.display="inline";
|
|
g.Reg3ZipPostalCodeOptional.style.display="none";
|
|
}
|
|
else
|
|
{
|
|
g.Reg3ZipPostalCodeOptional.style.display="inline";
|
|
}
|
|
|
|
// g.StateLabel.htmlFor="UserStateTextBox";
|
|
}
|
|
|
|
g_CountryIdx=g.selCountry.selectedIndex;
|
|
|
|
Reg3UserStateChanged();
|
|
}
|
|
|
|
function Reg3UserStateChanged() {
|
|
|
|
// AGENT: notify Agent of the change
|
|
|
|
// BUGBUG: ok for no notify on change to textbox?
|
|
Agent_OnSelectChange((g.selUSState.style.display != "none") ? g.selUSState : g.selCAProvince);
|
|
|
|
if(g.selUSState.style.display!="none")
|
|
{
|
|
g_StateIdx=g.selUSState.selectedIndex;
|
|
g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
}
|
|
else if (g.selCAProvince.style.display!="none")
|
|
{
|
|
g_StateIdx=g.selCAProvince.selectedIndex;
|
|
g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
}
|
|
else
|
|
{
|
|
g_State = g.UserStateTextBox.value;
|
|
}
|
|
}
|
|
|
|
// store field info here:
|
|
|
|
var g_FirstName=InfoObj.get_FirstName();
|
|
//var g_MiddleName=InfoObj.get_MiddleInitial(); // InfoObj.get_MiddleName(); BUGBUG need to add this fn
|
|
var g_LastName=InfoObj.get_LastName();
|
|
var g_Address1=InfoObj.get_Address1();
|
|
var g_Address2=InfoObj.get_Address2();
|
|
var g_City=InfoObj.get_City();
|
|
var g_ZipCode=InfoObj.get_Zip();
|
|
var g_EmailAddr= InfoObj.get_PrimaryEmail();
|
|
var g_Country=InfoObj.get_Country();
|
|
var g_CountryIdx=-1;
|
|
var g_State=InfoObj.get_State();
|
|
var g_StateIdx=0;
|
|
|
|
function Reg3SaveSettings()
|
|
{
|
|
g_FirstName=g.UserFirstName.value;
|
|
//g_MiddleName=g.UserMiddleName.value;
|
|
|
|
if (IsKoreanLocale())
|
|
g_LastName="";
|
|
else
|
|
g_LastName=g.UserLastName.value;
|
|
|
|
g_Address1=g.UserAddress.value;
|
|
g_Address2=g.UserAddress2.value;
|
|
g_ZipCode=g.UserZipCode.value;
|
|
g_EmailAddr=g.UserEmailAddress.value;
|
|
g_City=g.UserCity.value;
|
|
g_Country=g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
|
|
if(g.UserStateTextBox.style.display!="none")
|
|
{
|
|
g_State=g.UserStateTextBox.value;
|
|
}
|
|
else if (g.selUSState.style.display!="none")
|
|
{
|
|
g_State=g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
}
|
|
else
|
|
{
|
|
g_State=g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
}
|
|
|
|
InfoObj.set_FirstName(g_FirstName);
|
|
InfoObj.set_LastName(g_LastName);
|
|
//InfoObj.set_MiddleInitial(g_MiddleName);
|
|
InfoObj.set_Country(g_Country);
|
|
InfoObj.set_State(g_State);
|
|
InfoObj.set_Address1(g_Address1);
|
|
InfoObj.set_Address2(g_Address2);
|
|
InfoObj.set_PrimaryEmail(g_EmailAddr);
|
|
InfoObj.set_Zip(g_ZipCode);
|
|
InfoObj.set_City(g_City);
|
|
|
|
TapiObj.set_CountryIndex(g.selCountry.selectedIndex);
|
|
InfoObj.set_CountryID(TapiObj.get_CountryID());
|
|
|
|
// Microsoft policy states that MSupdate should always be true whenever a user registers.
|
|
InfoObj.set_MSUpdate(true);
|
|
|
|
InfoObj.set_MSOffer(false);
|
|
if ((g_PostToMS==true) && (g.sharemsonly.checked))
|
|
InfoObj.set_MSOffer(true);
|
|
|
|
InfoObj.set_OtherOffer(false);
|
|
if ((g_PostToMS==true) && (g.sharems.checked))
|
|
InfoObj.set_OtherOffer(true);
|
|
}
|
|
|
|
var L_FullName_Text ="*<u>F</u>ull Name:";
|
|
|
|
// We want the Reg3 checkboxes to be unchecked by default.
|
|
InfoObj.set_MSOffer(false);
|
|
InfoObj.set_OtherOffer(false);
|
|
function Reg3_LoadMe()
|
|
{
|
|
// AGENT: we don't want Agent to process any events
|
|
// that might occur as a result of initializing the
|
|
// controls.
|
|
|
|
Agent_IgnoreEvents(true);
|
|
|
|
InitFrameRef();
|
|
var fTapi = TapiObj.IsTAPIConfigured(); // init TAPI
|
|
var CountryOptStr=TapiObj.get_AllCountryName();
|
|
|
|
// we used to do a document.write() to put this into selCountry. IE 5.5 seems to
|
|
// have redraw probs with long doc.writes, so parse it out and add it once in onload
|
|
|
|
var i;
|
|
var oOption;
|
|
var regexp1=/<OPTION>/g;
|
|
var tmpOptsStr = CountryOptStr.replace(regexp1, ""); //delete <OPTION>
|
|
var OptStrArray = tmpOptsStr.split("</OPTION>");
|
|
|
|
for(i=0; i < OptStrArray.length; i++) {
|
|
oOption = g.document.createElement("OPTION");
|
|
oOption.text = OptStrArray[i];
|
|
g.selCountry.add(oOption);
|
|
}
|
|
|
|
g.selCountry.onchange=Reg3UserCountryChanged;
|
|
g_FirstFocusElement = g.UserFirstName;
|
|
|
|
if (IsFarEastLocale())
|
|
{
|
|
|
|
/*For JPN, CHT, CHS,
|
|
Last Name
|
|
First Name
|
|
Country/Region
|
|
Province
|
|
City
|
|
Address
|
|
Zip
|
|
E-Mail
|
|
|
|
For KOR only,
|
|
Full Name
|
|
Country/Region
|
|
Province
|
|
City
|
|
Address
|
|
Zip
|
|
E-Mail
|
|
*/
|
|
g.MainPageCell.style.display="none"; // hide while we change order
|
|
|
|
// no middle name for far east langs
|
|
// g.MiddleNameRow.style.display="none";
|
|
|
|
g.FieldTable.moveRow(1,0); // move lastname in front of first
|
|
g.FieldTable.moveRow(7,2); // move country to after firstname
|
|
g.FieldTable.moveRow(6,3); // move province to after country
|
|
g.FieldTable.moveRow(6,4); // move city to after province
|
|
|
|
g.FE_ZIPLabel.innerHTML=g.LabelRight.innerHTML;
|
|
g.FE_ZIPInput.innerHTML=g.MenuRight.innerHTML;
|
|
g.FE_ZIPRow.style.display="inline";
|
|
|
|
g.LabelRight.innerHTML="";
|
|
g.MenuRight.innerHTML="";
|
|
|
|
// no reason to limit these lengths for FE, so just make them match others
|
|
g.UserZipCode.size=30;
|
|
g.UserZipCode.maxlength=120;
|
|
|
|
g.UserStateTextBox.size=30;
|
|
g.UserStateTextBox.maxlength=120;
|
|
|
|
g_FirstFocusElement = g.UserLastName;
|
|
|
|
if (IsKoreanLocale()) {
|
|
g.LastNameRow.style.display="none";
|
|
g.LabelFirstName.innerHTML=L_FullName_Text;
|
|
g_FirstFocusElement = g.UserFirstName;
|
|
}
|
|
|
|
g.MainPageCell.style.display="inline";
|
|
}
|
|
|
|
// limit width of country menu since some text options are very long
|
|
g.selCountry.style.width=g.UserEmailAddress.offsetWidth;
|
|
|
|
g.UserFirstName.value=g_FirstName;
|
|
//g.UserMiddleName.value=g_MiddleName;
|
|
if (!IsKoreanLocale())
|
|
g.UserLastName.value=g_LastName;
|
|
g.UserAddress.value=g_Address1;
|
|
g.UserAddress2.value=g_Address2;
|
|
g.UserZipCode.value=g_ZipCode;
|
|
g.UserEmailAddress.value=g_EmailAddr;
|
|
g.UserCity.value=g_City;
|
|
|
|
// placeholder idx 0 option is needed to fix 101447
|
|
// Due to a possible mshtml bug, the cursor is shifted right when the menu
|
|
// expands to its full width.
|
|
|
|
g.selUSState.remove(0);
|
|
|
|
for (var i = 0; i < StateAbbrevs.length; i++) {
|
|
var oOption = g.document.createElement("OPTION");
|
|
oOption.text = StateAbbrevs[i];
|
|
if (StateAbbrevs[i] == g_State)
|
|
{
|
|
g_StateIdx = i;
|
|
}
|
|
g.selUSState.add(oOption);
|
|
}
|
|
|
|
for (i = 0; i < ProvinceNames.length; i++) {
|
|
oOption = g.document.createElement("OPTION");
|
|
oOption.text = ProvinceNames[i];
|
|
if (ProvinceNames[i] == g_State)
|
|
{
|
|
g_StateIdx = i;
|
|
}
|
|
g.selCAProvince.add(oOption);
|
|
}
|
|
|
|
// Note: the way code below is written, g_CountryIdx always >=0 so 2nd branch never
|
|
// taken. causes no probs though
|
|
|
|
g_CountryIdx = TapiObj.get_CountryIndex();
|
|
|
|
if(g_CountryIdx>=0)
|
|
{
|
|
g.selCountry.selectedIndex=g_CountryIdx;
|
|
if(g_Country == L_UnitedStates_Text)
|
|
{
|
|
g.selUSState.selectedIndex=g_StateIdx;
|
|
}
|
|
else if(g_Country == L_Canada_Text)
|
|
{
|
|
g.selCAProvince.selectedIndex=g_StateIdx;
|
|
}
|
|
else
|
|
g.UserStateTextBox.value=g_State;
|
|
}
|
|
else
|
|
{
|
|
// get default value
|
|
g.selCountry.selectedIndex = TapiObj.get_CountryIndex();
|
|
}
|
|
|
|
Reg3UserCountryChanged();
|
|
g.MainPageCell.style.visibility="visible";
|
|
|
|
g_PostToMS = g_PostToMSValueHolder;
|
|
g_PostToOEM = g_PostToOEMValueHolder;
|
|
|
|
|
|
// For complete checkbox behavior specs, see bug 321512
|
|
// If user says Yes to Register with MS in Reg1, Show the two checkboxes:
|
|
// o Send me promotions and offers from Microsoft.
|
|
// o Send me promotions and offers from Microsoft's partners.
|
|
// =======================================================================
|
|
|
|
if (g_PostToMS==true)
|
|
{
|
|
g.RegChkBxMSOnlyGrp.style.display = "inline";
|
|
g.RegChkBxMSGrp.style.display = "inline";
|
|
|
|
var MSoffer_Checked = InfoObj.get_MSOffer();
|
|
if (MSoffer_Checked)
|
|
g.sharemsonly.checked = true;
|
|
else
|
|
g.sharemsonly.checked = false;
|
|
|
|
var MSotheroffer_Checked = InfoObj.get_OtherOffer();
|
|
if (MSotheroffer_Checked)
|
|
g.sharems.checked = true;
|
|
else
|
|
g.sharems.checked = false;
|
|
}
|
|
|
|
|
|
InitNewButtons();
|
|
|
|
// since our code in this function needs focus between the firstname or the lastname field, and
|
|
// not on any button or object, we will use this next line of code to make the textbox focus or
|
|
// highlight if there will be any values in it.
|
|
g_FirstFocusElement.select();
|
|
|
|
g_FirstFocusElement.focus();
|
|
|
|
// AGENT: now we want event processing
|
|
|
|
Agent_IgnoreEvents(false);
|
|
|
|
// legal message for France, Belgium, or other localization
|
|
var L_CNIL_Text = "<p>";
|
|
var L_CnilStyleDisplay_Text = "none";
|
|
|
|
g.cnil_mesg.innerHTML = L_CNIL_Text;
|
|
g.cnil_mesg.style.display=L_CnilStyleDisplay_Text;
|
|
|
|
}
|
|
|
|
function GetCurrentProvince()
|
|
{
|
|
if(g.selCountry.options(g.selCountry.selectedIndex).text == L_UnitedStates_Text) {
|
|
return g.selUSState.options(g.selUSState.selectedIndex).text;
|
|
} else if(g.selCountry.options(g.selCountry.selectedIndex).text == L_Canada_Text) {
|
|
return g.selCAProvince.options(g.selCAProvince.selectedIndex).text;
|
|
} else return g.UserStateTextBox.value;
|
|
}
|
|
|
|
function GetCurrentCountry()
|
|
{
|
|
return g.selCountry.options(g.selCountry.selectedIndex).text;
|
|
}
|
|
|
|
var L_EnterValid_Text="Please fill in the required fields.";
|
|
var L_Email_Text="Please enter a valid E-mail address or leave the E-mail text box empty.";
|
|
var L_MS_Text="Microsoft";
|
|
|
|
function FormatRequiredFieldLabel(element,error)
|
|
{
|
|
if (error)
|
|
{
|
|
element.className = "text-error";
|
|
if (!(element.innerHTML.charAt(0) == "*"))
|
|
{
|
|
element.innerHTML = "* " + element.innerHTML
|
|
}
|
|
}
|
|
else
|
|
{
|
|
element.className = "text-primary";
|
|
if ((element.innerHTML.charAt(0) == "*"))
|
|
{
|
|
element.innerHTML = element.innerHTML.substring(2,(element.innerHTML.length - 1));
|
|
}
|
|
}
|
|
}
|
|
|
|
function VerifyReg3Fields()
|
|
{
|
|
g.error_mesg.style.display="none";
|
|
var LastErrorField = null;
|
|
|
|
var CurReg3ErrStringArray = new Array();
|
|
|
|
// user needs to complete input of address/name
|
|
// this dynamically builds the list of erroneous fields to give to the user
|
|
|
|
if(g.UserEmailAddress.value != "") {
|
|
// do some validation on email address
|
|
// Note special regexpr char like '\S' must be double-\'d because they are inside a string
|
|
|
|
var re = new RegExp("^\\s*\\S+@\\S+\\.\\S\\S+","");
|
|
|
|
if(re.exec(g.UserEmailAddress.value) == null) {
|
|
LastErrorField = g.UserEmailAddress;
|
|
FormatRequiredFieldLabel(g.LabelEmail,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelEmail,0);
|
|
}
|
|
}
|
|
|
|
var CurCountry=GetCurrentCountry();
|
|
|
|
// dont require state or zip except for US/Canada
|
|
if ((CurCountry == L_UnitedStates_Text)||(CurCountry == L_Canada_Text)) {
|
|
if(g.UserZipCode.value == "") {
|
|
LastErrorField = g.UserZipCode;
|
|
FormatRequiredFieldLabel(g.LabelZIP,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelZIP,0);
|
|
}
|
|
|
|
if(GetCurrentProvince() == "") {
|
|
if(g.selUSState.style.display!="none") {
|
|
LastErrorField = g.selUSState;
|
|
} else {
|
|
LastErrorField = g.selCAProvince;
|
|
}
|
|
FormatRequiredFieldLabel(g.StateLabel,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.StateLabel,0);
|
|
}
|
|
}
|
|
|
|
if(g.UserCity.value == "") {
|
|
LastErrorField = g.UserCity;
|
|
FormatRequiredFieldLabel(g.LabelCity,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelCity,0);
|
|
}
|
|
|
|
if(g.UserAddress.value == "") {
|
|
LastErrorField = g.UserAddress;
|
|
FormatRequiredFieldLabel(g.LabelAddress,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelAddress,0);
|
|
}
|
|
|
|
|
|
if((g.UserLastName.value == "") && (g.LastNameRow.style.display!="none")) {
|
|
LastErrorField = g.UserLastName;
|
|
FormatRequiredFieldLabel(g.LabelLastName,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelLastName,0);
|
|
}
|
|
|
|
if(g.UserFirstName.value == "") {
|
|
LastErrorField = g.UserFirstName;
|
|
FormatRequiredFieldLabel(g.LabelFirstName,1);
|
|
} else {
|
|
FormatRequiredFieldLabel(g.LabelFirstName,0);
|
|
}
|
|
|
|
if(LastErrorField==null) {
|
|
return true;
|
|
}
|
|
|
|
// handle error
|
|
|
|
if(LastErrorField==g.UserEmailAddress) {
|
|
g.error_mesg.innerText = L_Email_Text;
|
|
} else {
|
|
g.error_mesg.innerText = L_EnterValid_Text;
|
|
}
|
|
|
|
g.error_mesg.className = "text-error";
|
|
g.error_mesg.style.display="inline";
|
|
|
|
try
|
|
{
|
|
g.btnNext.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnBack.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnSkip.disabled=false;
|
|
}
|
|
catch(e) {}
|
|
InitNewButtons();
|
|
|
|
LastErrorField.focus();
|
|
|
|
return false;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// tapi.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function TapiLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
ResetDialing();
|
|
g_FirstFocusElement = g.selCountry;
|
|
|
|
if (null == TapiObj)
|
|
{
|
|
TapiObj = new Object;
|
|
TapiObj = window.external.Tapi;
|
|
}
|
|
|
|
RetrieveTapi();
|
|
Tapi_CountryChange();
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
function Tapi_AreaCodeChange()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (window.external.Tapi.IsAreaCodeRequired(g.selCountry.selectedIndex) &&
|
|
window.external.CheckPhoneBook("msobe.isp") &&
|
|
g.edtAreaCode.value.length == 0)
|
|
g.btnNext.disabled = true;
|
|
else
|
|
g.btnNext.disabled = false;
|
|
InitNewButtons();
|
|
}
|
|
function Tapi_CountryChange()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
|
|
if (window.external.CheckPhoneBook("msobe.isp"))
|
|
{
|
|
g.div_MSNNotAvailable.style.visibility = "hidden";
|
|
g.spn_AdditionalSettings.style.visibility = "visible";
|
|
g_DialingAvailableInCountry = true;
|
|
}
|
|
else
|
|
{
|
|
g.div_MSNNotAvailable.style.visibility = "visible";
|
|
g.spn_AdditionalSettings.style.visibility = "hidden";
|
|
g_DialingAvailableInCountry = false;
|
|
}
|
|
tapi_OutsideLineClicked();
|
|
Tapi_AreaCodeChange();
|
|
}
|
|
function StoreTapi()
|
|
{
|
|
TapiObj.set_CountryIndex = g.selCountry.selectedIndex;
|
|
TapiObj.set_AreaCode = g.edtAreaCode.value;
|
|
|
|
if(g.radioTouchToneYes.checked)
|
|
TapiObj.set_PhoneSystem = 1; //touch tone
|
|
else
|
|
TapiObj.set_PhoneSystem = 0; //rotary
|
|
|
|
TapiObj.set_DialOut = g.edtOutsideLine.value;
|
|
}
|
|
|
|
function RetrieveTapi()
|
|
{
|
|
var fTapi = TapiObj.IsTAPIConfigured;
|
|
|
|
g.selCountry.selectedIndex = TapiObj.get_CountryIndex;
|
|
|
|
g.edtAreaCode.value = TapiObj.get_AreaCode;
|
|
|
|
if(1 == TapiObj.get_PhoneSystem)
|
|
g.radioTouchToneYes.checked = true; //touch tone
|
|
else
|
|
g.radioTouchToneNo.checked = true; //rotary
|
|
|
|
g.edtOutsideLine.value = TapiObj.get_DialOut;
|
|
|
|
if(g.edtOutsideLine.value != "")
|
|
g.radioOutSideLineYes.checked = true; //use a number to dial out
|
|
else
|
|
g.radioOutSideLineNo.checked = true; //don't use a number to dial out
|
|
}
|
|
|
|
function tapi_OutsideLineClicked()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.radioOutSideLineYes.checked == true &&
|
|
g.spn_AdditionalSettings.style.visibility == "visible")
|
|
{
|
|
g.spanOutsideLine.style.visibility = "visible";
|
|
g.edtOutsideLine.style.visibility = "visible";
|
|
g.edtOutsideLine.value = TapiObj.get_DialOut;
|
|
if (g.edtOutsideLine.value.length == 0)
|
|
g.edtOutsideLine.value = "9";
|
|
}
|
|
else
|
|
{
|
|
g.spanOutsideLine.style.visibility = "hidden";
|
|
g.edtOutsideLine.style.visibility = "hidden";
|
|
g.spanOutsideLine.style.visibility = "hidden";
|
|
g.edtOutsideLine.value = ""; //nuke out any outside line value
|
|
}
|
|
}
|
|
// END tapi.htm
|
|
|
|
|
|
// EULAWarn.htm
|
|
|
|
function EULAWarn_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
if (g_EULA_OEM)
|
|
{
|
|
var L_BadEulaMSOEM1_TEXT = "You need to accept the End User License Agreement before you can use Windows. This legal agreement between you and Microsoft and %1 states the terms of use of Windows.";
|
|
|
|
g.EULAWarn_INFO1.innerText = ApiObj.FormatMessage(L_BadEulaMSOEM1_TEXT, g_OEMNameStr);
|
|
}
|
|
|
|
InitNewButtons();
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
// END EULAWarn.htm
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// General Default LoadMe function
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function _Default_LoadMe(SimpleBack, SimpleNext)
|
|
{
|
|
InitFrameRef();
|
|
|
|
InitButtons(SimpleBack, SimpleNext);
|
|
|
|
if (g.btnNext.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnNext;
|
|
else if (g.btnSkip.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnSkip;
|
|
else if (g.btnBack.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
else
|
|
g.document.body.focus();
|
|
}
|
|
|
|
function New_Default_LoadMe(SimpleBack, SimpleNext)
|
|
{
|
|
InitFrameRef();
|
|
InitNewButtons(SimpleBack, SimpleNext);
|
|
|
|
if (g.btnNext.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnNext;
|
|
else if (g.btnSkip.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnSkip;
|
|
else if (g.btnBack.style.visibility == "visible")
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
else
|
|
g.document.body.focus();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// eula.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
function HandleTextAreaFocus() {
|
|
g.event.srcElement.style.borderStyle="ridge";
|
|
}
|
|
|
|
function HandleTextAreaBlur() {
|
|
g.event.srcElement.style.borderStyle="";
|
|
}
|
|
|
|
var g_EULA_OEM = false;
|
|
var g_fileEULA = null;
|
|
var g_EULA_radiosticky = null; // variable to make EULA radio buttons sticky
|
|
|
|
function EulaLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (window.external.GetNoWelcomeFinish())
|
|
{
|
|
g.btnNext = g.btnFinish;
|
|
g.FiniBtnLocalText.style.display = "inline";
|
|
g.btnFinish.style.display = "inline";
|
|
g.ToContinueFinishSpn.style.display = "inline";
|
|
}
|
|
else
|
|
{
|
|
g.ToContinueNextSpn.style.display = "inline";
|
|
g.NextBtnLocalText.style.display = "inline";
|
|
g.btnNext.style.display = "inline";
|
|
}
|
|
|
|
var L_strBadEULA_Text = "Setup was unable to display the End User License Agreement. Setup will now close.";
|
|
g_fileEULA = EulaObj.ValidateEULA();
|
|
if (0 == g_fileEULA.length)
|
|
{
|
|
alert(L_strBadEULA_Text);
|
|
window.external.PowerDown(POWERDOWN_SHUTDOWN);
|
|
}
|
|
if (IsKoreanLocale())
|
|
{
|
|
g.txtEULA.cols=95;
|
|
g.txtEULA2.cols=95;
|
|
}
|
|
|
|
if (1 == window.external.GetOEMEula())
|
|
{
|
|
g.EULA_par1_MS_OEM.style.display="inline"; // show "The End User License Agreements..."
|
|
g.EulaOEMSpan.style.display="inline"; // show the OEM textarea
|
|
if(g_bInHighScreenRes)
|
|
{
|
|
g.txtEULA.rows=13; // increase the number of rows of MS textarea, for 1024x786 resolution
|
|
g.txtEULA2.rows=13; // increase the number of rows of OEM textarea, for 1024x786 resolution
|
|
}
|
|
g.AcceptMSOEM_EulaText.style.display="inline"; // show "Do you accept the terms of the EULAs"
|
|
g.EULA_MS_OEM_accept.style.display="inline" // show "Yes, I accept them"
|
|
g.EULA_MS_OEM_decline.style.display="inline" // show "No, I don't accept them"
|
|
Populate_MS_EulaTextArea(); // populate MS textarea
|
|
Populate_OEM_EulaTextArea(); // populate OEM textarea
|
|
g_EULA_OEM = true;
|
|
}
|
|
else
|
|
{
|
|
g.EULA_par1_MSonly.style.display="inline"; // show "The End User License Agreement..."
|
|
if(g_bInHighScreenRes)
|
|
g.txtEULA.rows=29; // increase the number of rows of MS textarea, for 1024x786 resolution
|
|
else
|
|
g.txtEULA.rows=18; // increase the number of rows of MS textarea, for 800x600 resolution
|
|
g.AcceptMS_EulaText.style.display="inline"; // show "Do you accept the terms of the EULA"
|
|
g.EULA_MSonly_accept.style.display="inline" // show "Yes, I accept it"
|
|
g.EULA_MSonly_decline.style.display="inline" // show "No, I don't accept it"
|
|
Populate_MS_EulaTextArea(); // populate MS textarea
|
|
g_EULA_OEM = false;
|
|
}
|
|
|
|
|
|
// Enable/Disable the Next button, or Check/Uncheck the Radio buttons
|
|
// Based on the value of g_EULA_radiosticky
|
|
// ----------------------------------------
|
|
if (g_EULA_radiosticky == null)
|
|
g.btnNext.disabled = true;
|
|
else if (g_EULA_radiosticky == 1)
|
|
g.radioAgree.checked = true;
|
|
else
|
|
g.radioDisAgree.checked = true;
|
|
|
|
InitNewButtons();
|
|
g.btnNext.onclick = EulaNextBtnHandler;
|
|
g_FirstFocusElement = g.btnBack;
|
|
g_FirstFocusElement.focus();
|
|
|
|
try
|
|
{
|
|
g.document.body.onkeydown = EulaOnKeyDown;
|
|
}
|
|
catch(e)
|
|
{
|
|
}
|
|
}
|
|
|
|
function Populate_MS_EulaTextArea()
|
|
{
|
|
g.txtEULA.innerText = ApiObj.LoadFile(g_fileEULA);
|
|
if (0 == g.txtEULA.innerText.length)
|
|
{
|
|
alert(L_strBadEULA_Text);
|
|
window.external.PowerDown(POWERDOWN_SHUTDOWN);
|
|
}
|
|
}
|
|
|
|
function Populate_OEM_EulaTextArea()
|
|
{
|
|
try
|
|
{
|
|
g.txtEULA2.innerText = ApiObj.LoadFile(window.external.GetOEMEulaText());
|
|
}
|
|
catch(e){}
|
|
|
|
if (0 == g.txtEULA2.innerText.length)
|
|
{
|
|
var L_EULAnotFound_Text = "ERROR! Windows detected that oemeulatext is missing or not defined in oobeinfo.ini, or is pointing to a file which does not exist.";
|
|
g.txtEULA2.innerText = L_EULAnotFound_Text;
|
|
}
|
|
|
|
}
|
|
|
|
function EulaLoadMe2()
|
|
{
|
|
InitFrameRef();
|
|
var fileEULA = EulaObj.ValidateEULA();
|
|
|
|
g.txtEULA.innerText = ApiObj.LoadFile(fileEULA);
|
|
g.EulaHideSpan.style.display="inline";
|
|
|
|
if (g_EULA_OEM)
|
|
{
|
|
|
|
try
|
|
{
|
|
g.txtEULA2.innerText = ApiObj.LoadFile(window.external.GetOEMEulaText());
|
|
}
|
|
catch(e)
|
|
{
|
|
var L_EULAnotFound_Text = "ERROR! Windows detected that oemeulatext is missing or not defined in oobeinfo.ini, or is pointing to a file which does not exist.";
|
|
g.txtEULA2.innerText = L_EULAnotFound_Text;
|
|
}
|
|
|
|
g.EulaOEMHideSpan.style.display="inline";
|
|
g.EULA_par3b.style.display="inline";
|
|
}
|
|
else
|
|
{
|
|
g.EULA_par3a.style.display="inline";
|
|
}
|
|
|
|
|
|
InitNewButtons('SimpleBack');
|
|
g_FirstFocusElement = g.btnBack;
|
|
g_FirstFocusElement.focus();
|
|
|
|
try
|
|
{
|
|
g.document.body.onkeydown = EulaOnKeyDown;
|
|
}
|
|
catch(e)
|
|
{
|
|
}
|
|
|
|
}
|
|
|
|
function EulaNextBtnHandler()
|
|
{
|
|
StoreEula();
|
|
GoNext();
|
|
}
|
|
|
|
function EulaOnKeyDown()
|
|
{
|
|
|
|
if (KeyEsc == g.event.keyCode)
|
|
{
|
|
g.event.returnValue = false;
|
|
g.event.keyCode = 0;
|
|
}
|
|
|
|
OnKeyDown();
|
|
}
|
|
|
|
var g_AcceptMS_EULA = false;
|
|
var g_AcceptOEM_EULA = false;
|
|
function EulaRadioClicked()
|
|
{
|
|
// if they click on either button, enable next
|
|
if(g.btnNext.disabled && (g.radioAgree.checked || g.radioDisAgree.checked))
|
|
{
|
|
g.btnNext.onmouseover = HandleNextButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleNextButtonMouseOut;
|
|
g.btnNext.onmousedown = HandleNextButtonMouseDown;
|
|
g.btnNext.className="newbuttonsNext";
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = EulaNextBtnHandler;
|
|
g.btnNext.focus();
|
|
|
|
}
|
|
|
|
if (g.radioAgree.checked)
|
|
g_EULA_radiosticky=1;
|
|
else
|
|
g_EULA_radiosticky=2;
|
|
|
|
g_AcceptMS_EULA = g.radioAgree.checked;
|
|
g_AcceptOEM_EULA = g.radioAgree.checked;
|
|
}
|
|
|
|
function StoreEula()
|
|
{
|
|
EulaObj.set_EULAAcceptance = g.radioAgree.checked;
|
|
}
|
|
// END eula.htm
|
|
|
|
var g_daylight=SysClockObj.get_AutoDaylight();
|
|
var g_CurTimeZoneIdx = SysClockObj.get_TimeZoneIdx();
|
|
|
|
function HandleTZChkBox()
|
|
{
|
|
g_daylight = g.daylight.checked; // this just persists on nav back
|
|
|
|
OnClick();
|
|
}
|
|
|
|
function HandleSelTZChange()
|
|
{
|
|
g_CurTimeZoneIdx = g.selTimeZone.selectedIndex;
|
|
g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
|
|
}
|
|
|
|
|
|
function TimeZone_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
g_FirstFocusElement = g.selTimeZone;
|
|
InitNewButtons();
|
|
|
|
g.daylight.checked = g_daylight;
|
|
g.daylight.onclick = HandleTZChkBox;
|
|
g.selTimeZone.onchange=HandleSelTZChange;
|
|
g.selTimeZone.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
|
|
g.selTimeZone.selectedIndex = g_CurTimeZoneIdx;
|
|
g.daylight.disabled = !SysClockObj.get_DaylightEnabled(g_CurTimeZoneIdx);
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// keybdcmt.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var g_RegionSelIdx=LangObj.get_RegionIndex();
|
|
var g_LangSelIdx=LangObj.get_LangIndex();
|
|
var g_KeyboardSelIdx=LangObj.get_KeyboardLayoutIndex();
|
|
|
|
function RegKBCmt_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
g_FirstFocusElement = g.btnNext;
|
|
InitNewButtons();
|
|
|
|
g.newkeybdname.innerText=LangObj.get_KeyboardLayoutName(g_KeyboardSelIdx);
|
|
g.newregionname.innerText=LangObj.get_RegionName(g_RegionSelIdx);
|
|
g.newlangname.innerText=LangObj.get_LangName(g_LangSelIdx);
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
// END keybdcmt.htm
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// keybd.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var iMaxKeybdNameLen=1;
|
|
var iMaxRegionNameLen=1;
|
|
var iMaxLangNameLen=1;
|
|
|
|
function HandleKeybdPageSelMenuChange() {
|
|
var namestr=g.event.srcElement.id.slice(3);
|
|
eval('g.'+namestr+'Name.value=g.event.srcElement.options(g.event.srcElement.selectedIndex).text;');
|
|
eval('g_'+namestr+'SelIdx='+'g.event.srcElement.selectedIndex;');
|
|
}
|
|
|
|
function SetKeybdFocus() {
|
|
g.selKeyboard.focus();
|
|
}
|
|
|
|
function SetRegionFocus() {
|
|
g.selRegion.focus();
|
|
}
|
|
|
|
function SetLangFocus() {
|
|
g.selLang.focus();
|
|
}
|
|
|
|
// keep separating mechanism in case we need to shorten these strings
|
|
var L_LangStr_Text="I <u>t</u>ype mostly in this language:";
|
|
var LangStrSmall=L_LangStr_Text;
|
|
var L_RegionStr_Text="I li<u>v</u>e closest to this region:";
|
|
var RegionStrSmall=L_RegionStr_Text;
|
|
var L_KeybdStr_Text="I <u>u</u>se this type of keyboard:";
|
|
var KeybdStrSmall=L_KeybdStr_Text;
|
|
var L_KeybdTitleSmall_Text="Select Your System Settings";
|
|
var L_KeybdStrHint_Text="Hint: For a standard English-language keyboard, select US.";
|
|
var KeybdStrHintSmall=L_KeybdStrHint_Text;
|
|
|
|
|
|
|
|
function RegKBLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.selRegion;
|
|
|
|
InitNewButtons();
|
|
RetrieveRegKB();
|
|
|
|
g.selKeyboard.onchange = HandleKeybdPageSelMenuChange;
|
|
g.selRegion.onchange = HandleKeybdPageSelMenuChange;
|
|
g.selLang.onchange = HandleKeybdPageSelMenuChange;
|
|
|
|
// fix 110160
|
|
|
|
g.KeyboardName.onfocus = SetKeybdFocus;
|
|
g.RegionName.onfocus = SetRegionFocus;
|
|
g.LangName.onfocus = SetLangFocus;
|
|
|
|
// init name boxes
|
|
g.RegionName.value=g.selRegion.options(g.selRegion.selectedIndex).text;
|
|
g_RegionSelIdx=g.selRegion.selectedIndex;
|
|
g.LangName.value=g.selLang.options(g.selLang.selectedIndex).text;
|
|
g_LangSelIdx=g.selLang.selectedIndex;
|
|
g.KeyboardName.value=g.selKeyboard.options(g.selKeyboard.selectedIndex).text;
|
|
g_KeyboardSelIdx=g.selKeyboard.selectedIndex;
|
|
|
|
// need to shorten text for small screen to make things fit
|
|
if(!g_bInHighScreenRes) {
|
|
g.KeybdStr.innerHTML=KeybdStrSmall;
|
|
g.RegionStr.innerHTML=RegionStrSmall;
|
|
g.LangStr.innerHTML=LangStrSmall;
|
|
g.KeybdStrHint.innerHTML=KeybdStrHintSmall;
|
|
|
|
for(i=3;i<=5;i++) {
|
|
eval("g.LargeResSpc"+i.toString()+".style.display='none';");
|
|
}
|
|
g.KeyBdTitle.innerText=L_KeybdTitleSmall_Text;
|
|
} else {
|
|
g.KeybdStr.innerHTML=L_KeybdStr_Text;
|
|
g.RegionStr.innerHTML=L_RegionStr_Text;
|
|
g.LangStr.innerHTML=L_LangStr_Text;
|
|
g.KeybdStrHint.innerHTML=L_KeybdStrHint_Text;
|
|
}
|
|
|
|
g.LangStr.style.visibility="visible";
|
|
g.KeybdStr.style.visibility="visible";
|
|
g.RegionStr.style.visibility="visible";
|
|
g.KeybdStrHint.style.visibility="visible";
|
|
|
|
g.selRegion.style.visibility="visible";
|
|
g.selKeyboard.style.visibility="visible";
|
|
g.selLang.style.visibility="visible";
|
|
|
|
g.KeyboardName.style.visibility="visible";
|
|
g.RegionName.style.visibility="visible";
|
|
g.LangName.style.visibility="visible";
|
|
|
|
g.KeyboardName.style.cursor="default";
|
|
g.RegionName.style.cursor="default";
|
|
g.LangName.style.cursor="default";
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
// use this to enable "Enter" key as Next Button.
|
|
// but I really need to select focus'd button with enter.
|
|
// have next button be focused by default?? or is enter better, since
|
|
// they might not click on next
|
|
function RegKB_KeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.keyCode == KeyEnter)
|
|
GoNext();
|
|
|
|
}
|
|
|
|
function RetrieveRegKB()
|
|
{
|
|
if(LangObj.get_RegionIndex() > 20000) {
|
|
alert("error loading default region index: possible problem in locale.inf");
|
|
}
|
|
|
|
if(LangObj.get_KeyboardLayoutIndex() > 20000) {
|
|
alert("error loading default keybd index: possible problem in locale.inf");
|
|
}
|
|
|
|
if(LangObj.get_LangIndex() > 20000 ) {
|
|
alert("error loading default lang index: possible problem in locale.inf/content.inf");
|
|
}
|
|
|
|
var ilen = LangObj.get_NumOfRegions();
|
|
for (var i = 0; i < ilen; i++)
|
|
{
|
|
var oOption = g.document.createElement("OPTION");
|
|
oOption.text = LangObj.get_RegionName(i);
|
|
g.selRegion.add(oOption);
|
|
|
|
if(oOption.text.length > iMaxRegionNameLen) {
|
|
iMaxRegionNameLen=oOption.text.length;
|
|
}
|
|
}
|
|
|
|
ilen = LangObj.get_NumOfLangs();
|
|
for (var i = 0; i < ilen; i++)
|
|
{
|
|
var oOption = g.document.createElement("OPTION");
|
|
oOption.text = LangObj.get_LangName(i);
|
|
g.selLang.add(oOption);
|
|
|
|
if(oOption.text.length > iMaxLangNameLen) {
|
|
iMaxLangNameLen=oOption.text.length;
|
|
}
|
|
}
|
|
|
|
ilen = LangObj.get_NumOfKeyboardLayouts();
|
|
for (i = 0; i < ilen; i++)
|
|
{
|
|
var oOption = g.document.createElement("OPTION");
|
|
oOption.text = LangObj.get_KeyboardLayoutName(i);
|
|
g.selKeyboard.add(oOption);
|
|
|
|
if(oOption.text.length > iMaxKeybdNameLen)
|
|
iMaxKeybdNameLen=oOption.text.length;
|
|
}
|
|
|
|
// BUGBUG
|
|
g.selRegion.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
|
|
g.selRegion.selectedIndex= g_RegionSelIdx; // BUGBUG: these hacks dont work anymore
|
|
|
|
g.selKeyboard.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
|
|
g.selKeyboard.selectedIndex= g_KeyboardSelIdx;
|
|
|
|
g.selLang.selectedIndex = 0; //(HACK to make selected item to be made visible in select menu, there is no official way to do this)
|
|
g.selLang.selectedIndex= g_LangSelIdx;
|
|
}
|
|
// END keybd.htm
|
|
|
|
// fini.htm
|
|
|
|
// These vars are set on oobeutil.jsx
|
|
var g_IsActivationSuccessful = false;
|
|
var g_IsMSRegistrationSuccessful = false;
|
|
var g_IsOEMRegistrationSuccessful = false;
|
|
|
|
var g_ShowParagraph = false;
|
|
function ShowFinish_Paragraph_Header()
|
|
{
|
|
if (g_ShowParagraph)
|
|
{
|
|
g.FiniSummaryIntro2.style.display = "inline";
|
|
}
|
|
}
|
|
|
|
function FinishPage_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (g_IsActivationSuccessful)
|
|
{
|
|
var L_ActivateWindows_Text = "You activated your copy of Windows.<BR>";
|
|
|
|
g_ShowParagraph = true;
|
|
g.FiniSummary0.innerHTML = L_ActivateWindows_Text;
|
|
g.FiniSummary0.style.display = "inline";
|
|
}
|
|
|
|
// OEM didn't Pre-reg the machine
|
|
if (1 != window.external.get_RegStatus())
|
|
{
|
|
if (1 == RegisterObj.get_PostToOEM && g_IsOEMRegistrationSuccessful)
|
|
{
|
|
var strOEMName = g_OEMNameStr;
|
|
|
|
if (strOEMName == null || (strOEMName != null && strOEMName.length == 0))
|
|
{
|
|
var L_RegisterdWith_Text = "You registered your computer with the OEM.<BR>";
|
|
|
|
g.FiniSummary1.innerHTML = L_RegisterdWith_Text;
|
|
}
|
|
else
|
|
{
|
|
var L_RegisterdWith_Text = "You registered your computer with %1.<BR>";
|
|
|
|
g.FiniSummary1.innerHTML = ApiObj.FormatMessage(L_RegisterdWith_Text, strOEMName);
|
|
}
|
|
|
|
g_ShowParagraph = true;
|
|
g.FiniSummary1.style.display = "inline";
|
|
}
|
|
|
|
if (g_IsMSRegistrationSuccessful)
|
|
{
|
|
var L_RegisterdWithMS_Text = "You registered your copy of Windows with Microsoft.<BR>";
|
|
|
|
g_ShowParagraph = true;
|
|
g.FiniSummary2.innerHTML = L_RegisterdWithMS_Text;
|
|
g.FiniSummary2.style.display = "inline";
|
|
}
|
|
}
|
|
|
|
var bHasSignup = 0;
|
|
try
|
|
{
|
|
bHasSignup = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "ISPSignup");
|
|
}
|
|
catch (e) { bHasSignup = 0;}
|
|
|
|
if (bHasSignup || ConnectedToInternetEx(false))
|
|
{
|
|
var L_SignupWith_Text = "Your computer is configured for Internet access.<BR>";
|
|
|
|
g_ShowParagraph = true;
|
|
g.FiniSummary3.innerHTML = L_SignupWith_Text;
|
|
g.FiniSummary3.style.display = "inline";
|
|
}
|
|
|
|
if (bHasSignup || window.external.ConnectedToInternet())
|
|
{
|
|
window.external.SetICWCompleted();
|
|
}
|
|
|
|
ShowFinish_Paragraph_Header();
|
|
|
|
if (LANGUAGE_REBOOT_END == LangObj.get_RebootState())
|
|
{
|
|
g.finishmsg.style.display="none";
|
|
g.rebootfinishmsg.style.display="inline";
|
|
}
|
|
|
|
g.msgspan.style.display="inline";
|
|
|
|
if (g.btnNext != null)
|
|
g_FirstFocusElement = g.btnNext;
|
|
else if (g.btnBack != null)
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
InitNewButtons();
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// badpid.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function badpid_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
g_FirstFocusElement=g.btnBack;
|
|
|
|
if (null == PidObj)
|
|
{
|
|
PidObj = new Object;
|
|
PidObj = window.external.ProductID;
|
|
}
|
|
var strPid = PidObj.get_PID();
|
|
for (var i = 0; i < 5; i++)
|
|
{
|
|
g.lblPID[i].innerText = strPid.substr(i * 6, 5);
|
|
}
|
|
if (strPid.length == 0)
|
|
g.PidEntered.style.visibility = "hidden";
|
|
else
|
|
g.PidEntered.style.visibility = "visible";
|
|
|
|
InitNewButtons();
|
|
|
|
g_FirstFocusElement.focus();
|
|
|
|
g_CameFromBadPkeyPage=true;
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// username.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Function: UserName_LoadMe
|
|
// Description: This function is called if the user declines registration, and also declines
|
|
// to create any Identities (or we skip the Identities page?) then we should pop up a page
|
|
// that asks his/her name for personalization.
|
|
|
|
var g_RegisteredOwnerDone = false;
|
|
var g_UsernameFirstname_Valid = true;
|
|
var g_UsernameLastname_Valid = true;
|
|
function UserName_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
g_FirstFocusElement = g.txtUserFirstName;
|
|
|
|
// If we are in Far East, switch the rows of firstname and lastname, except if we are in Korean locale where we only use fullname.
|
|
if (IsFarEastLocale())
|
|
{
|
|
g.MainPageCell.style.display="none"; // hide while we change order
|
|
|
|
if (IsKoreanLocale())
|
|
{
|
|
g.spnUserName_Primary3.style.display="inline";
|
|
g.LastNameRow.style.display="none";
|
|
g.EnterUserFirstName_1.innerHTML=L_FullName_Text;
|
|
if (IspAccountObj.HasSignUp())
|
|
{
|
|
g.UserName_IspAccountNameF.innerText = IspAccountObj.UserName;
|
|
g.UserName_IspAccountNameF.style.display = "inline";
|
|
}
|
|
}
|
|
else
|
|
{
|
|
g.spnUserName_Primary2.style.display="inline";
|
|
if (g.LastNameRow == g.FieldTable.rows[1])
|
|
{
|
|
// swap the tab index
|
|
var i = g.txtUserLastName.tabIndex;
|
|
g.txtUserLastName.tabIndex = g.txtUserFirstName.tabIndex;
|
|
g.txtUserFirstName.tabIndex = i;
|
|
// swap the position
|
|
g.FieldTable.moveRow(1,0); // move lastname in front of the firstname
|
|
|
|
}
|
|
if ((!g_UsernameFirstname_Valid) && (g_UsernameLastname_Valid))
|
|
g_FirstFocusElement = g.txtUserFirstName;
|
|
else
|
|
g_FirstFocusElement = g.txtUserLastName;
|
|
|
|
if (IspAccountObj.HasSignUp())
|
|
{
|
|
g.UserName_IspAccountNameL.innerText = IspAccountObj.UserName;
|
|
g.UserName_IspAccountNameL.style.display = "inline";
|
|
}
|
|
}
|
|
|
|
g.MainPageCell.style.display="inline";
|
|
}
|
|
else
|
|
{
|
|
if ((!g_UsernameLastname_Valid) && (g_UsernameFirstname_Valid))
|
|
g_FirstFocusElement = g.txtUserLastName;
|
|
|
|
g.spnUserName_Primary1.style.display="inline";
|
|
if (IspAccountObj.HasSignUp())
|
|
{
|
|
g.UserName_IspAccountNameF.innerText = IspAccountObj.UserName;
|
|
g.UserName_IspAccountNameF.style.display = "inline";
|
|
}
|
|
}
|
|
|
|
g_FirstFocusElement.focus();
|
|
InitNewButtons();
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// prodkey.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var g_CameFromBadPkeyPage=false;
|
|
|
|
var g_LastFocusedPidBox;
|
|
var g_SelectionExistsBeforeKeyPress=null;
|
|
|
|
function PIDBox_HandleBlur() {
|
|
g_LastFocusedPidBox=g.event.srcElement;
|
|
}
|
|
|
|
function PIDBox_HandleFocus() {
|
|
g_LastFocusedPidBox=g.event.srcElement;
|
|
OnFocus();
|
|
}
|
|
|
|
function PID_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
// Show proper text and graphic if we are in retail or OEM mode
|
|
if (window.external.get_RetailOOBE())
|
|
{
|
|
// Retail scenario
|
|
g.PID_Retail_span.style.display="inline";
|
|
}
|
|
else
|
|
{
|
|
// OEM scenario
|
|
g.PID_OEM_span.style.display="inline";
|
|
}
|
|
|
|
g_FirstFocusElement = g.edtProductKey[0];
|
|
RetrievePid();
|
|
|
|
g_FirstFocusElement.focus();
|
|
var rangefocus = g_FirstFocusElement.createTextRange();
|
|
rangefocus.collapse();
|
|
rangefocus.moveStart("word", 0);
|
|
rangefocus.select();
|
|
|
|
g_TabForward = false;
|
|
g_TabBackward = false;
|
|
|
|
PID_CheckLength(false);
|
|
|
|
if(DebugObj.get_MsDebugMode) {
|
|
// Don't show the "Debug Skip" button anymore.
|
|
// g.btnSkip.style.visibility="visible";
|
|
}
|
|
|
|
for (i = 0; i <= 4; i++)
|
|
{
|
|
g.edtProductKey[i].onblur=PIDBox_HandleBlur;
|
|
g.edtProductKey[i].onfocus=PIDBox_HandleFocus;
|
|
}
|
|
|
|
g_LastFocusedPidBox=g.edtProductKey[0];
|
|
|
|
InitNewButtons();
|
|
|
|
if(g_CameFromBadPkeyPage) {
|
|
g.edtProductKey[0].select();
|
|
g_CameFromBadPkeyPage=false;
|
|
}
|
|
}
|
|
|
|
var g_CharCode0_plus1=("0".charCodeAt(0))+1;
|
|
|
|
function KeyboardHelperClick()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
g.event.returnValue = false; // if false, cancels default action on button
|
|
g.event.cancelBubble = true;
|
|
|
|
if (g.event.srcElement.tagName == "BUTTON") {
|
|
|
|
g_LastFocusedPidBox.focus();
|
|
|
|
if(g.document.selection.type=="Text") {
|
|
g.document.execCommand("Delete");
|
|
|
|
if(g.event.srcElement.name=="{BACKSPACE}")
|
|
return;
|
|
}
|
|
|
|
if(g.event.srcElement.name=="{BACKSPACE}") {
|
|
var tr=g_LastFocusedPidBox.createTextRange();
|
|
tr.collapse(false);
|
|
tr.moveStart("character",-1);
|
|
tr.execCommand("Delete");
|
|
return;
|
|
}
|
|
|
|
var i=g_LastFocusedPidBox.id.charCodeAt(3)-g_CharCode0_plus1;
|
|
|
|
if((i<4) && (g_LastFocusedPidBox.value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
|
|
TabForward(i,false);
|
|
// should change to g_LastFocusedPidBox, but isn't working due to some IE5.5 regression (focus handler event srcElement is not new event pidbox but current event one)
|
|
}
|
|
|
|
if (g_LastFocusedPidBox.value.length != 5) {
|
|
|
|
g_LastFocusedPidBox.value+=g.event.srcElement.name;
|
|
|
|
// AGENT: notify Agent of the event, NOTE: code in AgtScrpt.js.
|
|
|
|
Agent_OnProductKeyKeyboardHelper(g_LastFocusedPidBox, g.event.srcElement.name);
|
|
|
|
if (g_TabBackward) {
|
|
TabBackward(i,false);
|
|
} else if(g_TabForward) {
|
|
TabForward(i,false);
|
|
}
|
|
|
|
g_TabForward = false;
|
|
g_TabBackward = false;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function PID_CheckLength(KnownIncomplete)
|
|
{
|
|
// call this only if box reaches length 5 for speed?
|
|
|
|
if(KnownIncomplete) {
|
|
g.btnNext.onclick = null;
|
|
g.btnNext.disabled = true;
|
|
g.btnNext.className="newbuttonsNext-disabled";
|
|
return;
|
|
}
|
|
|
|
var TotLength=g.edtProductKey[0].value.length+g.edtProductKey[1].value.length+
|
|
g.edtProductKey[2].value.length+g.edtProductKey[3].value.length+
|
|
g.edtProductKey[4].value.length;
|
|
|
|
if (TotLength == 25)
|
|
{
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.className="newbuttonsNext";
|
|
g.btnNext.onclick = GoNext;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.onclick = null;
|
|
g.btnNext.disabled = true;
|
|
g.btnNext.className="newbuttonsNext-disabled";
|
|
}
|
|
}
|
|
|
|
function RetrievePid()
|
|
{
|
|
// retrieves the pid if avialable.
|
|
var strPid = PidObj.get_PID();
|
|
|
|
// if there is no PID then we set the
|
|
// focus to the first field
|
|
if (strPid.length == 0)
|
|
{
|
|
g.edtProductKey[0].focus();
|
|
}
|
|
// else we populate the fields with the
|
|
// sections of the PID
|
|
else
|
|
{
|
|
var re = new RegExp("(.*)-(.*)-(.*)-(.*)-(.*)","");
|
|
if(re.exec(strPid) == null) {
|
|
throw "Internal error: RegExp pattmatch failed!";
|
|
}
|
|
|
|
g.edtProductKey[0].value = RegExp.$1;
|
|
g.edtProductKey[1].value = RegExp.$2;
|
|
g.edtProductKey[2].value = RegExp.$3;
|
|
g.edtProductKey[3].value = RegExp.$4;
|
|
g.edtProductKey[4].value = RegExp.$5;
|
|
}
|
|
}
|
|
|
|
var g_TabForward = false;
|
|
function TabForward(currentEdit,DoSelectAll)
|
|
{
|
|
g_TabForward = false;
|
|
|
|
if(currentEdit==4) {
|
|
// deselect any existing selection before moving focus to back button
|
|
if(g.document.selection.type!="None") {
|
|
g.document.selection.empty();
|
|
}
|
|
g.btnBack.focus();
|
|
return;
|
|
}
|
|
|
|
currentEdit++;
|
|
|
|
g.edtProductKey[currentEdit].focus();
|
|
|
|
if(DoSelectAll) {
|
|
g.edtProductKey[currentEdit].select();
|
|
return;
|
|
}
|
|
|
|
var tr = g.edtProductKey[currentEdit].createTextRange();
|
|
tr.collapse(true);
|
|
tr.moveStart("word", 0);
|
|
tr.select();
|
|
|
|
}
|
|
|
|
var g_TabBackward = false;
|
|
function TabBackward(currentEdit,DoSelectAll)
|
|
{
|
|
g_TabBackward = false;
|
|
|
|
if (currentEdit == 0) {
|
|
// deselect any existing selection before moving focus to button
|
|
if(g.document.selection.type!="None") {
|
|
g.document.selection.empty();
|
|
}
|
|
if(g.btnNext.disabled) {
|
|
g.btnBack.focus();
|
|
} else {
|
|
g.btnNext.focus();
|
|
}
|
|
|
|
return;
|
|
}
|
|
|
|
currentEdit--;
|
|
|
|
g.edtProductKey[currentEdit].focus();
|
|
|
|
if(DoSelectAll) {
|
|
g.edtProductKey[currentEdit].select();
|
|
return;
|
|
}
|
|
|
|
var tr = g.edtProductKey[currentEdit].createTextRange();
|
|
tr.collapse(false);
|
|
tr.moveStart("word", 1);
|
|
tr.select();
|
|
}
|
|
|
|
function CursorAtStartOfField(currentEdit) {
|
|
var tr = g.edtProductKey[currentEdit].createTextRange();
|
|
var tr2 = g.document.selection.createRange();
|
|
|
|
tr2.moveEnd("textedit",1);
|
|
|
|
if(tr.isEqual(tr2)){
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function CursorAtEndOfField(currentEdit) {
|
|
// assumes selection is current edit field
|
|
|
|
var tr = g.edtProductKey[currentEdit].createTextRange();
|
|
var tr2 = g.document.selection.createRange();
|
|
|
|
tr2.moveStart("textedit",-1);
|
|
|
|
if(tr.isEqual(tr2)){
|
|
return true;
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
function IsProductIDKey(keyCode)
|
|
{
|
|
var str = String.fromCharCode(keyCode);
|
|
|
|
var result = str.match(/B|C|D|F|G|H|J|K|M|P|Q|R|T|V|W|X|Y|2|3|4|6|7|8|9/);
|
|
|
|
return (null != result);
|
|
}
|
|
|
|
var g_keyPressKeyCode = 0;
|
|
|
|
function ProductIDPropertyChange()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// enable Next Btn when PID is full, and automatically move to
|
|
// next/previous field when entering/deleting chars
|
|
|
|
if ("value" == g.event.propertyName) {
|
|
|
|
// find the index at which we are.
|
|
var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
|
|
|
|
// our g_Tab variables can be booleans instead of counts because they can
|
|
// have a max value of 1, becase there will only ever be 1 call to OnPropertyChange if the
|
|
// length of the edit is 0 or 5
|
|
switch(g.edtProductKey[i].value.length) {
|
|
case 5:
|
|
g_TabForward = (i<4); // dont tab forward if on last PID box
|
|
PID_CheckLength(false);
|
|
break;
|
|
|
|
case 4:
|
|
case 0:
|
|
case 1:
|
|
PID_CheckLength(true); //change from 25char-state could have occurred with any of these lengths
|
|
}
|
|
|
|
// see if we want to tab backward
|
|
// if pixbox is empty, and last keypress was not a pidkey (which adds a char),
|
|
// and nothing was selected.
|
|
|
|
// BUGBUG: this currently only fully works for the delete key. when backspace
|
|
// is pressed, g.document.selection.type is always "None" even if there was a selection
|
|
if ((g.edtProductKey[i].value.length == 0) && (i > 0) &&
|
|
(g_keyPressKeyCode==KeyBackSpc)&&(g_keyPressKeyCode==KeyDelete)&&
|
|
(g.document.selection.type=="None")) {
|
|
|
|
g_TabBackward = true; // IsProd check is to handle the case where they select everything then press a 2, etc.
|
|
}
|
|
}
|
|
|
|
g_keyPressKeyCode = 0;
|
|
}
|
|
|
|
//As of IE 4.0, the onkeypress event fires and can be canceled for the following keys:
|
|
//
|
|
//Letters: a - z
|
|
//Numerals: 0 - 9
|
|
//Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
|
|
//System: ESCAPE, SPACE, SHIFT
|
|
|
|
function ProductIDKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// BUGBUG: hack workaround: KeyBackSpc event should arrive at KeyDown handler, but it comes here instead
|
|
// I dont know why
|
|
|
|
|
|
if (g.event.keyCode == KeyBackSpc) {
|
|
ProductIDKeyDown();
|
|
return;
|
|
}
|
|
|
|
KeyCodeToUpper();
|
|
|
|
g_keyPressKeyCode = g.event.keyCode;
|
|
|
|
if (!IsProductIDKey(g_keyPressKeyCode)) {
|
|
g.event.keyCode = 0;
|
|
return;
|
|
} else {
|
|
|
|
var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
|
|
|
|
if((i<4) && (g.edtProductKey[i].value.length == 5) && CursorAtEndOfField(i) && (!g_SelectionExistsBeforeKeyPress)) {
|
|
TabForward(i,false);
|
|
}
|
|
}
|
|
}
|
|
|
|
//In IE 5.0, the onkeydown event fires for the following keys:
|
|
//
|
|
//Editing: DELETE, INSERT,BACKSPACE
|
|
//Function: F1 - F12
|
|
//Letters: a - z
|
|
//Navigation: HOME, END, Left Arrow, Right Arrow, Up Arrow, Down Arrow, PAGE UP, PAGE DOWN
|
|
//Numerals: 0 - 9
|
|
//Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
|
|
//System: ESCAPE, SPACE, SHIFT, TAB, SHIFT+TAB
|
|
//
|
|
// the following keys and key combinations can be canceled by specifying event.returnValue=false:
|
|
//
|
|
//Editing: BACKSPACE, DELETE
|
|
//Letters: a - z
|
|
//Navigation: PAGE UP, PAGE DOWN, END, HOME, Left Arrow, Right Arrow, Up Arrow, Down Arrow
|
|
//Numerals: 0 - 9
|
|
//Symbols: ! @ # $ % ^ & * ( ) _ - + = < > [ ] { } , . / ? \ | ' ` " ~
|
|
//System: SPACE, ESCAPE, TAB, SHIFT+TAB
|
|
|
|
function ProductIDKeyDown()
|
|
{
|
|
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
var keyCode = g.event.keyCode;
|
|
|
|
g_SelectionExistsBeforeKeyPress=(g.document.selection.type!="None");
|
|
|
|
if(g.event.srcElement.tagName=="INPUT") {
|
|
var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
|
|
} else {
|
|
var i=-1;
|
|
}
|
|
|
|
switch(keyCode) {
|
|
|
|
case KeyTab:
|
|
if(g.event.srcElement == g.edtProductKey[i]) {
|
|
if(g.event.shiftKey)
|
|
TabBackward(i,true);
|
|
else TabForward(i,true);
|
|
|
|
g.event.returnValue = false;
|
|
g.event.keyCode = 0;
|
|
g.event.cancelBubble = true;
|
|
break;
|
|
}
|
|
break;
|
|
|
|
case KeyLeftArrow:
|
|
if((i>0) && CursorAtStartOfField(i)) {
|
|
TabBackward(i,false);
|
|
g.event.returnValue = false;
|
|
}
|
|
break;
|
|
|
|
case KeyRightArrow:
|
|
if((i<4) && CursorAtEndOfField(i)) {
|
|
TabForward(i,false);
|
|
g.event.returnValue = false;
|
|
}
|
|
break;
|
|
|
|
case KeyBackSpc:
|
|
case KeyDelete:
|
|
|
|
// if there is already 5 characters in a field, and the user puts the cursor in it, we want to
|
|
// fill in the next box with the character. we have to do this here because there is no propertychange,
|
|
// and keyup is too late
|
|
//if(g.edtProductKey[i].value.length == 5 && IsProductIDKey(keyCode) && g.document.selection==null)
|
|
// TabForward(i);
|
|
// cgeorges note: I enabled this feature tried it and didnt like it
|
|
|
|
////////
|
|
// we want the delete/backspace to move the previous edit box if:
|
|
|
|
// there is 0 characters, and the user puts the cursor in it, and selection is non-null
|
|
// OR backspc && cursor is at start of field
|
|
|
|
if ((i > 0) &&
|
|
( ((g.document.selection.type=="None") && (g.edtProductKey[i].value.length == 0))
|
|
||((keyCode==KeyBackSpc)&& CursorAtStartOfField(i)))) {
|
|
|
|
TabBackward(i,false);
|
|
g.event.returnValue = false; // so no deletion occurs when backspace moves to prev pidbox
|
|
g.event.keyCode = 0;
|
|
}
|
|
|
|
break;
|
|
|
|
case KeyEnter:
|
|
if((g.btnNext.disabled == false)&&(g.event.srcElement!=g.btnBack)) {
|
|
g.btnNext.click();
|
|
g.event.returnValue = false;
|
|
g.event.keyCode = 0;
|
|
g.event.cancelBubble = true;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
function ProductIDKeyUp()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if((!g_TabForward) && (!g_TabBackward)) {
|
|
return;
|
|
}
|
|
|
|
var i=g.event.srcElement.id.charCodeAt(3)-g_CharCode0_plus1;
|
|
|
|
if (g_TabBackward) {
|
|
TabBackward(i,false);
|
|
return;
|
|
} else
|
|
if(g_TabForward) {
|
|
TabForward(i,false);
|
|
}
|
|
}
|
|
|
|
// called on every mouse click into PID page body, to make sure focus never leaves PID fields
|
|
function PID_SetCorrectFocus()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if((g.event.srcElement.tagName == "INPUT")||(g.event.srcElement.tagName == "BUTTON")) {
|
|
return;
|
|
}
|
|
|
|
// only get here if we clicked on something unexpected
|
|
|
|
for (var i = 0; i < 5; i++)
|
|
{
|
|
if (g.event.srcElement == g.edtProductKey[i])
|
|
{
|
|
return;
|
|
}
|
|
}
|
|
|
|
// if full key is entered then pass events directly to buttons without doing the stuff below
|
|
if((g.btnNext.disabled == false) && (g.btnNext.contains(g.event.srcElement) || g.btnBack.contains(g.event.srcElement)))
|
|
return;
|
|
|
|
for (var i = 4; i >= 0; i--)
|
|
{
|
|
if (g.edtProductKey[i].value.length < 5 && g.edtProductKey[i].value.length > 0)
|
|
{
|
|
g.edtProductKey[i].focus();
|
|
var range = g.edtProductKey[i].createTextRange();
|
|
range.collapse();
|
|
range.moveStart("word", 1);
|
|
range.select();
|
|
return;
|
|
}
|
|
}
|
|
|
|
if (i < 0)
|
|
{
|
|
g.edtProductKey[0].focus();
|
|
var range = g.edtProductKey[0].createTextRange();
|
|
range.collapse();
|
|
range.moveStart("word", 0);
|
|
range.select();
|
|
return;
|
|
}
|
|
}
|
|
// END pid.htm
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// hndshake.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function hndshake_OnKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Treat the enter key like the next button
|
|
if ((g.event.keyCode == KeyEnter) &&
|
|
(g.btnNext.disabled == false))
|
|
{
|
|
GoNext();
|
|
}
|
|
else
|
|
{
|
|
KeyPressIsValid();
|
|
}
|
|
}
|
|
|
|
|
|
function hndshake_CheckEdits()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.srcElement != g.edtMSNPhoneNumber)
|
|
{
|
|
hndshake_CheckEnableNextButton();
|
|
}
|
|
}
|
|
|
|
|
|
function hndshake_CheckEnableNextButton()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.edtMSNPhoneNumber.value.length)
|
|
{
|
|
g.btnNext.disabled = false;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.disabled = true;
|
|
}
|
|
|
|
InitNewButtons();
|
|
}
|
|
|
|
|
|
function hndshake_LoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.edtMSNPhoneNumber;
|
|
|
|
hndshake_CheckEnableNextButton();
|
|
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// pberr.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function Newpberr_LoadMe()
|
|
{
|
|
New_Default_LoadMe('SimpleBack');
|
|
|
|
var L_pbErrOEMName_Text = g_OEMNameStr;
|
|
if (L_pbErrOEMName_Text == "")
|
|
{
|
|
L_pbErrOEMName_Text = L_MissingOEMName_Text;
|
|
}
|
|
|
|
var L_MainPBerrMsg_Text = "";
|
|
|
|
if (g_DoActivation)
|
|
{
|
|
if ((g_PostToMS) && (g_PostToOEM))
|
|
{
|
|
L_MainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. To register your computer later without an Internet connection, please contact %1. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft over the telephone.";
|
|
g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
|
|
}
|
|
else if ((g_PostToMS) && (!g_PostToOEM))
|
|
{
|
|
L_MainPBerrMsg_Text = "Online registration and activation are currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft by telephone. An Internet connection is needed to register your copy of Windows with Microsoft.";
|
|
g.pberr_par1.innerText = L_MainPBerrMsg_Text;
|
|
}
|
|
else if ((!g_PostToMS) && (g_PostToOEM))
|
|
{
|
|
L_MainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft by telephone. To register your computer later without an Internet connection, please contact %1.";
|
|
g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
|
|
}
|
|
else
|
|
{
|
|
// If we're here, it means g_PostToMS=flase and g_PostToOEM=false.
|
|
L_MainPBerrMsg_Text = "Online activation is currently unavailable in your country or region. You can activate your copy of Windows later using an Internet connection or by contacting Microsoft over the telephone.";
|
|
g.pberr_par1.innerText = L_MainPBerrMsg_Text;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ((!g_PostToMS) && (g_PostToOEM))
|
|
{
|
|
L_MainPBerrMsg_Text = "Online registration is currently unavailable in your country or region. To register your computer later without an Internet connection, please contact %1.";
|
|
g.pberr_par1.innerText = ApiObj.FormatMessage(L_MainPBerrMsg_Text, L_pbErrOEMName_Text);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// jndomain.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
var g_Domain = ( window.external.GetNetJoinStatus() == JOIN_STATUS_DOMAIN );
|
|
var g_DomainName = null;
|
|
var g_DomainUser = null;
|
|
var g_DomainPass = null;
|
|
var g_DomainDone = false;
|
|
|
|
function jndomain_OnKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.keyCode == KeyEnter)
|
|
{
|
|
jndomainNextBtnHandler();
|
|
}
|
|
}
|
|
|
|
function jndomainNextBtnHandler()
|
|
{
|
|
if (g.radioYesDomain.checked)
|
|
{
|
|
g_Domain = g.radioYesDomain.checked;
|
|
g_DomainName = g.textboxDomain.value;
|
|
Navigate("setup\\jndom_a.htm"); // This will navigate to "Enter your domain settings - Username, Password..."
|
|
}
|
|
else
|
|
{
|
|
g_Domain = !g.radioNoDomain.checked;
|
|
g_DomainName = "";
|
|
GoNext();
|
|
}
|
|
}
|
|
|
|
var jndom_rb_stat = 0;
|
|
function jndomainLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
g_FirstFocusElement.focus();
|
|
|
|
InitNewButtons();
|
|
g.radioYesDomain.checked = false;
|
|
g.radioNoDomain.checked = false;
|
|
|
|
if (jndom_rb_stat==0)
|
|
g.radioNoDomain.checked=true;
|
|
else
|
|
g.radioYesDomain.checked=true;
|
|
|
|
checkJoinDomain();
|
|
g.btnNext.onclick = jndomainNextBtnHandler;
|
|
}
|
|
|
|
function jndom_a_OnKeyPress()
|
|
{
|
|
try
|
|
{
|
|
if (g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.keyCode == KeyEnter)
|
|
{
|
|
jndomain2NextBtnHandler();
|
|
}
|
|
}
|
|
|
|
function jndomain2NextBtnHandler()
|
|
{
|
|
g_DomainUser = g.textboxDomUser.value;
|
|
g_DomainPass = g.textboxDomPass.value;
|
|
|
|
GoNext();
|
|
}
|
|
|
|
function jndomainLoadMe2()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (g.btnNext != null)
|
|
g_FirstFocusElement = g.btnNext;
|
|
else
|
|
if (g.btnSkip != null)
|
|
g_FirstFocusElement = g.btnSkip;
|
|
else
|
|
if (g.btnBack != null)
|
|
g_FirstFocusElement = g.btnBack;
|
|
|
|
InitNewButtons("SimpleBack", null);
|
|
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
else
|
|
g.document.body.focus();
|
|
|
|
g.btnNext.onclick = jndomain2NextBtnHandler;
|
|
}
|
|
|
|
function checkJoinDomain()
|
|
{
|
|
if (g.radioNoDomain.checked)
|
|
{
|
|
g.textboxDomain.disabled = true;
|
|
g.textboxDomain.style.backgroundColor='#dddddd';
|
|
jndom_rb_stat = 0;
|
|
}
|
|
else
|
|
{
|
|
g.textboxDomain.disabled = false;
|
|
g.textboxDomain.style.backgroundColor='#ffffff';
|
|
jndom_rb_stat = 1;
|
|
}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// Security Password
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
var g_AdminPassword = null;
|
|
|
|
function validatePassword()
|
|
{
|
|
if (g.ConfirmPass.value != g.SecurityPass.value)
|
|
{
|
|
g.SecurityPass.value = "";
|
|
g.ConfirmPass.value = "";
|
|
g.SecurityExplHidden.style.display = "";
|
|
}
|
|
else
|
|
GoNext();
|
|
}
|
|
|
|
function SecurityPasswordLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
InitNewButtons();
|
|
g_FirstFocusElement = g.SecurityPass;
|
|
g_FirstFocusElement.focus();
|
|
g_FirstFocusElement.select();
|
|
g.btnNext.onclick = validatePassword;
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// MISC Functions
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
// Page Navigation
|
|
|
|
// InitCKPT, PushCKPT, PopCKPT, CKPTFromVal are meant to handle the behavior for GoBack.
|
|
// We only go back to certain pages (i.e., Sound Check).
|
|
// And on some of the pages, we only go back if they haven't been
|
|
// completed (i.e., EULA, PID).
|
|
//
|
|
// So, we push checkpoints if we intend to all coming back to that page.
|
|
// We pop checkpoints if we no longer want to come back (e.g., we've
|
|
// completed that page.
|
|
|
|
function InitCKPT()
|
|
{
|
|
|
|
// STATUS_ISP(0) STATUS_PRECONFIG STATUS_NONE STATUS_OFF
|
|
// ------------ ------------- ------------- --------------
|
|
dnCKPT[CKPT_ANIMATION] = new CheckPoint("", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
|
|
dnCKPT[CKPT_HWCHK] = new CheckPoint("", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
|
|
dnCKPT[CKPT_WELCOME] = new CheckPoint("setup\\welcome.htm", SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME, SNDX_WELCOME);
|
|
dnCKPT[CKPT_MOUSETUT1] = new CheckPoint("html\\mouse\\mouse.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_IMETUTORIAL] = new CheckPoint("html\\IME\\IMETut1.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_OEMHW] = new CheckPoint("html\\oemhw\\oemhw.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_REGION_KEYBD] = new CheckPoint("setup\\keybd.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_REGKB_COMMIT] = new CheckPoint("setup\\keybdcmt.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_TIMEZONE] = new CheckPoint("setup\\timezone.htm", SNDX_HW, SNDX_HW, SNDX_HW, SNDX_HW);
|
|
dnCKPT[CKPT_EULA] = new CheckPoint("setup\\neweula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_EULA_DECLINE] = new CheckPoint("setup\\badeula.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_PRODUCTKEY] = new CheckPoint("setup\\prodkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_BADPRODUCTKEY] = new CheckPoint("setup\\badpkey.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_COMPNAME] = new CheckPoint("setup\\compname.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_SECPASS] = new CheckPoint("setup\\security.htm", SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL, SNDX_LEGAL);
|
|
dnCKPT[CKPT_JNDOMAIN] = new CheckPoint("setup\\jndomain.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_ICSCHOICE] = new CheckPoint("setup\\ics.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_SCONNECT] = new CheckPoint("html\\sconnect\\sconnect.htm",SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_HOMENETWIZPROMPT] = new CheckPoint("setup\\hnwprmpt.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_DSLMAIN] = new CheckPoint("html\\dslmain\\dslmain.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_DSLPPPOE]=new CheckPoint("html\\dslmain\\dsl_a.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_DSLBROADBAND]=new CheckPoint("html\\dslmain\\dsl_b.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_CONGRATS]=new CheckPoint("html\\dslmain\\dsllast.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_ACTIVATION] = new CheckPoint("setup\\activate.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_REGISTER1] = new CheckPoint("setup\\reg1.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_REGISTER3] = new CheckPoint("setup\\reg3.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_ACT_MSG] = new CheckPoint("setup\\acterror.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_ICONN] = new CheckPoint("setup\\iconn.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_REGDIAL] = new CheckPoint("setup\\drdyoem.htm", SNDX_REG, SNDX_REG, SNDX_REG, SNDX_REG);
|
|
dnCKPT[CKPT_ISPSIGNUP] = new CheckPoint("setup\\isp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_MIGLIST] = new CheckPoint("setup\\miglist.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_ISPDIAL] = new CheckPoint("setup\\drdyisp.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_REFDIAL] = new CheckPoint("setup\\drdyref.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_MIGDIAL] = new CheckPoint("setup\\drdymig.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_ISPTYPE] = new CheckPoint("html\\isptype\\isptype.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_ICONNECT] = new CheckPoint("html\\iconnect\\iconnect.htm",SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_OEMISP] = new CheckPoint("html\\ispsgnup\\ispsgnup.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_OEMCUST] = new CheckPoint("html\\oemcust\\oemcust.htm", SNDX_ISP, SNDX_ISP, SNDX_ISP, SNDX_ISP);
|
|
dnCKPT[CKPT_IDENTITIES2] = new CheckPoint("setup\\ident2.htm", SNDX_IDENTITIES, SNDX_IDENTITIES, SNDX_IDENTITIES, SNDX_IDENTITIES);
|
|
dnCKPT[CKPT_DONE] = new CheckPoint("setup\\fini.htm", SNDX_FINI, SNDX_FINI, SNDX_FINI, SNDX_FINI);
|
|
|
|
PopCKPT();
|
|
|
|
// init simple navigation mappings
|
|
|
|
g_SimpleNavMap= new ActiveXObject("Scripting.Dictionary");
|
|
g_SimpleNavMap.CompareMode = COMPAREMODE_TEXT;
|
|
|
|
InitSimpleNavMap_MouseTut();
|
|
iconnect_InitSimpleNavMap();
|
|
sconnect_InitSimpleNavMap();
|
|
|
|
}
|
|
|
|
function PushCKPT(ckpt)
|
|
{
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
var tos = 0;
|
|
try
|
|
{
|
|
tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
|
|
}
|
|
catch (e) {}
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString(), ckpt);
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, ++tos);
|
|
ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
|
|
g_CurrentCKPT = ckpt;
|
|
}
|
|
}
|
|
|
|
function ClearStatusBar()
|
|
{
|
|
StatusBar1.style.backgroundColor = "#bbbbbb";
|
|
StatusBar2.style.backgroundColor = "#bbbbbb";
|
|
StatusBar3.style.backgroundColor = "#bbbbbb";
|
|
StatusBar4.style.backgroundColor = "#bbbbbb";
|
|
StatusBar5.style.backgroundColor = "#bbbbbb";
|
|
}
|
|
|
|
function PaintStatusBar(WhatBar)
|
|
{
|
|
// We use this method so that whenever we skip a step, that step is highlighted as well.
|
|
|
|
var HighlightColor = "#00cc00"; // Green
|
|
|
|
if (WhatBar == "1")
|
|
{
|
|
StatusBar1.style.backgroundColor = HighlightColor;
|
|
}
|
|
if (WhatBar == "2")
|
|
{
|
|
StatusBar1.style.backgroundColor = HighlightColor;
|
|
StatusBar2.style.backgroundColor = HighlightColor;
|
|
}
|
|
if (WhatBar == "3")
|
|
{
|
|
StatusBar1.style.backgroundColor = HighlightColor;
|
|
StatusBar2.style.backgroundColor = HighlightColor;
|
|
StatusBar3.style.backgroundColor = HighlightColor;
|
|
}
|
|
if (WhatBar == "4")
|
|
{
|
|
StatusBar1.style.backgroundColor = HighlightColor;
|
|
StatusBar2.style.backgroundColor = HighlightColor;
|
|
StatusBar3.style.backgroundColor = HighlightColor;
|
|
StatusBar4.style.backgroundColor = HighlightColor;
|
|
}
|
|
if (WhatBar == "5")
|
|
{
|
|
StatusBar1.style.backgroundColor = HighlightColor;
|
|
StatusBar2.style.backgroundColor = HighlightColor;
|
|
StatusBar3.style.backgroundColor = HighlightColor;
|
|
StatusBar4.style.backgroundColor = HighlightColor;
|
|
StatusBar5.style.backgroundColor = HighlightColor;
|
|
}
|
|
}
|
|
|
|
function PopCKPT(ckptCheck)
|
|
{
|
|
var ckpt = 0;
|
|
try
|
|
{
|
|
var tos = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE);
|
|
if (tos > 0)
|
|
{
|
|
ckpt = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, (tos - 1).toString());
|
|
|
|
if (null == ckptCheck || ckpt == ckptCheck)
|
|
{
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, TOS_REG_VALUE, --tos);
|
|
ApiObj.DeleteRegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + CKPT_REG_KEY, tos.toString());
|
|
ApiObj.FlushRegKey(HKEY_LOCAL_MACHINE);
|
|
}
|
|
}
|
|
}
|
|
catch (e) {}
|
|
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
g_CurrentCKPT = ckpt;
|
|
}
|
|
else
|
|
g_CurrentCKPT = null;
|
|
}
|
|
|
|
function EmptyCKPTStack()
|
|
{
|
|
while (null != g_CurrentCKPT)
|
|
{
|
|
PopCKPT();
|
|
}
|
|
}
|
|
|
|
function URLFromCKPT(ckpt)
|
|
{
|
|
var str = "";
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
str = dnCKPT[ckpt].strURL;
|
|
}
|
|
return str;
|
|
}
|
|
|
|
function IndexFromCKPT(ckpt, status)
|
|
{
|
|
var index = 0;
|
|
if (ckpt > 0 && ckpt < CKPT_MAX)
|
|
{
|
|
var checkpoint = dnCKPT[ckpt];
|
|
index = checkpoint.rgindex[status];
|
|
}
|
|
return index;
|
|
}
|
|
|
|
function IsLocalFile()
|
|
{
|
|
try
|
|
{
|
|
return (-1 != g.location.protocol.indexOf("file"));
|
|
}
|
|
catch (e)
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// public navigation APIs
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var g_fVideoGonextStarted = false;
|
|
function VideoGoNext(CalledBy)
|
|
{
|
|
OOBEDocBody.style.backgroundColor="#4E6FD6";
|
|
|
|
if (!g_fVideoGonextStarted)
|
|
{
|
|
g_fVideoGonextStarted = true;
|
|
|
|
if (CalledBy == null)
|
|
{
|
|
CalledBy = "Timer";
|
|
}
|
|
|
|
trace("VideoGoNext: Called by " + CalledBy);
|
|
|
|
// We clear g_VideoEvent inside a try statement because we will script error if setTimeout is already executed.
|
|
try
|
|
{
|
|
window.clearTimeout(g_VideoEvent);
|
|
}
|
|
catch(e){}
|
|
|
|
if (CalledBy == "Timer")
|
|
{
|
|
GoNext();
|
|
}
|
|
else
|
|
{
|
|
// Don't use the WM player thread to call GoNext.
|
|
setTimeout("GoNext()", 40);
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
function SetBack(strURL)
|
|
{
|
|
g_OEMAddBackURL = strURL;
|
|
}
|
|
|
|
// this handles the user's "Skip" requests
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// GoCancel
|
|
//
|
|
// This function is responsible for
|
|
// * Saving state for a page when the Skip button is clicked.
|
|
// * Calling GoNavigate with the checkpoint id of the next checkpoint
|
|
//
|
|
// This function is NOT responsible for
|
|
// * Setting state for the next page. That should be done in GoNavigate.
|
|
//
|
|
// Default behavior is to navigate to the first page of the next checkpoint.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function GoCancel(ckpt)
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
DisableAllButtons();
|
|
|
|
switch (g_CurrentCKPT)
|
|
{
|
|
case CKPT_HWCHK:
|
|
GoNavigate(CKPT_WELCOME);
|
|
break;
|
|
|
|
case CKPT_WELCOME:
|
|
// allow the user to bail out of OOBE
|
|
PushCKPT(CKPT_DONE);
|
|
GoNext();
|
|
break;
|
|
|
|
case CKPT_REGION_KEYBD:
|
|
// need to avoid handling any existing input info, which GoNext does
|
|
GoNavigate(CKPT_TIMEZONE);
|
|
break;
|
|
|
|
case CKPT_PRODUCTKEY:
|
|
// skip button only exists in debug mode. lets you skip PID page
|
|
PopCKPT(CKPT_PRODUCTKEY); // make sure we go back to reg1.htm
|
|
GoNavigate(CKPT_COMPNAME);
|
|
break;
|
|
|
|
case CKPT_COMPNAME:
|
|
g.document.body.style.cursor = "wait";
|
|
|
|
// Disable the Computername edit field
|
|
g.txtCompName.style.backgroundColor='#dddddd';
|
|
g.txtCompName.disabled=true;
|
|
|
|
g.txtCompDesc.style.backgroundColor='#dddddd';
|
|
g.txtCompDesc.disabled=true;
|
|
g_ComputerDescription = null;
|
|
// Give the system some time to paint and then call the function
|
|
//
|
|
window.setTimeout("CompName_ChangeComplete(true);",50);
|
|
break;
|
|
|
|
case CKPT_ICSCHOICE:
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
|
|
case CKPT_DSLPPPOE: // fall through
|
|
case CKPT_DSLBROADBAND:
|
|
case CKPT_DSLMAIN:
|
|
PopCKPT();
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
|
|
case CKPT_REGISTER3:
|
|
Reg3SaveSettings(); // save field settings in case we return to page
|
|
g_PostToMS = false;
|
|
g_PostToOEM = false;
|
|
if ( !g_DoActivation )
|
|
{
|
|
GoNavigate(CKPT_ICONN);
|
|
break;
|
|
}
|
|
else if (UseNetwork())
|
|
{
|
|
LanActReg();
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_REGDIAL);
|
|
break;
|
|
}
|
|
break;
|
|
|
|
case CKPT_ISPSIGNUP:
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_MIGLIST:
|
|
// When skip on the referral dialing, go to finish
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_REGDIAL:
|
|
GoNavigate(CKPT_ICONN);
|
|
break;
|
|
|
|
case CKPT_REFDIAL:
|
|
case CKPT_MIGDIAL:
|
|
case CKPT_ISPDIAL:
|
|
// When skip on the referral dialing, go to finish
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_IDENTITIES2:
|
|
InfoObj.set_UseIdentities(false);
|
|
GoNavigate(CKPT_DONE);
|
|
// GoNext();
|
|
break;
|
|
|
|
default:
|
|
GoNext();
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// GoBack
|
|
//
|
|
// This function is responsible for
|
|
// * Saving state for a page when the Back button is clicked.
|
|
// * Popping the current checkpoint off the checkpoint stack
|
|
// * Navigating to the previous checkpoint
|
|
//
|
|
// This function is NOT responsible for
|
|
// * Setting state for the next page. That should be done in GoNavigate.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function GoBack(ckpt)
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null && (g_CurrentCKPT != g_DialCKPT))
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
DisableAllButtons();
|
|
|
|
if(g_CurrentCKPT == g_DialCKPT)
|
|
ResetDialing();
|
|
else if(g_CurrentCKPT == CKPT_ISPSIGNUP)
|
|
ResetDialing();
|
|
else if(g_CurrentCKPT == CKPT_REGISTER1)
|
|
Reg1SaveRadioState(); // save radio button settings in case we return to page
|
|
else if(g_CurrentCKPT == CKPT_REGISTER3)
|
|
Reg3SaveSettings(); // save field settings in case we return to page
|
|
else if(g_CurrentCKPT == CKPT_PRODUCTKEY)
|
|
StorePid();
|
|
else if(g_CurrentCKPT == CKPT_IDENTITIES2)
|
|
Identities2_OnLeave();
|
|
// end if
|
|
|
|
{
|
|
var ckptPrevious = g_CurrentCKPT;
|
|
PopCKPT();
|
|
|
|
if (ckptPrevious == g_CurrentCKPT)
|
|
{
|
|
// This handles the case where the current page pushed itself on the stack.
|
|
PopCKPT();
|
|
}
|
|
|
|
if (g_CurrentCKPT > 0 && g_CurrentCKPT < CKPT_MAX)
|
|
{
|
|
GoNavigate(g_CurrentCKPT);
|
|
}
|
|
}
|
|
}
|
|
|
|
function StatusNavigate()
|
|
{
|
|
window.external.set_StatusIndex(IndexFromCKPT(g_CurrentCKPT, g_status));
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Required API for USB mouse and/or keyboard checks
|
|
////////////////////////////////////////////////////////////////////
|
|
function OnDeviceArrival(nDeviceType)
|
|
{
|
|
if (CKPT_HWCHK == g_CurrentCKPT)
|
|
{
|
|
GoNavigate(CKPT_HWCHK);
|
|
}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// GoNavigate
|
|
//
|
|
// This function is responsible for setting state prior to navigating to the
|
|
// first page of a checkpoint. This includes:
|
|
// * determining whether the page should be displayed
|
|
// * pushing the checkpoint id on the checkpoint stack
|
|
// * calling Navigate to navigate to the page
|
|
//
|
|
// Default behavior is to push the checkpoint id and navigate to the first page
|
|
// of the checkpoint. If this is the only processing required, use the
|
|
// default case instead of adding a case for the checkpoint.
|
|
//
|
|
// Calling GoNavigate recursively can cause navigation problems. If a page
|
|
// will not be displayed for a checkpoint, the code should fall through to the
|
|
// next case statement instead of calling GoNavigate.
|
|
//
|
|
// DON'T MUCK WITH THE ORDER OF THE CASES IN THE SWITCHES BELOW WITHOUT
|
|
// CONSIDERING FALL-THROUGH
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function GoNavigate(ckptGoHere)
|
|
{
|
|
try
|
|
{
|
|
if (g_bStartup == false)
|
|
{
|
|
if (IsLocalFile())
|
|
{
|
|
if (g.event != null)
|
|
{
|
|
g.event.returnValue = false;
|
|
g.event.cancelBubble = true;
|
|
}
|
|
}
|
|
}
|
|
else
|
|
g_bStartup = false;
|
|
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
switch (ckptGoHere)
|
|
{
|
|
case CKPT_ANIMATION:
|
|
trace("GoNavigate: CKPT_ANIMATION");
|
|
try
|
|
{
|
|
|
|
// Don't run animation if we're directed not to, or if stuff is missing.
|
|
if (!DirObj.get_DoSkipAnimation() && FileSystemObj.FileExists(g_OOBEDirPath+"images\\intro.wmv"))
|
|
{
|
|
PushCKPT(CKPT_ANIMATION);
|
|
IntroAnimation.settings.enableErrorDialogs = false;
|
|
MovieFrame.style.display = "inline";
|
|
IntroAnimation.style.visibility = "visible";
|
|
|
|
// Start video timer to execute VideoGoNext x seconds(estimated) after the video starts playing.
|
|
// In cases the video played successfully or tried to bail out earlier, the timer will be cleared automatically.
|
|
//
|
|
// Last minute info - We decided to set the timer to 20 seconds instead of 10, because on some slower machines
|
|
// the timer kicks in early, thus cutting the video play short. Just be careful when you
|
|
// plan to change the number of seconds.
|
|
g_VideoEvent = window.setTimeout(VideoGoNext, 20000);
|
|
IntroAnimation.Controls.Play(); // This causes the movie to start
|
|
break;
|
|
}
|
|
}
|
|
catch(err)
|
|
{
|
|
var temp = "EXCEPTION THROWN: WMP control failed to play or disable dialogs.";
|
|
temp += "\rerror name: " + err.name;
|
|
temp += "\rmessage: " + err.message;
|
|
temp += "\rnumber: " + err.number;
|
|
temp += "\rdescription: " + err.description;
|
|
trace(temp);
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_HWCHK:
|
|
trace("GoNavigate: CKPT_HWCHK");
|
|
|
|
// In some retail cases, we want to skip everything
|
|
if (window.external.get_RetailOOBE() && DirObj.get_IntroOnly())
|
|
{
|
|
trace("Skipping the rest of OOBE because IntroOnly is set");
|
|
PushCKPT(CKPT_DONE);
|
|
GoNext();
|
|
break;
|
|
}
|
|
|
|
PushCKPT(CKPT_HWCHK);
|
|
|
|
// Ensure that the page is now visible.
|
|
OOBEDocBody.style.cursor = "default";
|
|
ScreenFrame.style.display = "inline";
|
|
|
|
var bKeyboardPresent = window.external.CheckKeyboard();
|
|
var bMousePresent = window.external.CheckMouse();
|
|
if ((0 == bKeyboardPresent) || (0 == bMousePresent))
|
|
{
|
|
if ((0 == bKeyboardPresent) && (0 == bMousePresent))
|
|
{
|
|
Navigate("setup\\nousbkm.htm");
|
|
}
|
|
else if (0 == bKeyboardPresent)
|
|
{
|
|
Navigate("setup\\nousbkbd.htm");
|
|
}
|
|
else // (0 == bMousePresent)
|
|
{
|
|
Navigate("setup\\nousbms.htm");
|
|
}
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_WELCOME:
|
|
trace("GoNavigate: CKPT_WELCOME");
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
PushCKPT(CKPT_WELCOME); //BUGBUG do we want to do this?
|
|
Navigate(URLFromCKPT(CKPT_WELCOME));
|
|
break;
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_MOUSETUT1:
|
|
trace("GoNavigate: CKPT_MOUSETUT1");
|
|
var MT_INIstr=DirObj.get_DoMouseTutorial();
|
|
if ((MT_INIstr.length>0) && (MT_INIstr=="2"))
|
|
{
|
|
PushCKPT(CKPT_MOUSETUT1);
|
|
Navigate(URLFromCKPT(CKPT_MOUSETUT1));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_IMETUTORIAL:
|
|
trace("GoNavigate: CKPT_IMETUTORIAL");
|
|
if ((1 == DirObj.get_DoIMETutorial()) && g_IMEExists)
|
|
{
|
|
PushCKPT(CKPT_IMETUTORIAL);
|
|
Navigate(URLFromCKPT(CKPT_IMETUTORIAL));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_OEMHW:
|
|
trace("GoNavigate: CKPT_OEMHW");
|
|
if (1 == DirObj.get_DoOEMHardwareCheck())
|
|
{
|
|
PushCKPT(CKPT_OEMHW);
|
|
Navigate(URLFromCKPT(CKPT_OEMHW));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_REGION_KEYBD:
|
|
trace("GoNavigate: CKPT_REGION_KEYBD");
|
|
if (1 == DirObj.get_DoRegionalKeyboard() && !StatusObj.get_Status(LANGUAGECOMPLETED))
|
|
{
|
|
PushCKPT(CKPT_REGION_KEYBD);
|
|
Navigate(URLFromCKPT(CKPT_REGION_KEYBD));
|
|
break;
|
|
}
|
|
|
|
// If we're not showing the page, we still want to give OEM's a chance
|
|
// to set the language options silently.
|
|
if ( 0 == DirObj.get_DoRegionalKeyboard() &&
|
|
! window.external.get_RetailOOBE()
|
|
) {
|
|
|
|
LangObj.SaveSettings();
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_TIMEZONE:
|
|
trace("GoNavigate: CKPT_TIMEZONE");
|
|
var TimeZonewasSet=SysClockObj.get_TimeZonewasPreset();
|
|
|
|
// only show timezone page if preset TimeZoneValue does not exist and TimeZone=1,
|
|
// or if TimeZoneValue is invalid
|
|
|
|
if ((!TimeZonewasSet &&
|
|
((1 == DirObj.get_DoTimeZone()) || (DirObj.get_TimeZoneValue() != ""))))
|
|
{
|
|
PushCKPT(CKPT_TIMEZONE);
|
|
Navigate(URLFromCKPT(CKPT_TIMEZONE));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_EULA:
|
|
trace("GoNavigate: CKPT_EULA");
|
|
if (null == EulaObj)
|
|
{
|
|
EulaObj = new Object;
|
|
EulaObj = window.external.Eula;
|
|
}
|
|
|
|
// skip EULA if user has already accepted in OOBE mode, or if we are running
|
|
// the retail SKU
|
|
if (!EulaObj.get_EULAAcceptance && 0 == window.external.get_RetailOOBE() )
|
|
{
|
|
PushCKPT(CKPT_EULA);
|
|
Navigate(URLFromCKPT(CKPT_EULA));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_PRODUCTKEY:
|
|
trace("GoNavigate: CKPT_PRODUCTKEY");
|
|
if (null == PidObj)
|
|
{
|
|
PidObj = new Object;
|
|
PidObj = window.external.ProductID;
|
|
}
|
|
|
|
// skips over PID if it's already validated, or if we are running
|
|
// the retail or select SKU
|
|
if (
|
|
0 == window.external.get_RetailOOBE() &&
|
|
0 == window.external.IsSelectVariation() &&
|
|
(0 == PidObj.get_PID.length || !PidObj.ValidatePID)
|
|
)
|
|
{
|
|
PushCKPT(CKPT_PRODUCTKEY); //this sets g_CurrentCKPT=CPKT_PRODUCTKEY
|
|
Navigate(URLFromCKPT(CKPT_PRODUCTKEY));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_COMPNAME:
|
|
trace("GoNavigate: CKPT_COMPNAME");
|
|
|
|
// Don't show this page in Retail mode or if it has already been
|
|
// displayed.
|
|
//
|
|
if (window.external.get_RetailOOBE())
|
|
{
|
|
CompName_ChangeComplete(false);
|
|
// this will fall through...don't break here.
|
|
}
|
|
else if (!g_CompNameChangeComplete)
|
|
{
|
|
PushCKPT(CKPT_COMPNAME);
|
|
Navigate(URLFromCKPT(CKPT_COMPNAME));
|
|
break;
|
|
}
|
|
|
|
// fall through
|
|
|
|
case CKPT_SECPASS:
|
|
trace("GoNavigate: CKPT_SECPASS");
|
|
|
|
// Only show admin password page if we're an OEM-preinstalled PRO SKU and we
|
|
// haven't been here before.
|
|
if ( null == g_AdminPassword &&
|
|
window.external.IsProfessionalSKU() &&
|
|
0 == window.external.get_RetailOOBE() &&
|
|
1 == DirObj.get_DoAdminPassword()
|
|
) {
|
|
PushCKPT(CKPT_SECPASS);
|
|
Navigate(URLFromCKPT(CKPT_SECPASS));
|
|
break;
|
|
}
|
|
|
|
// fall through
|
|
|
|
case CKPT_JNDOMAIN:
|
|
trace("GoNavigate: CKPT_JNDOMAIN");
|
|
|
|
if (!window.external.GetNoWelcomeFinish() &&
|
|
(1 == DirObj.get_DoJoinDomain()) )
|
|
{
|
|
// Only show domain page if we're an OEM-preinstalled PRO SKU and we
|
|
// haven't been here before.
|
|
if ( !g_DomainDone && window.external.IsProfessionalSKU() &&
|
|
0 == window.external.get_RetailOOBE() && HasNetwork()
|
|
) {
|
|
PushCKPT(CKPT_JNDOMAIN);
|
|
Navigate(URLFromCKPT(CKPT_JNDOMAIN));
|
|
break;
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_SCONNECT:
|
|
trace("GoNavigate: CKPT_SCONNECT");
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
// We use the DisplayIcsCongratsPage so that we wont come back
|
|
// to the congratulations page after passing it.
|
|
// DisplayIcsCongratsPage is initially set to true.
|
|
|
|
if ( DisplayIcsCongratsPage
|
|
&& UseIcs()
|
|
&& !g_bIsSetupUpgrade
|
|
)
|
|
{
|
|
// We used to navigate to a congratulations page, we took it out until further notice.
|
|
// If we reach here, we are connected via ICS...
|
|
|
|
// DisplayIcsCongratsPage = false;
|
|
// Navigate("html\\sconnect\\scntlast.htm");
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_HOMENETWIZPROMPT:
|
|
trace("GoNavigate: CKPT_HOMENETWIZPROMPT");
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
if (!g_bIsSetupUpgrade)
|
|
{
|
|
if ((CanConfigLan() == CONFIG_LAN_NO) && HasIndeterminateLan())
|
|
{
|
|
PushCKPT(CKPT_HOMENETWIZPROMPT);
|
|
Navigate(URLFromCKPT(CKPT_HOMENETWIZPROMPT));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_ICSCHOICE:
|
|
trace("GoNavigate: CKPT_ICSCHOICE");
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
if (!g_bIsSetupUpgrade)
|
|
{
|
|
if (CanConfigLan() != CONFIG_LAN_NO)
|
|
{
|
|
// Don't run ICS page if OFFLINE=1 in oobeinfo.ini under [StartUpOptions]
|
|
if (g_status != STATUS_OFF)
|
|
{
|
|
// Go to "Do you wanna connect using a network?" page. Formerly ICS
|
|
// page...
|
|
PushCKPT(CKPT_ICSCHOICE);
|
|
Navigate(URLFromCKPT(CKPT_ICSCHOICE));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_ACTIVATION:
|
|
trace("GoNavigate: CKPT_ACTIVATION");
|
|
// If we are in NoWelcomeFinish, skip activation here.
|
|
// if g_ActivationRequired = true, run Activation. Else fall through to Registration.
|
|
if ( !window.external.GetNoWelcomeFinish() &&
|
|
((UseNetwork() || UseModem())
|
|
&& (g_ActivationRequired)
|
|
&& (g_status != STATUS_OFF) )
|
|
)
|
|
{
|
|
PushCKPT(CKPT_ACTIVATION);
|
|
Navigate(URLFromCKPT(CKPT_ACTIVATION));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_REGISTER1:
|
|
trace("GoNavigate: CKPT_REGISTER1");
|
|
// If we are in NoWelcomeFinish, skip Registration.
|
|
if ( !window.external.GetNoWelcomeFinish() &&
|
|
( (UseNetwork() || UseModem())
|
|
&& !window.external.get_RegStatus()
|
|
&& 1 != StatusObj.get_Status(MS_REGISTRATION)
|
|
&& 1 != StatusObj.get_Status(OEM_REGISTRATION)
|
|
&& (g_status != STATUS_OFF) )
|
|
)
|
|
{
|
|
PushCKPT(CKPT_REGISTER1);
|
|
Navigate(URLFromCKPT(CKPT_REGISTER1));
|
|
break;
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_ICONN:
|
|
trace("GoNavigate: CKPT_ICONN");
|
|
if ( !window.external.GetNoWelcomeFinish() &&
|
|
!g_bIsSetupUpgrade)
|
|
{
|
|
if ( (STATUS_ISP == g_status) && UseAnalogModem())
|
|
{
|
|
PushCKPT(CKPT_ICONN);
|
|
Navigate(URLFromCKPT(CKPT_ICONN));
|
|
break;
|
|
}
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_ISPSIGNUP:
|
|
trace("GoNavigate: CKPT_ISPSIGNUP");
|
|
|
|
if ( !window.external.GetNoWelcomeFinish() &&
|
|
(STATUS_ISP == g_status))
|
|
{
|
|
if ( (!g_bIsSetupUpgrade && UseAnalogModem()) ||
|
|
(g_bIsSetupUpgrade &&
|
|
((!ConnectedToInternetEx(false) && HasAnalogModem()) ||
|
|
UseAnalogModem())
|
|
)
|
|
)
|
|
{
|
|
PushCKPT(CKPT_ISPSIGNUP);
|
|
Navigate(URLFromCKPT(CKPT_ISPSIGNUP));
|
|
break;
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
// BEGIN OEM CASES. DO NOT ADD CASES between here and CKPT_DONE. Doing so
|
|
// will break navigation.
|
|
//
|
|
case CKPT_OEMISP: // PreConfig case
|
|
trace("GoNavigate: CKPT_OEMISP");
|
|
|
|
if (!g_bIsSetupUpgrade)
|
|
{
|
|
if ( (STATUS_PRECONFIG == g_status) && !window.external.GetNoIspPreconfig())
|
|
{
|
|
ResetDialing();
|
|
PushCKPT(CKPT_OEMISP);
|
|
Navigate(URLFromCKPT(CKPT_OEMISP));
|
|
break;
|
|
}
|
|
}
|
|
|
|
// fall through...
|
|
|
|
case CKPT_OEMCUST:
|
|
|
|
trace("GoNavigate: CKPT_OEMCUST");
|
|
// Next line of code added by TandyT to support special ISP signup process commands
|
|
// Calls to function in agtcore.js
|
|
|
|
Agent_TurnOffISPSpecialCommands();
|
|
|
|
ResetDialing();
|
|
if (1 == DirObj.get_OEMCust)
|
|
{
|
|
PushCKPT(CKPT_OEMCUST);
|
|
Navigate(URLFromCKPT(CKPT_OEMCUST));
|
|
break;
|
|
}
|
|
// fall through...
|
|
|
|
//
|
|
// END OEM CASES
|
|
|
|
case CKPT_IDENTITIES2:
|
|
trace("GoNavigate: CKPT_IDENTITIES2");
|
|
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
IspAccountObj.Check();
|
|
|
|
if (NeedToCreateAccount())
|
|
{
|
|
PushCKPT(CKPT_IDENTITIES2);
|
|
Navigate(URLFromCKPT(CKPT_IDENTITIES2));
|
|
break;
|
|
}
|
|
else
|
|
{
|
|
InfoObj.set_UseIdentities(false);
|
|
}
|
|
}
|
|
// fall through...
|
|
|
|
case CKPT_DONE:
|
|
trace("GoNavigate: CKPT_DONE");
|
|
ResetDialing();
|
|
if (!window.external.GetNoWelcomeFinish())
|
|
{
|
|
PushCKPT(CKPT_DONE);
|
|
Navigate(URLFromCKPT(CKPT_DONE));
|
|
}
|
|
else
|
|
{
|
|
PushCKPT(CKPT_DONE);
|
|
GoNext();
|
|
}
|
|
break;
|
|
|
|
default:
|
|
trace("GoNavigate: default (" + ckptGoHere + ")");
|
|
PushCKPT(ckptGoHere); // sets g_CurrentCKPT = ckptGoHere;
|
|
Navigate(URLFromCKPT(ckptGoHere));
|
|
break;
|
|
}
|
|
|
|
StatusNavigate();
|
|
|
|
// AGENT: notify Agent, code in AgtCore.js
|
|
|
|
Agent_OnNavigate();
|
|
}
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// GoNext
|
|
//
|
|
// This function is responsible for
|
|
// * Saving state for a page when the Next button is clicked.
|
|
// * Calling GoNavigate with the checkpoint id of the next checkpoint
|
|
//
|
|
// This function is NOT responsible for
|
|
// * Setting state for the next page. That should be done in GoNavigate.
|
|
//
|
|
// Default behavior is to call GoNavigate with an invalid checkpoint id.
|
|
// Therefore each checkpoint MUST have a case in the switch statement.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function GoNext()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
DisableAllButtons();
|
|
|
|
switch (g_CurrentCKPT)
|
|
{
|
|
case CKPT_ANIMATION:
|
|
try
|
|
{
|
|
IntroAnimation.Controls.Stop();
|
|
IntroAnimation.style.visibility = "hidden";
|
|
}
|
|
catch(err)
|
|
{
|
|
var temp = "EXCEPTION THROWN: WMP control failed to stop.";
|
|
temp += "\rerror name: " + err.name;
|
|
temp += "\rmessage: " + err.message;
|
|
temp += "\rnumber: " + err.number;
|
|
temp += "\rdescription: " + err.description;
|
|
trace(temp);
|
|
}
|
|
MovieFrame.style.display = "none";
|
|
GoNavigate(CKPT_HWCHK);
|
|
break;
|
|
|
|
case CKPT_HWCHK:
|
|
GoNavigate(CKPT_HWCHK);
|
|
break;
|
|
|
|
case CKPT_WELCOME:
|
|
g_DidWePassWelcomePage = true;
|
|
g.document.body.style.cursor = "wait";
|
|
window.setTimeout("GoNavigate(CKPT_MOUSETUT1);",50);
|
|
break;
|
|
|
|
case CKPT_MOUSETUT1:
|
|
GoNavigate(CKPT_IMETUTORIAL);
|
|
break;
|
|
|
|
case CKPT_IMETUTORIAL:
|
|
GoNavigate(CKPT_OEMHW);
|
|
break;
|
|
|
|
case CKPT_OEMHW:
|
|
GoNavigate(CKPT_REGION_KEYBD);
|
|
break;
|
|
|
|
case CKPT_REGION_KEYBD:
|
|
// setting these to null fixes hanging bug where user clicks on selmenus
|
|
// during execution of SaveSettings
|
|
g.selKeyboard.disabled = true;
|
|
g.selKeyboard.onchange = null;
|
|
g.selRegion.disabled = true;
|
|
g.selRegion.onchange = null;
|
|
g.selLang.disabled = true;
|
|
g.selLang.onchange = null;
|
|
|
|
g.document.body.style.cursor = "wait";
|
|
|
|
LangObj.set_RegionIndex(g.selRegion.selectedIndex)
|
|
LangObj.set_LangIndex(g.selLang.selectedIndex);
|
|
LangObj.set_KeyboardLayoutIndex(g.selKeyboard.selectedIndex);
|
|
|
|
// must always call SaveSettings() since apparently there is
|
|
// no way to know current language setting of machine
|
|
LangObj.SaveSettings();
|
|
|
|
if (LANGUAGE_REBOOT_NOW == LangObj.get_RebootState())
|
|
GoNavigate(CKPT_REGKB_COMMIT);
|
|
else
|
|
GoNavigate(CKPT_TIMEZONE);
|
|
|
|
g.document.body.style.cursor = "default";
|
|
|
|
break;
|
|
|
|
case CKPT_REGKB_COMMIT:
|
|
// "Next" for this page indicates a restart
|
|
|
|
PopCKPT(CKPT_REGKB_COMMIT); // Don't want this in our history anymore after reboot
|
|
PopCKPT(CKPT_REGION_KEYBD);
|
|
PushCKPT(CKPT_TIMEZONE); // so when we come back after reboot we are on
|
|
// the timezone page
|
|
StatusObj.set_Status(LANGUAGECOMPLETED, true);
|
|
window.external.PowerDown(POWERDOWN_REBOOT);
|
|
break;
|
|
|
|
case CKPT_TIMEZONE:
|
|
g_daylight = g.daylight.checked;
|
|
g_CurTimeZoneIdx = g.selTimeZone.selectedIndex;
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneSaved", 1);
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneIdx", g_CurTimeZoneIdx);
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "DayLight", g_daylight);
|
|
GoNavigate(CKPT_EULA);
|
|
break;
|
|
|
|
case CKPT_EULA:
|
|
if (EulaObj.get_EULAAcceptance)
|
|
{
|
|
PopCKPT();
|
|
GoNavigate(CKPT_PRODUCTKEY);
|
|
}
|
|
else
|
|
GoNavigate(CKPT_EULA_DECLINE);
|
|
break;
|
|
|
|
case CKPT_EULA_DECLINE:
|
|
PopCKPT();
|
|
PushCKPT(CKPT_EULA); // go back to main eula page, not this one
|
|
window.external.PowerDown(POWERDOWN_SHUTDOWN);
|
|
break;
|
|
|
|
case CKPT_PRODUCTKEY:
|
|
StorePid();
|
|
|
|
if (PidObj.get_PID.length != 0 && PidObj.ValidatePID())
|
|
{
|
|
window.external.ResetLicenseAgent();
|
|
PopCKPT(CKPT_PRODUCTKEY);
|
|
GoNavigate(CKPT_COMPNAME);
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_BADPRODUCTKEY);
|
|
}
|
|
break;
|
|
|
|
case CKPT_BADPRODUCTKEY:
|
|
PopCKPT(); // go back to prodkey page on restart, not this one
|
|
PushCKPT(CKPT_PRODUCTKEY); // does this leave 2 pid pgs on stack?
|
|
window.external.PowerDown(POWERDOWN_SHUTDOWN);
|
|
break;
|
|
|
|
case CKPT_COMPNAME:
|
|
g.document.body.style.cursor = "wait";
|
|
if (COMPNAME_INVALIDNAME == CompName_OnNext())
|
|
{
|
|
g.document.body.style.cursor = "default";
|
|
}
|
|
break;
|
|
|
|
case CKPT_SECPASS:
|
|
g_AdminPassword = g.SecurityPass.value;
|
|
window.external.SetAdminPassword(
|
|
"",
|
|
g_AdminPassword
|
|
);
|
|
PopCKPT();
|
|
GoNavigate(CKPT_JNDOMAIN);
|
|
break;
|
|
|
|
case CKPT_JNDOMAIN:
|
|
|
|
window.external.JoinDomain(
|
|
g_DomainName,
|
|
g_DomainUser,
|
|
g_DomainPass,
|
|
g_Domain ? 1 : 0
|
|
);
|
|
|
|
g_DomainDone = true;
|
|
|
|
PopCKPT();
|
|
GoNavigate(CKPT_SCONNECT);
|
|
break;
|
|
|
|
case CKPT_ICSCHOICE:
|
|
if (CanConfigLan() == CONFIG_LAN_YES)
|
|
{
|
|
if (GetPublicLanCount() != 0)
|
|
{
|
|
if (g.radio_ChooseDSLCable.checked)
|
|
{
|
|
// Connect through a local area network or home network
|
|
// No firewall is necessary
|
|
window.external.FirewallPreferredConnection(false);
|
|
}
|
|
else if (g.radio_ChooseLAN.checked)
|
|
{
|
|
// Connect directly to the Internet
|
|
window.external.FirewallPreferredConnection(true);
|
|
}
|
|
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
}
|
|
else
|
|
{
|
|
// g_fFirewallRequired is used to identify if user has gone through
|
|
// CKPT_DSLMAIN or CKPT_DSLBROADBAND
|
|
if (g.radio_ChooseDSLCable.checked)
|
|
{
|
|
g_fFirewallRequired = true;
|
|
GoNavigate(CKPT_DSLMAIN);
|
|
}
|
|
else if (g.radio_ChooseLAN.checked)
|
|
{
|
|
// go to Setting up high speed connection (dsl_b.htm).
|
|
g_fFirewallRequired = false;
|
|
GoNavigate(CKPT_DSLBROADBAND);
|
|
}
|
|
else if (g.radio_ChooseModem.checked)
|
|
{
|
|
g_fFirewallRequired = false;
|
|
SetPreferredConnection(CONNECTIONTYPE_MODEM);
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
PopCKPT(CKPT_ICSCHOICE);
|
|
GoNavigate(CKPT_HOMENETWIZPROMPT);
|
|
}
|
|
break;
|
|
|
|
case CKPT_DSLMAIN:
|
|
if (g.dsltypeform.radioDSLYes.checked)
|
|
{
|
|
GoNavigate(CKPT_DSLPPPOE);
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_DSLBROADBAND);
|
|
}
|
|
break;
|
|
|
|
case CKPT_DSLPPPOE:
|
|
if (dsl_pppoe_OnNext())
|
|
{
|
|
PopCKPT();
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
// GoNavigate(CKPT_CONGRATS);
|
|
}
|
|
else
|
|
{
|
|
// validation failed: reload the page. Fields in error will be
|
|
// flagged in red.
|
|
dsl_pppoe_LoadMe();
|
|
}
|
|
break;
|
|
|
|
case CKPT_DSLBROADBAND:
|
|
if (dsl_broadband_OnNext())
|
|
{
|
|
PopCKPT();
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
// GoNavigate(CKPT_CONGRATS);
|
|
}
|
|
else
|
|
{
|
|
// validation failed: reload the page. Fields in error will be
|
|
// flagged in red.
|
|
dsl_broadband_LoadMe();
|
|
}
|
|
break;
|
|
|
|
case CKPT_SCONNECT:
|
|
// Don't need to pop this checkpoint since it's not on the stack.
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
|
|
case CKPT_CONGRATS:
|
|
PopCKPT(CKPT_CONGRATS);
|
|
PopCKPT(CKPT_DSLMAIN);
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
|
|
case CKPT_HOMENETWIZPROMPT:
|
|
// We can't configure the firewall settings; It doesn't
|
|
// mean we don't have internet connectivity.
|
|
GoNavigate(CKPT_ACTIVATION);
|
|
break;
|
|
|
|
case CKPT_ACTIVATION:
|
|
// Check and set the status of g_fRegWithMS before we go to the next checkpoint.
|
|
// If users don't want to Activate Windows, and PostToOEM=1, goto Reg1.htm.
|
|
// Otherwise, if PostToOEM is not equal to 1, skip Reg1.htm and
|
|
// proceed to the next checkpoint, in this case, CKPT_ICONN.
|
|
//
|
|
if (g.rb_act_1.checked)
|
|
{
|
|
g_DoActivation = true;
|
|
g_fRegWithMS=true;
|
|
GoNavigate(CKPT_REGISTER1);
|
|
}
|
|
else
|
|
{
|
|
g_DoActivation = false;
|
|
g_fRegWithMS=false;
|
|
if (1 == RegisterObj.get_PostToOEM)
|
|
GoNavigate(CKPT_REGISTER1);
|
|
else
|
|
GoNavigate(CKPT_ICONN);
|
|
}
|
|
break;
|
|
|
|
case CKPT_REGISTER1:
|
|
if (g_fRegWithMS)
|
|
{
|
|
if (g.rb_reg_ms_yes.checked)
|
|
g_PostToMS=true;
|
|
else
|
|
g_PostToMS=false;
|
|
}
|
|
else
|
|
{
|
|
g_PostToMS=false;
|
|
}
|
|
|
|
if (1 == RegisterObj.get_PostToOEM)
|
|
{
|
|
if (g.rb_reg_oem_yes.checked)
|
|
g_PostToOEM=true;
|
|
else
|
|
g_PostToOEM=false;
|
|
}
|
|
else
|
|
{
|
|
g_PostToOEM=false;
|
|
}
|
|
Reg1SaveRadioState();
|
|
|
|
if (g_PostToMS || g_PostToOEM)
|
|
{
|
|
GoNavigate(CKPT_REGISTER3);
|
|
}
|
|
else if ( !g_DoActivation )
|
|
{
|
|
GoNavigate(CKPT_ICONN);
|
|
}
|
|
else if (UseNetwork())
|
|
{
|
|
LanActReg();
|
|
}
|
|
else if (UseModem())
|
|
{
|
|
GoNavigate(CKPT_REGDIAL);
|
|
}
|
|
else
|
|
{
|
|
// Theoretically we should never get here. If we do, let's just go
|
|
// on to the next thing.
|
|
//
|
|
trace("GoNext: CKPT_REGISTER1 - ERROR: Unable to connect to internet.");
|
|
GoNavigate(CKPT_ICONN);
|
|
}
|
|
break;
|
|
|
|
case CKPT_REGISTER3:
|
|
trace("GoNext: CKPT_REGISTER3");
|
|
var L_Reg3Title_Text = "Submitting Registration Information ...";
|
|
if(VerifyReg3Fields())
|
|
{
|
|
Reg3SaveSettings();
|
|
|
|
Save_Registered_owner(g.UserFirstName.value, g.UserLastName.value);
|
|
|
|
if (UseNetwork())
|
|
{
|
|
LanActReg();
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_REGDIAL);
|
|
}
|
|
g.document.body.style.cursor = "wait";
|
|
g.sharems.disabled = true;
|
|
g.firstname.disabled = true;
|
|
g.lastname.disabled = true;
|
|
g.Address.disabled = true;
|
|
g.Address2.disabled = true;
|
|
g.City.disabled = true;
|
|
g.State.disabled = true;
|
|
g.Zipcode.disabled = true;
|
|
g.Email.disabled = true;
|
|
g.selCountry.disabled = true;
|
|
g.selCAProvince.disabled = true;
|
|
g.selUSState.disabled = true;
|
|
g.Reg3Title.innerHTML = L_Reg3Title_Text;
|
|
}
|
|
break;
|
|
|
|
case CKPT_ACT_MSG:
|
|
PopCKPT();
|
|
GoNavigate(CKPT_ICONN);
|
|
break;
|
|
|
|
case CKPT_ICONN:
|
|
if (g.radioYesIconn.checked)
|
|
{
|
|
GoNavigate(CKPT_ISPSIGNUP);
|
|
}
|
|
else if (g.radioNoIconn.checked)
|
|
{
|
|
GoNavigate(CKPT_OEMCUST);
|
|
}
|
|
break;
|
|
|
|
case CKPT_ISPSIGNUP:
|
|
trace("GoNext: CKPT_ISPSIGNUP");
|
|
|
|
|
|
if (g.radioGetNewISP.checked)
|
|
{
|
|
if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("msobe.isp"))
|
|
{
|
|
PushCKPT(CKPT_ISPDIAL);
|
|
g_IgnoreDialErr = false;
|
|
window.external.Connect(CONNECTED_ISP_SIGNUP, "msobe.isp");
|
|
}
|
|
else
|
|
{
|
|
window.external.Hangup();
|
|
GoNavigate(CKPT_ISPDIAL); // Getting Online
|
|
}
|
|
}
|
|
else if ((g.radioMigrateISP != null) && g.radioMigrateISP.checked)
|
|
{
|
|
// We want the default behavior to be showing the migration path if ISPMigrate = 0 or
|
|
// is not specified
|
|
if (!DirObj.get_ShowISPMigration())
|
|
{
|
|
if (window.external.CheckOnlineStatus && window.external.CheckStayConnected("migrate.isp"))
|
|
{
|
|
g_bTapiDone = false;
|
|
GoNavigate(CKPT_REFDIAL);
|
|
}
|
|
else
|
|
{
|
|
window.external.Hangup();
|
|
GoNavigate(CKPT_REFDIAL);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GoNavigate(CKPT_ICONNECT);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
GoCancel(); // skip checked
|
|
}
|
|
|
|
break;
|
|
|
|
case CKPT_REFDIAL:
|
|
GoNavigate(CKPT_ICONNECT);
|
|
break;
|
|
|
|
case CKPT_ICONNECT:
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_ISPDIAL:
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_REGDIAL:
|
|
GoNavigate(CKPT_ICONN);
|
|
break;
|
|
|
|
case CKPT_OEMISP:
|
|
GoNavigate(CKPT_OEMCUST);
|
|
break;
|
|
|
|
case CKPT_OEMCUST:
|
|
GoNavigate(CKPT_IDENTITIES2);
|
|
break;
|
|
|
|
case CKPT_IDENTITIES2:
|
|
Identities2_OnLeave();
|
|
if (g_Identities2_OK)
|
|
{
|
|
// ASSUME: user can't go back at finish page,
|
|
// otherwise it would disallow owner name from reflecting
|
|
// the identities.
|
|
if (!g_RegisteredOwnerDone)
|
|
{
|
|
Save_Registered_owner(g.txtUser.item(g_NameToSaveIndex).value);
|
|
}
|
|
InfoObj.set_UseIdentities(true);
|
|
GoNavigate(CKPT_DONE);
|
|
}
|
|
else
|
|
{
|
|
Identities2_LoadMe();
|
|
}
|
|
break;
|
|
|
|
case CKPT_DONE:
|
|
g.document.body.style.cursor = "wait";
|
|
|
|
var finish = window.external.Finish();
|
|
g.document.body.style.cursor = "default";
|
|
|
|
if (finish == FINISH_OK || finish == FINISH_REBOOT)
|
|
{
|
|
if (IspAccountObj.HasSignUp() && InfoObj.get_UseIdentities())
|
|
{
|
|
// If no user accounts were created, then the ProfileName
|
|
// should be set to the default profile name. Otherwise,
|
|
// if just the first one is left blank for some reason,
|
|
// the ProfileName should not be written
|
|
|
|
var Identity0 = InfoObj.get_Identity(0);
|
|
var ProfileName = InfoObj.get_DefaultNewUser();
|
|
if ((Identity0 != null) && (Identity0 != "") &&
|
|
(ProfileName != null) && (ProfileName != ""))
|
|
{
|
|
IspAccountObj.SetProfileName(ProfileName);
|
|
}
|
|
}
|
|
|
|
SysClockObj.set_AutoDaylight(g_daylight);
|
|
if (SysClockObj.set_TimeZoneIdx(g_CurTimeZoneIdx))
|
|
{// User selected a different timezone, because of a timezone&font issue we need to reboot.
|
|
finish = FINISH_REBOOT;
|
|
}
|
|
|
|
}
|
|
|
|
if (finish == FINISH_REBOOT) // Finish was successful, but we need to reboot
|
|
{
|
|
window.external.PowerDown(POWERDOWN_REBOOT);
|
|
}
|
|
else if (finish != FINISH_OK)
|
|
{
|
|
// allow ourselves to go back to those pages if they gave us bad
|
|
// information
|
|
|
|
EmptyCKPTStack();
|
|
|
|
if (finish & FINISH_BAD_PID)
|
|
{
|
|
GoNavigate(CKPT_PRODUCTKEY);
|
|
}
|
|
else if (finish & FINISH_BAD_EULA)
|
|
{
|
|
GoNavigate(CKPT_EULA);
|
|
}
|
|
else
|
|
{
|
|
// setupX "stamp" of user.exe failed, we should nav to the
|
|
// earliest page in the flow...
|
|
GoNavigate(CKPT_WELCOME);
|
|
}
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
// BUGBUG should we remove the default altogether?
|
|
GoNavigate(Need_to_handle_this_CKPT_in_GoNext);
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
// BUGBUG temporary until MSN changes code
|
|
function GoOffline()
|
|
{
|
|
GoNext();
|
|
}
|
|
|
|
|
|
function GetCurrentPageName() {
|
|
|
|
var re = new RegExp("\\\\([^\\\\]+)$");
|
|
re.exec(g.window.location.pathname);
|
|
|
|
return RegExp.$1;
|
|
}
|
|
|
|
// these handle next/back navigation for non-checkpoint pages
|
|
function SimpleNavBack()
|
|
{
|
|
g.window.history.back();
|
|
}
|
|
|
|
/*
|
|
This version of SimpleNavNext contains the workaround for IE 90257. not enabled yet
|
|
another part of 90527 fix is in InitButtons()
|
|
*/
|
|
|
|
function SimpleNavNext() // original version that does not fix IE 90257
|
|
{
|
|
var CurPage = GetCurrentPageName();
|
|
var NextPage = g_SimpleNavMap.Item(CurPage);
|
|
Navigate(NextPage);
|
|
}
|
|
|
|
// Description: Disable all the buttons
|
|
// Used to prevent script error caused by
|
|
// double clicking or rapid clicking
|
|
// of two different buttons. E.g. when someone click
|
|
// next and back quickly.
|
|
//
|
|
function DisableAllButtons()
|
|
{
|
|
try
|
|
{
|
|
if(g.btnNext!=null)
|
|
{
|
|
g.btnNext.onclick=null;
|
|
}
|
|
} catch (e) {}
|
|
|
|
try
|
|
{
|
|
if(g.btnBack!=null)
|
|
{
|
|
g.btnBack.onclick=null;
|
|
}
|
|
} catch (e) {}
|
|
|
|
try
|
|
{
|
|
if(g.btnSkip!=null)
|
|
{
|
|
g.btnSkip.onclick=null;
|
|
}
|
|
} catch (e) {}
|
|
|
|
try
|
|
{
|
|
g.btnNext.disabled=true;
|
|
g.btnNext.className="newbuttonsNext-disabled";
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnBack.disabled=true;
|
|
g.btnBack.className="newbuttonsBack-disabled";
|
|
}
|
|
catch(e) {}
|
|
try
|
|
{
|
|
g.btnSkip.disabled=true;
|
|
g.btnSkip.className="newbuttonsSkip-disabled";
|
|
}
|
|
catch(e) {}
|
|
}
|
|
|
|
|
|
// Function: InitFrameRef
|
|
// Description: Sets up globals to point to buttons
|
|
// Since the buttons exist on the child frame,
|
|
// we want to have quick access to them without
|
|
// going through the collections.
|
|
//
|
|
// WARNING: Call this function at the top of XXX_LoadMe()
|
|
//
|
|
// SIDE-EFFECT: This function also sets the watermark appropriate for the screen size.
|
|
//
|
|
function InitFrameRef(ExternalModule)
|
|
{
|
|
trace("GoNext: InitFrameRef");
|
|
try
|
|
{
|
|
document.frames("connDelay").frameElement.style.display="none";
|
|
document.frames("connDelay").frameElement.style.zIndex=-1;
|
|
// We want to see a black frame around OOBE if our res. is > 1024.
|
|
// We initially set it to blue so that we will have a smooth transition from
|
|
// our animation to OOBE.
|
|
OOBEDocBody.style.backgroundColor="#000000";
|
|
}
|
|
catch (e)
|
|
{
|
|
}
|
|
|
|
g_LastButtonText = null;
|
|
g_FirstFocusElement = null;
|
|
g_LastKeyDown = null;
|
|
|
|
g = document.frames("msoobeMain");
|
|
try
|
|
{
|
|
g.document.body.style.backgroundColor = "transparent";
|
|
}
|
|
catch(e){}
|
|
|
|
try
|
|
{
|
|
if (g != null)
|
|
{
|
|
if(g.btnNext!=null)
|
|
g.btnNext.disabled=false;
|
|
|
|
if(g.btnBack!=null)
|
|
g.btnBack.disabled=false;
|
|
|
|
if(g.btnSkip!=null)
|
|
g.btnSkip.disabled=false;
|
|
}
|
|
|
|
g.document.body.onkeydown = OnKeyDown;
|
|
g.document.body.style.cursor = 'auto';
|
|
}
|
|
catch(e){}
|
|
|
|
}
|
|
|
|
function HideButtons(buttons)
|
|
{
|
|
if (null != g.btnBack && (buttons & HIDE_BACK))
|
|
{
|
|
g.btnBack.Hide = true;
|
|
}
|
|
|
|
if (null != g.btnNext && (buttons & HIDE_NEXT))
|
|
{
|
|
g.btnNext.Hide = true;
|
|
}
|
|
|
|
|
|
if (null != g.spanCancel && (buttons & HIDE_CANCEL))
|
|
{
|
|
g.btnSkip.Hide = true;
|
|
}
|
|
/*
|
|
if (null != g.spanRestore && (buttons & HIDE_RESTORE))
|
|
{
|
|
g.btnRestore.Hide = true;
|
|
}
|
|
*/
|
|
}
|
|
|
|
|
|
function HandleButtonMouseOver()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="buttons-hover";
|
|
}
|
|
|
|
function HandleButtonMouseOut()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="buttons";
|
|
}
|
|
|
|
function InitButtons(SimpleBack, SimpleNext)
|
|
{
|
|
// Some js files like dialmgr.js are both being used by OOBE and desktop activation,
|
|
// and the call to Initbuttons could either be in msobshel.htx or actshell.htx, so it's best to leave
|
|
// the initbuttons in the js files as it is and perform a checking here if we are in full screen OOBE or not.
|
|
if (!InReminderMode())
|
|
{
|
|
InitNewButtons(SimpleBack, SimpleNext);
|
|
}
|
|
else
|
|
{
|
|
if(g.btnSkip!=null) {
|
|
g.btnSkip.onmouseover = HandleButtonMouseOver;
|
|
g.btnSkip.onmouseout = HandleButtonMouseOut;
|
|
|
|
if(!g.btnSkip.disabled) {
|
|
g.btnSkip.onclick = GoCancel;
|
|
|
|
// dont enable onfocus,onblur handlers until issues in 88615 are resolved
|
|
// g.btnSkip.onfocus = HandleButtonMouseOver;
|
|
// g.btnSkip.onblur = HandleButtonMouseOut;
|
|
|
|
g.btnSkip.className="buttons";
|
|
} else {
|
|
g.btnSkip.className="buttons-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnNext != null)
|
|
{
|
|
g.btnNext.onmouseover = HandleButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleButtonMouseOut;
|
|
|
|
if (!g.btnNext.disabled)
|
|
{
|
|
if (SimpleNext == null)
|
|
{
|
|
g.btnNext.onclick = GoNext;
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.onclick = SimpleNavNext;
|
|
}
|
|
|
|
g.btnNext.className="buttons";
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.className="buttons-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnBack != null)
|
|
{
|
|
g.btnBack.onmouseover = HandleButtonMouseOver;
|
|
g.btnBack.onmouseout = HandleButtonMouseOut;
|
|
|
|
if (!g.btnBack.disabled)
|
|
{
|
|
if (SimpleBack == null)
|
|
{
|
|
g.btnBack.onclick = GoBack;
|
|
}
|
|
else
|
|
{
|
|
g.btnBack.onclick = SimpleNavBack;
|
|
}
|
|
|
|
g.btnBack.className="buttons";
|
|
}
|
|
else
|
|
{
|
|
g.btnBack.className="buttons-disabled";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
// New OOBE buttons
|
|
// -----------------------------------------------
|
|
function HandleBackButtonMouseOver()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsBack-hover";
|
|
}
|
|
|
|
function HandleBackButtonMouseOut()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsBack";
|
|
}
|
|
|
|
function HandleBackButtonMouseDown()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsBack-down";
|
|
}
|
|
|
|
function HandleSkipButtonMouseOver()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsSkip-hover";
|
|
}
|
|
|
|
function HandleSkipButtonMouseOut()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsSkip";
|
|
}
|
|
|
|
function HandleSkipButtonMouseDown()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsSkip-down";
|
|
}
|
|
|
|
function HandleNextButtonMouseOver()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsNext-hover";
|
|
}
|
|
|
|
function HandleNextButtonMouseOut()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsNext";
|
|
}
|
|
|
|
function HandleNextButtonMouseDown()
|
|
{
|
|
if((!this.disabled)&&(this.tagName=="BUTTON"))
|
|
this.className="newbuttonsNext-down";
|
|
}
|
|
|
|
|
|
function InitNewButtons(NewSimpleBack, NewSimpleNext)
|
|
{
|
|
|
|
if(g.btnSkip!=null)
|
|
{
|
|
g.btnSkip.onmouseover = HandleSkipButtonMouseOver;
|
|
g.btnSkip.onmouseout = HandleSkipButtonMouseOut;
|
|
g.btnSkip.onmousedown = HandleSkipButtonMouseDown;
|
|
|
|
if(!g.btnSkip.disabled)
|
|
{
|
|
g.btnSkip.onclick = GoCancel;
|
|
g.btnSkip.className="newbuttonsSkip";
|
|
}
|
|
else
|
|
{
|
|
g.btnSkip.className="newbuttonsSkip-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnNext != null)
|
|
{
|
|
g.btnNext.onmouseover = HandleNextButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleNextButtonMouseOut;
|
|
g.btnNext.onmousedown = HandleNextButtonMouseDown;
|
|
|
|
if (!g.btnNext.disabled)
|
|
{
|
|
if (NewSimpleNext == null)
|
|
g.btnNext.onclick = GoNext;
|
|
else
|
|
g.btnNext.onclick = SimpleNavNext;
|
|
|
|
g.btnNext.className="newbuttonsNext";
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.className="newbuttonsNext-disabled";
|
|
}
|
|
}
|
|
|
|
if (g.btnBack != null)
|
|
{
|
|
g.btnBack.onmouseover = HandleBackButtonMouseOver;
|
|
g.btnBack.onmouseout = HandleBackButtonMouseOut;
|
|
g.btnBack.onmousedown = HandleBackButtonMouseDown;
|
|
|
|
if (!g.btnBack.disabled)
|
|
{
|
|
if (NewSimpleBack == null)
|
|
g.btnBack.onclick = GoBack;
|
|
else
|
|
g.btnBack.onclick = SimpleNavBack;
|
|
|
|
g.btnBack.className="newbuttonsBack";
|
|
}
|
|
else
|
|
{
|
|
g.btnBack.className="newbuttonsBack-disabled";
|
|
}
|
|
}
|
|
}
|
|
|
|
var g_LastKeyDown = null;
|
|
function OnKeyDown()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (g.event.altKey)
|
|
{
|
|
g_LastKeyDown = String.fromCharCode(g.event.keyCode);
|
|
if (g_LastKeyDown != null)
|
|
g_LastKeyDown = g_LastKeyDown.toUpperCase();
|
|
}
|
|
else
|
|
g_LastKeyDown = null;
|
|
|
|
|
|
// AGENT: pass keydown to Agent, NOTE: code in AgtCore.js
|
|
Agent_OnKeyDown(g.event.srcElement);
|
|
}
|
|
|
|
// AGENT: SelectClick is used by Agent
|
|
|
|
function OnSelectClick()
|
|
{
|
|
Agent_OnSelectClick(g.event.srcElement);
|
|
}
|
|
|
|
// AGENT: OnClick is used by Agent
|
|
|
|
function OnClick()
|
|
{
|
|
Agent_OnElementClick(g.event.srcElement);
|
|
}
|
|
|
|
// AGENT: Focus functions are used by Agent
|
|
|
|
function OnFocus()
|
|
{
|
|
// Put other code here that needs access to the focus event
|
|
|
|
Agent_OnFocus(g.event.srcElement);
|
|
}
|
|
|
|
// VALIDATION ROUTINES
|
|
function KeyPressIsNumeric()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsNumeric(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function IsNumeric(keyCode)
|
|
{
|
|
if ((keyCode >= 48/*0*/) && (keyCode <= 57/*9*/))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
function IsSpecial(keyCode)
|
|
{
|
|
// BUGBUG DISABLED FOR BETA
|
|
/*
|
|
var bFound = false;
|
|
var iPosition = 0;
|
|
for (;iPosition < g_SpecialChars.length; iPosition++)
|
|
{
|
|
if (g_SpecialChars.charCodeAt(iPosition) == keyCode)
|
|
{
|
|
bFound = true;
|
|
break;
|
|
}
|
|
}
|
|
return bFound;
|
|
*/
|
|
return false;
|
|
}
|
|
|
|
function KeyPressIsValid()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsAlpha(g.event.keyCode) &&
|
|
!IsSpecial(g.event.keyCode) &&
|
|
!IsNumeric(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function KeyPressIsAlpha()
|
|
{
|
|
try
|
|
{
|
|
if (IsLocalFile() && g.event == null)
|
|
return;
|
|
}
|
|
catch(e)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (!IsAlpha(g.event.keyCode))
|
|
{
|
|
g.event.keyCode = 0;
|
|
g.event.returnValue = false;
|
|
}
|
|
}
|
|
|
|
function IsAlpha(keyCode)
|
|
{
|
|
// BUGBUG DISABLED FOR BETA
|
|
/*
|
|
var strKeyCode = String.fromCharCode(keyCode);
|
|
var re1 = new RegExp("\w"); // BUGBUG: should \ be escaped?
|
|
var re2 = new RegExp("\D"); // BUGBUG: should \ be escaped?
|
|
|
|
strKeyCode.match(re1);
|
|
strKeyCode.match(re2);
|
|
//return ((strKeyCode.match(re1) != null) && (strKeyCode.match(re2) != null));
|
|
*/
|
|
// if ((keyCode >= 97/*a*/ && keyCode <= 122/*z*/) ||
|
|
// (keyCode >= 65/*A*/ && keyCode <= 90 /*Z*/))
|
|
return true;
|
|
// else
|
|
// return false;
|
|
}
|
|
|
|
function NumberOfSpaces(strValue)
|
|
{
|
|
/*
|
|
var NASexp = RegExp("\s"); // BUGBUG: should \ be escaped?
|
|
var result = strValue.match(NASexp);
|
|
return ((result == null) || (result.length != strValue.length));
|
|
*/
|
|
var iSpaceCount = 0;
|
|
for (iPosition = 0; iPosition < strValue.length; iPosition ++)
|
|
{
|
|
if (strValue.charAt(iPosition) == ' ')
|
|
{
|
|
iSpaceCount++;
|
|
}
|
|
}
|
|
return iSpaceCount;
|
|
}
|
|
function KeyCodeToUpper()
|
|
{
|
|
var strKeyCode = String.fromCharCode(g.event.keyCode);
|
|
strKeyCode = strKeyCode.toUpperCase();
|
|
g.event.keyCode = strKeyCode.charCodeAt(0);
|
|
}
|
|
|
|
// END VALIDATION ROUTINES
|
|
|
|
function FlashPlayerInstalled()
|
|
{
|
|
var fReturn = false;
|
|
try
|
|
{
|
|
// Correlate the PROGID and CLSID sections of the registry, then determine
|
|
// whether the inproc server exists.
|
|
//
|
|
// Trailing backslashes on registry paths are required to read default
|
|
// value.
|
|
//
|
|
strProgId = WshShell.RegRead("HKCR\\CLSID\\"
|
|
+ CLSID_FLASH_PLAYER
|
|
+ "\\VersionIndependentProgID\\");
|
|
if ( PROGID_FLASH_PLAYER == strProgId
|
|
&& CLSID_FLASH_PLAYER == WshShell.RegRead( "HKCR\\"
|
|
+ strProgId
|
|
+ "\\CLSID\\")
|
|
)
|
|
{
|
|
strInprocServer32 = WshShell.RegRead( "HKCR\\CLSID\\"
|
|
+ CLSID_FLASH_PLAYER
|
|
+ "\\InprocServer32\\"
|
|
);
|
|
fReturn = FileSystemObj.FileExists(strInprocServer32);
|
|
}
|
|
|
|
}
|
|
catch (err)
|
|
{
|
|
// if an exception is thrown, something grave is amiss. It is safer to
|
|
// assume player is not installed.
|
|
//
|
|
fReturn = false;
|
|
}
|
|
|
|
return fReturn;
|
|
}
|
|
|
|
function InitApplication()
|
|
{
|
|
OOBEDocBody.style.cursor = "wait"; // show "wait" cursor while initializing
|
|
OOBEDocBody.style.backgroundColor="black";
|
|
|
|
g_bStartup = true;
|
|
InitFrameRef();
|
|
|
|
// Check if oemlogo under [Branding] is present in oobeinfo.ini,
|
|
// If so, check if that file does exists, and then use it.
|
|
var OEMLogoFile = null;
|
|
OEMLogoFile = ApiObj.get_INIKey("branding", "oemlogo");
|
|
if ( (OEMLogoFile != null)
|
|
&& (OEMLogoFile.length>0)
|
|
&& FileSystemObj.FileExists(g_OOBEDirPath+"images\\"+OEMLogoFile) )
|
|
{
|
|
spnOEMLogo.style.visibility="visible";
|
|
spnOEMLogo.style.backgroundImage = 'url(images/' + OEMLogoFile + ')';
|
|
}
|
|
|
|
NewMicrosoftLogo.src = 'images/mslogo.jpg';
|
|
|
|
g_bInHighScreenRes =
|
|
(window.top.screen.width >= 1024) &&
|
|
(window.top.screen.height >= 768);
|
|
|
|
// reset all parameters that change in high screen resolution
|
|
if (g_bInHighScreenRes)
|
|
{
|
|
|
|
NewWatermarkBackground.src = 'images/newmark1.jpg';
|
|
NewWatermarkTop.src = 'images/newtop1.jpg';
|
|
NewWatermarkBottom.src = 'images/newbtm1.jpg';
|
|
NewWatermarkBottom.style.top = 712;
|
|
|
|
ScreenFrame.style.width = 1024;
|
|
ScreenFrame.style.height = 768;
|
|
|
|
MainFrameTable.style.top = 28;
|
|
MainFrameTable.style.height = "99%";
|
|
|
|
document.frames("ifrmConnDelay").frameElement.style.left=0;
|
|
|
|
spnOEMLogo.style.left = 749;
|
|
spnAssist.style.top = 590;
|
|
spnAssist.style.left = 815;
|
|
spnAssist.style.width = 240;
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
NewWatermarkBackground.src = 'images/newmark8.jpg';
|
|
NewWatermarkTop.src = 'images/newtop8.jpg';
|
|
NewWatermarkBottom.src = 'images/newbtm8.jpg';
|
|
NewWatermarkBottom.style.top = 542;
|
|
|
|
// If our Window width and/or height is less then 800 or 600,
|
|
// this will add horizontal and/or vertical scroll bar.
|
|
ScreenFrame.style.width = 800;
|
|
ScreenFrame.style.height = 600;
|
|
|
|
}
|
|
|
|
// Move Agent to the left regardless of our resolution if we are in Bidi.
|
|
if (window.parent.document.dir == "rtl")
|
|
spnAssist.style.left = 10;
|
|
|
|
var ScreenDiff = window.top.screen.width - parseInt(ScreenFrame.style.width);
|
|
ScreenFrame.style.left = (ScreenDiff > 0) ? ScreenDiff / 2 : 0;
|
|
|
|
ScreenDiff = window.top.screen.height - parseInt(ScreenFrame.style.height);
|
|
ScreenFrame.style.top = (ScreenDiff > 0) ? ScreenDiff / 2 : 0;
|
|
|
|
|
|
// Set the alternate text for the movie and Agent
|
|
var L_MovieAlt_Text = "Welcome";
|
|
var L_AgentAlt_Text = "Click me to get help";
|
|
IntroAnimation.alt = L_MovieAlt_Text;
|
|
AssistImg.alt = L_AgentAlt_Text;
|
|
|
|
// WARNING: Force the No Modem status pane because InitStatusPane currently
|
|
// causes the RACM and Telephony services to be started in order to
|
|
// enumerate modems. When CheckDialReady uses PnP or some other means to
|
|
// enumerate modems, InitStatusPane can be called here to correctly
|
|
// initialize the status pane.
|
|
//
|
|
g_status = STATUS_OFF;
|
|
window.external.LoadStatusItems("No Modem");
|
|
|
|
InitCKPT();
|
|
|
|
// IME handling
|
|
|
|
g_IMEExists = FileSystemObj.FileExists(ApiObj.get_SystemDirectory() + "\\OOBE\\HTML\\IME\\IMETut1.htm");
|
|
|
|
Agent_Init();
|
|
|
|
if ( 0 != window.external.get_RetailOOBE() )
|
|
{
|
|
EmptyCKPTStack();
|
|
}
|
|
|
|
g_bIsSetupUpgrade = window.external.IsUpgrade();
|
|
|
|
spnPage.style.visibility = "visible";
|
|
|
|
if (ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneSaved") == 1)
|
|
{
|
|
g_CurTimeZoneIdx = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "TimeZoneIdx");
|
|
g_daylight = ApiObj.set_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", "DayLight");
|
|
}
|
|
|
|
if ( window.external.get_RetailOOBE() ||
|
|
g_CurrentCKPT > CKPT_COMPNAME ||
|
|
DirObj.get_IntroOnly()
|
|
)
|
|
{
|
|
// Make sure services.exe doesn't hang.
|
|
window.external.ComputerNameChangeComplete(false);
|
|
}
|
|
|
|
if ( !window.external.get_RetailOOBE() &&
|
|
window.external.GetNoWelcomeFinish() )
|
|
{
|
|
ApiObj.OEMComputername();
|
|
CompName_ChangeComplete(false);
|
|
|
|
window.external.OEMPassword();
|
|
// set it to something, since the oem prepopulated the password.
|
|
// We don't want to ask the question in this case.
|
|
g_AdminPassword = ""
|
|
}
|
|
|
|
// Construct the "To continue, click Next" string
|
|
// This will work for both BiDi and non-BiDi scenarios.
|
|
g_ClickNextStrWelcome = "<table tabindex=-1 border=0 style=\"position:absolute; top: " + ((!g_bInHighScreenRes) ? L_ClickNextStrTopPercent800_Text : L_ClickNextStrTopPercent1024_Text) + "; left:2%; width:95%\"><tr>"
|
|
+"<td class=\"text-primary\" ID=NextText nowrap>"+L_ContStr_Text+" <span class=\"emphasis-lesser\">"
|
|
+L_NextStr_Text+"</span>"+L_ClickNextLocStr_Text+L_Period_Text+"</td><td width=90%> </td></tr></table>";
|
|
|
|
// Check if user has previously selected a preferred connection type.
|
|
// This is for cases where OOBE was cold booted on any page after the ics.htm page
|
|
// This will cause proper navigation especially when we cold boot for ex. in isp.htm
|
|
// Check the registry if we have previously saved the connection type through SetPreferredConnection() in icsmgr.js
|
|
var AnyPrefConnection = null;
|
|
try
|
|
{
|
|
AnyPrefConnection = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE, OOBE_MAIN_REG_KEY + "\\TEMP", PREFCONN_REG_VALUE);
|
|
}
|
|
catch(e){AnyPrefConnection = null}
|
|
|
|
if (AnyPrefConnection == null)
|
|
g_PreferredConnection = CONNECTIONTYPE_INVALID;
|
|
else
|
|
g_PreferredConnection = AnyPrefConnection;
|
|
|
|
|
|
// Navigate to proper page
|
|
if (null == g_CurrentCKPT)
|
|
{
|
|
GoNavigate(CKPT_ANIMATION);
|
|
}
|
|
else
|
|
{
|
|
if (g_CurrentCKPT > CKPT_COMPNAME)
|
|
{
|
|
// Start services, etc. if OOBE won't navigate through CKPT_COMPNAME
|
|
//
|
|
CompName_ChangeComplete(false);
|
|
}
|
|
|
|
OOBEDocBody.style.cursor = "default";
|
|
ScreenFrame.style.display = "inline";
|
|
|
|
GoNavigate(g_CurrentCKPT);
|
|
}
|
|
|
|
// Start the music.
|
|
PlayBackgroundMusic();
|
|
|
|
// Now that we've navigated, make sure we show the OOBE window.
|
|
window.external.ShowOOBEWindow();
|
|
|
|
}
|
|
|
|
function InitStatusMenu()
|
|
{
|
|
trace("InitStatusMenu");
|
|
if ( (1 == DirObj.get_Offline() || false == InternetCapabilityExists() ))
|
|
{
|
|
g_status = STATUS_OFF;
|
|
StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
|
|
window.external.LoadStatusItems("No Modem");
|
|
}
|
|
else
|
|
{
|
|
if (UseIcs())
|
|
{
|
|
window.external.TriggerIcsCallback(true);
|
|
}
|
|
else
|
|
{
|
|
window.external.TriggerIcsCallback(false);
|
|
}
|
|
|
|
var str = DirObj.get_ISPSignup().toUpperCase();
|
|
if ("MSN" == str)
|
|
{
|
|
g_status = STATUS_ISP;
|
|
if ( window.external.get_RegStatus() )
|
|
window.external.LoadStatusItems("MSN(No Reg)");
|
|
else
|
|
window.external.LoadStatusItems("MSN");
|
|
}
|
|
else if ("OFFLINE" == str)
|
|
{
|
|
g_status = STATUS_ISP;
|
|
if ( window.external.get_RegStatus() )
|
|
window.external.LoadStatusItems("Offline(No Reg)");
|
|
else
|
|
window.external.LoadStatusItems("Offline");
|
|
}
|
|
else if ("PRECONFIG" == str)
|
|
{
|
|
g_status = STATUS_PRECONFIG;
|
|
if ( window.external.get_RegStatus() )
|
|
window.external.LoadStatusItems("Preconfig(No Reg)");
|
|
else
|
|
window.external.LoadStatusItems("Preconfig");
|
|
}
|
|
else
|
|
{
|
|
g_status = STATUS_NONE;
|
|
StatusObj.set_Status(NOLAUNCHISPSIGNUP, true);
|
|
if ( window.external.get_RegStatus() )
|
|
window.external.LoadStatusItems("None(No Reg)");
|
|
else
|
|
window.external.LoadStatusItems("None");
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function ProcessQueuedEvents() {
|
|
// flush all WM_ events in windows queue.
|
|
// workaround for IE 103880, 'white flashes in statpane & button on page unload'
|
|
window.external.ProcessQueuedEvents();
|
|
}
|
|
|
|
// Update status pane and navigate
|
|
function navigatetoPrivacy(PrivPage)
|
|
{
|
|
if(g_CurrentCKPT == CKPT_REGISTER1) {
|
|
Reg1SaveRadioState();
|
|
}
|
|
|
|
if(g_CurrentCKPT == CKPT_REGISTER3) {
|
|
Reg3SaveSettings();
|
|
}
|
|
|
|
if (PrivPage == "MS")
|
|
Navigate("setup\\prvcyMS.htm");
|
|
else if (PrivPage == "Activation_Policy")
|
|
Navigate("setup\\act_plcy.htm");
|
|
else
|
|
Navigate("setup\\OEMpriv.htm");
|
|
}
|
|
|
|
function navigatetoEULA()
|
|
{
|
|
Navigate("setup\\neweula2.htm");
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// isp.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function GetAncestorByTag(elem, tagName)
|
|
{
|
|
if (elem == null || tagName == null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
var aNode = elem.parentNode;
|
|
var tagNameUpperCase = tagName.toUpperCase();
|
|
while (aNode != null && aNode.nodeName != tagNameUpperCase)
|
|
{
|
|
aNode = aNode.parentNode;
|
|
}
|
|
|
|
return aNode;
|
|
}
|
|
|
|
var g_bRadioMigrateISP=false;
|
|
|
|
var g_MSNISP=false;
|
|
var g_ExistISP=false;
|
|
var g_NoISP=false;
|
|
|
|
var L_RetailMSN_Text = "<b><u>G</u>et online with MSN </b><br>Select this option if you're a new or existing MSN member.";
|
|
var L_UpgradeSkip_Text = "<b><u>D</u>o not set up an Internet connection at this time</b><br>Select this option if you already have an Internet connection on your computer, or if you do not want to set up an MSN Internet connection at this time.";
|
|
var L_UpgradeSkipAccessKey_Text = "D";
|
|
function IspLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if (window.external.get_RetailOOBE())
|
|
{
|
|
g.ISP_New.innerHTML = L_RetailMSN_Text;
|
|
}
|
|
if (g_status == STATUS_ISP || g_status == STATUS_OFF)
|
|
{
|
|
g.radioGetNewISP.style.display = "inline";
|
|
g.ISP_New.style.display = "inline";
|
|
g.radioGetNewISP.checked=true;
|
|
g_FirstFocusElement = g.radioGetNewISP;
|
|
|
|
if (g_bIsSetupUpgrade)
|
|
{
|
|
var trMigrateISP = GetAncestorByTag(g.radioMigrateISP, "TR");
|
|
var tableMigrateISP = GetAncestorByTag(trMigrateISP, "TABLE");
|
|
if ((tableMigrateISP != null) && (trMigrateISP != null))
|
|
{
|
|
tableMigrateISP.deleteRow(trMigrateISP.rowIndex);
|
|
}
|
|
g.skipISP.accessKey = L_UpgradeSkipAccessKey_Text;
|
|
g.skipISP.innerHTML = L_UpgradeSkip_Text;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
g.radioGetNewISP.style.display = "none";
|
|
g.ISP_New.style.display = "none";
|
|
g.radioMigrateISP.checked=true;
|
|
g_FirstFocusElement = g.radioMigrateISP;
|
|
}
|
|
|
|
InitNewButtons();
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
|
|
function IspUnLoad()
|
|
{
|
|
try
|
|
{
|
|
g_bRadioMigrateISP = (g.event.srcElement==g.radioMigrateISP);
|
|
}
|
|
catch (e) {}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// ics.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function IcsLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
InitNewButtons();
|
|
|
|
if (CanConfigLan() == CONFIG_LAN_UNKNOWN)
|
|
{
|
|
g.title_ics0.style.display="inline";
|
|
g.text_description_ics0.style.display="inline";
|
|
g.img_status_ics0.style.display="inline";
|
|
g.btnNext.className="newbuttonsNext-disabled";
|
|
g.btnNext.disabled=true;
|
|
|
|
CheckIfConfigLan("IcsLoadMe2()");
|
|
}
|
|
else
|
|
{
|
|
IcsLoadMe2();
|
|
}
|
|
}
|
|
|
|
function IcsLoadMe2()
|
|
{
|
|
if (!g || !g.title_ics0 || !g.title_ics1 || !g.title_ics2)
|
|
{
|
|
// the page may already be skipped
|
|
return;
|
|
}
|
|
|
|
if (CanConfigLan() == CONFIG_LAN_YES)
|
|
{
|
|
g.title_ics0.style.display="none";
|
|
g.text_description_ics0.style.display="none";
|
|
g.img_status_ics0.style.display="none";
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.className="newbuttonsNext";
|
|
|
|
g.radio_ics1.style.display="inline";
|
|
g.radio_ics2.style.display="inline";
|
|
|
|
if (GetPublicLanCount() != 0)
|
|
{
|
|
g.title_ics1.style.display="inline";
|
|
g.text_description_ics1.style.display="inline";
|
|
g.radio_description1_ics1.style.display="inline";
|
|
g.radio_description2_ics1.style.display="inline";
|
|
g.text_description2_ics1.style.display="inline";
|
|
}
|
|
else
|
|
{
|
|
g.title_ics2.style.display="inline";
|
|
g.text_description_ics2.style.display="inline";
|
|
g.radio_description1_ics2.style.display="inline";
|
|
g.radio_description2_ics2.style.display="inline";
|
|
g.radio_description1_ics2x.style.display="inline";
|
|
g.radio_description2_ics2x.style.display="inline";
|
|
if (HasModem())
|
|
{
|
|
g.TXT_MODEM01.style.display="inline";
|
|
g.TXT_MODEM02.style.display="inline";
|
|
g.TXT_MODEM02x.style.display="inline";
|
|
g.TXT_MODEM03.style.display="inline";
|
|
g.radio_ChooseModem.checked="true";
|
|
}
|
|
else
|
|
{
|
|
g.text_description2_ics2.style.display="inline";
|
|
}
|
|
}
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
else
|
|
{
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.click();
|
|
}
|
|
|
|
}
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
//iconn.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
var g_YesIconn=false;
|
|
var g_NoIconn=false;
|
|
|
|
function IconnLoadMe()
|
|
{
|
|
InitFrameRef();
|
|
|
|
if(g_YesIconn) {
|
|
g.radioYesIconn.checked=true;
|
|
} else if(g_NoIconn){
|
|
g.radioNoIconn.checked=true;
|
|
}else {
|
|
g.radioNoIconn.checked=false;
|
|
g.radioYesIconn.checked=false;
|
|
}
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
g_FirstFocusElement.focus();
|
|
g.btnBack.disabled=true;
|
|
|
|
if(!(g.radioYesIconn.checked || g.radioNoIconn.checked))
|
|
g.btnNext.disabled=true;
|
|
|
|
g.radioYesIconn.onclick = Iconn_HandleClick;
|
|
g.radioNoIconn.onclick = Iconn_HandleClick;
|
|
|
|
InitNewButtons();
|
|
}
|
|
|
|
function Iconn_HandleClick()
|
|
{
|
|
try
|
|
{
|
|
g_YesIconn = (g.event.srcElement==g.radioYesIconn);
|
|
g_NoIconn = (g.event.srcElement==g.radioNoIconn);
|
|
IconnRadioClicked();
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Iconn_HandleClick", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
function IconnRadioClicked()
|
|
{
|
|
// if they click on either button, enable next
|
|
if(g.btnNext.disabled && (g.radioYesIconn.checked || g.radioNoIconn.checked))
|
|
{
|
|
g.btnNext.onmouseover = HandleNextButtonMouseOver;
|
|
g.btnNext.onmouseout = HandleNextButtonMouseOut;
|
|
g.btnNext.onmousedown = HandleNextButtonMouseDown;
|
|
g.btnNext.className="newbuttonsNext";
|
|
g.btnNext.disabled = false;
|
|
g.btnNext.onclick = GoNext;
|
|
g.btnNext.focus();
|
|
}
|
|
}
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// ident1.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var g_cIdentitiesMax = InfoObj.get_IdentitiesMax();
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// NeedToCreateAccount
|
|
//
|
|
// Determine whether OOBE should navigate to the first identities page or username page
|
|
// and, if so, navigate there.
|
|
//
|
|
// Returns true if OOBE navigates to the page, false otherwise.
|
|
//
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
function NeedToCreateAccount()
|
|
{
|
|
try
|
|
{
|
|
// Look for reasons not to show the identities and username page.
|
|
//
|
|
if ( window.external.GetNetJoinStatus() == JOIN_STATUS_DOMAIN ) {
|
|
trace("NeedToCreateAccount: Joining a domain");
|
|
return false;
|
|
}
|
|
|
|
if (1 == InfoObj.get_OEMIdentities())
|
|
{
|
|
trace("NeedToCreateAccount: OEM identities are used");
|
|
return false;
|
|
}
|
|
|
|
var iUserCount = window.external.GetLocalUserCount();
|
|
if ( iUserCount > 1 ) {
|
|
trace("NeedToCreateAccount: GetLocalUserCount returned " + iUserCount);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("NeedToCreateAccount", err);
|
|
throw err;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
// Initialize the page
|
|
//
|
|
function Identities1_LoadMe()
|
|
{
|
|
try
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.btnNext;
|
|
|
|
var MultipleIdentities = InfoObj.get_UseIdentities();
|
|
if(MultipleIdentities) {
|
|
g.radioMultipleIdentities.checked=true;
|
|
} else {
|
|
g.radioSingleIdentity.checked=true;
|
|
}
|
|
|
|
g.radioMultipleIdentities.onclick = Identities1_HandleClick;
|
|
g.radioSingleIdentity.onclick = Identities1_HandleClick;
|
|
|
|
InitNewButtons();
|
|
|
|
if (g_FirstFocusElement != null)
|
|
g_FirstFocusElement.focus();
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Identities1_LoadMe", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
// Save the state of the multiple identies option button. The value of
|
|
// InfoObj.get_UseIdentities() will determine whether subsequent identities pages are
|
|
// displayed.
|
|
//
|
|
function Identities1_HandleClick()
|
|
{
|
|
try
|
|
{
|
|
var MultipleIdentities = (g.event.srcElement==g.radioMultipleIdentities);
|
|
InfoObj.set_UseIdentities(MultipleIdentities);
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Identities1_HandleClick", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
// ident2.htm
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
var IspAccountObj = new IspAccount();
|
|
|
|
function IspAccount()
|
|
{
|
|
this.REG_KEY = "\\ISPAccount";
|
|
this.USERNAME_REG_VAL = "ISPUserName";
|
|
this.USERFRIENDLYNAME_REG_VAL = "ISPUserFriendlyName";
|
|
this.PROFILENAME_REG_VAL = "ProfileName";
|
|
|
|
this.IspName = "";
|
|
this.UserName = "";
|
|
this.UserFriendlyName = "";
|
|
this.SignUp = false;
|
|
this.Init = false;
|
|
}
|
|
|
|
function IspAccountHasSignUp()
|
|
{
|
|
if (this.Init == false)
|
|
{
|
|
this.Check();
|
|
this.Init = true;
|
|
}
|
|
|
|
return this.SignUp;
|
|
}
|
|
|
|
IspAccount.prototype.HasSignUp = IspAccountHasSignUp;
|
|
|
|
function IspAccountCheck()
|
|
{
|
|
this.SignUp = false;
|
|
|
|
this.IspName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
|
|
OOBE_MAIN_REG_KEY + this.REG_KEY,
|
|
null);
|
|
if (this.IspName)
|
|
{
|
|
this.UserName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
|
|
OOBE_MAIN_REG_KEY + this.REG_KEY,
|
|
this.USERNAME_REG_VAL);
|
|
if (this.UserName)
|
|
{
|
|
this.SignUp = true;
|
|
this.UserFriendlyName = ApiObj.get_RegValue(HKEY_LOCAL_MACHINE,
|
|
OOBE_MAIN_REG_KEY + this.REG_KEY,
|
|
this.USERFRIENDLYNAME_REG_VAL);
|
|
}
|
|
}
|
|
|
|
return this.SignUp;
|
|
}
|
|
|
|
IspAccount.prototype.Check = IspAccountCheck;
|
|
|
|
function IspAccountSetProfileName(ProfileName)
|
|
{
|
|
|
|
ApiObj.set_RegValue(HKEY_LOCAL_MACHINE,
|
|
OOBE_MAIN_REG_KEY + this.REG_KEY,
|
|
this.PROFILENAME_REG_VAL,
|
|
ProfileName);
|
|
}
|
|
|
|
IspAccount.prototype.SetProfileName = IspAccountSetProfileName;
|
|
|
|
var g_fFirstLoadIdentities = true;
|
|
|
|
// Initialize the page
|
|
//
|
|
function Identities2_LoadMe()
|
|
{
|
|
try
|
|
{
|
|
InitFrameRef();
|
|
|
|
g_FirstFocusElement = g.txtUser.item(0);
|
|
g_FirstFocusElement.focus(0);
|
|
g_FirstFocusElement.select(0);
|
|
|
|
if (g_fFirstLoadIdentities)
|
|
{
|
|
if (IspAccountObj.HasSignUp() &&
|
|
IspAccountObj.UserFriendlyName != null &&
|
|
IspAccountObj.UserFriendlyName != "")
|
|
{
|
|
InfoObj.set_Identity(0, IspAccountObj.UserFriendlyName);
|
|
}
|
|
else
|
|
{
|
|
InfoObj.SuggestIdentity0();
|
|
}
|
|
g_fFirstLoadIdentities = false;
|
|
g_Identities2_OK = true;
|
|
}
|
|
|
|
if (IspAccountObj.HasSignUp())
|
|
{
|
|
g.Ident2_IspAccountName.innerText = IspAccountObj.UserName;
|
|
g.Ident2_IspAccountName.style.display="inline";
|
|
}
|
|
|
|
Identities2_LoadIdentities();
|
|
|
|
InitNewButtons();
|
|
|
|
if (Identities2_Required())
|
|
{
|
|
g.btnSkip.style.visibility = "hidden";
|
|
g.SkipBtnLocalText.style.visibility = "hidden";
|
|
}
|
|
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Identities2_LoadMe", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
function Identities2_Required()
|
|
{
|
|
// IsSetupUpgrade return if it is an NT upgrade or not
|
|
return (!window.external.IsSetupUpgrade());
|
|
}
|
|
|
|
var g_Identities2_None = true;
|
|
|
|
// Retrieve any currently existing identities and stuff them in edit boxes.
|
|
//
|
|
function Identities2_LoadIdentities()
|
|
{
|
|
try
|
|
{
|
|
g.Ident2_Explain.style.display="none";
|
|
g.Ident2_Explain2.style.display="none";
|
|
|
|
if (null != g.txtUser)
|
|
{
|
|
// Don't use more identities than can be displayed.
|
|
//
|
|
iMax = (g.txtUser.length <= g_cIdentitiesMax) ? g.txtUser.length
|
|
: g_cIdentitiesMax;
|
|
for (i = 0; i < iMax; i++)
|
|
{
|
|
g.txtUser.item(i).value = InfoObj.get_Identity(i);
|
|
g_FirstFocusElement = g.txtUser.item(i)
|
|
if (InfoObj.check_Identity(i))
|
|
{
|
|
g.lblUser[i].className="text-primary";
|
|
}
|
|
else
|
|
{
|
|
trace("Identities2_LoadIdentities: check_identitiy failed for identity " +
|
|
i + ": " + g.txtUser.item(i).value);
|
|
g.lblUser[i].className="text-error";
|
|
g_FirstFocusElement.focus();
|
|
g_FirstFocusElement.select();
|
|
}
|
|
}
|
|
|
|
if (!g_Identities2_OK)
|
|
{
|
|
if (g_Identities2_None)
|
|
{
|
|
g.Ident2_Explain2.style.display="inline";
|
|
}
|
|
else
|
|
{
|
|
var CompName = ApiObj.get_ComputerName();
|
|
if (CompName)
|
|
{
|
|
var L_txtIdentities218_Text = "Names must not be equal to \"%1\", \"Administrator\" or \"Guest\"";
|
|
g.spnIdentities218.innerText = ApiObj.FormatMessage(L_txtIdentities218_Text, CompName);
|
|
}
|
|
g.Ident2_Explain.style.display="inline";
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Identities2_LoadIdentities", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
// Cache the identities the user has entered in the edit boxes.
|
|
//
|
|
var g_NameToSaveIndex = 0;
|
|
function Identities2_OnLeave()
|
|
{
|
|
try
|
|
{
|
|
if (null != g.txtUser)
|
|
{
|
|
// Don't use more identities than can be displayed.
|
|
//
|
|
iMax = (g.txtUser.length <= g_cIdentitiesMax) ? g.txtUser.length
|
|
: g_cIdentitiesMax;
|
|
|
|
|
|
// check if every field is empty
|
|
g_Identities2_None = true;
|
|
for (i = 0; i < iMax; i++)
|
|
{
|
|
if ((g.txtUser.item(i).value != null) && (g.txtUser.item(i).value != ""))
|
|
{
|
|
g_Identities2_None = false;
|
|
g_NameToSaveIndex = i;
|
|
break;
|
|
}
|
|
}
|
|
|
|
g_Identities2_OK = (Identities2_Required() ? !g_Identities2_None : true);
|
|
|
|
for (i = 0; i < iMax; i++)
|
|
{
|
|
InfoObj.set_Identity(i, g.txtUser.item(i).value);
|
|
if (!InfoObj.check_Identity(i))
|
|
{
|
|
g_Identities2_OK = false;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Identities2_OnLeave", err);
|
|
throw err;
|
|
}
|
|
}
|
|
|
|
function IsValidRegisteredOwnerName(strName)
|
|
{
|
|
// This regex says "find a character that is NOT valid in a computer name."
|
|
//
|
|
|
|
var re = new RegExp("[^A-Za-z0-9 ]"); // We have a "space" between "9" and "]" because a "space" is a valid character for Registered Owner Name.
|
|
return (-1 == strName.search(re));
|
|
}
|
|
|
|
// Set the name as the Registered Owner of this computer
|
|
function Save_Registered_owner(OwnerFirstName, OwnerLastName)
|
|
{
|
|
try
|
|
{
|
|
var OwnerName = null;
|
|
|
|
if (OwnerFirstName && OwnerLastName)
|
|
{
|
|
var L_FullNameFmt_Text = "%1 %2";
|
|
OwnerName = ApiObj.FormatMessage(L_FullNameFmt_Text, OwnerFirstName, OwnerLastName);
|
|
}
|
|
else if (OwnerFirstName)
|
|
{
|
|
OwnerName = OwnerFirstName;
|
|
}
|
|
else if (OwnerLastName)
|
|
{
|
|
OwnerName = OwnerLastName;
|
|
}
|
|
|
|
if (OwnerName)
|
|
{
|
|
InfoObj.set_OwnerName(OwnerName);
|
|
g_RegisteredOwnerDone = true;
|
|
}
|
|
|
|
}
|
|
catch (err)
|
|
{
|
|
logError("Save_Registered_owner", err);
|
|
throw err;
|
|
g_RegisteredOwnerDone = false;
|
|
}
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// DO NOT REMOVE THIS FUNCTION THIS WILL GET CALLED WHEN F1 IS
|
|
// PRESSED.
|
|
////////////////////////////////////////////////////////////////////
|
|
function OnHelp()
|
|
{
|
|
// Invoke MSAgent
|
|
Agent_OnUserRequestAssistant();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Background music function
|
|
////////////////////////////////////////////////////////////////////
|
|
var g_fMusicPlayed = false;
|
|
function PlayBackgroundMusic()
|
|
{
|
|
if (!g_fMusicPlayed)
|
|
{
|
|
g_fMusicPlayed = true;
|
|
window.external.PlayBackgroundMusic();
|
|
}
|
|
}
|
|
|
|
</script>
|
|
|
|
</HEAD>
|
|
|
|
<BODY ID=OOBEDocBody leftMargin=0 DIR=LTR onload="InitApplication();" scroll=auto tabIndex=-1 topMargin=0 language=javascript onhelp="Agent_OnUserRequestAssistant();">
|
|
<SPAN ID=junkspan style="height:2px; width:2px; background-color:black; z-index:99; display:none">
|
|
</SPAN>
|
|
|
|
<SPAN ID=MovieFrame style="height:1;width:1;display:none">
|
|
<OBJECT CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
|
|
ID=IntroAnimation WIDTH=1 HEIGHT=1 style="visibility:hidden">
|
|
<PARAM name="EnableContextMenu" value="false">
|
|
<PARAM NAME="UIMode" VALUE="none">
|
|
<PARAM NAME="Enabled" VALUE="false">
|
|
<PARAM NAME="autoStart" VALUE="false">
|
|
<PARAM NAME="fullScreen" VALUE="true">
|
|
<PARAM NAME="URL" VALUE="images\intro.wmv">
|
|
<PARAM NAME="WindowlessVideo" VALUE="true">
|
|
</OBJECT>
|
|
</SPAN>
|
|
|
|
<SPAN ID=ScreenFrame style="height:100%; width:100%; position:absolute; display:none">
|
|
|
|
<IMG ID=NewWatermarkBackground style="LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-99;" alt="">
|
|
<IMG ID=NewWatermarkTop style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-98;" alt="">
|
|
<IMG ID=NewWatermarkBottom style="display: inline; LEFT: 0px; TOP: 0px; POSITION: absolute; z-index:-97;" alt="">
|
|
<IMG ID=NewMicrosoftLogo style="display: inline; LEFT: 20px; TOP: 5px; POSITION: absolute; z-index:-96;" alt="">
|
|
|
|
<SPAN id=spnOEMLogo style="visibility:hidden; position:absolute; TOP:7px; LEFT:525px; width:255px; HEIGHT:40px; z-index:10; background-repeat:no-repeat;">
|
|
</SPAN>
|
|
|
|
<TABLE border=0 ID=MainFrameTable cellpadding=0 cellspacing=0 style="z-index:6; position:absolute; left:0px; top:25px; width:100%; height:97%">
|
|
<TR>
|
|
<TD style="height:100%">
|
|
<SPAN id=spnPage style="VISIBILITY: hidden; z-index:4;" tabIndex=-1>
|
|
<SPAN id=spnMainFrame style="width: 100%; height:100%" tabIndex=-1>
|
|
<IFRAME ALLOWTRANSPARENCY="true" id=ifrmMainFrame frameBorder=no scrolling=no width="100%" height="97%" name=msoobeMain tabIndex=0></IFRAME>
|
|
<IFRAME ALLOWTRANSPARENCY="true" id=ifrmConnDelay frameBorder=no style="display:none; position:absolute; z-index:-1; left: 0px; top: 0px;" scrolling=no width="100%" height="100%" name=connDelay tabIndex=-1 src="setup/ISPWait.htm"></IFRAME>
|
|
</SPAN>
|
|
</SPAN>
|
|
</TD>
|
|
<TD WIDTH=20></TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<comment>Make sure the spnAssist area (coverage) does not cover the Next button</comment>
|
|
<SPAN id=spnAssist class="emphasis-lesser" style="visibility:hidden; POSITION: absolute; LEFT: 625px; TOP: 440px; WIDTH: 180px; z-index:9">
|
|
<TABLE width="95%" cellspacing=0 cellpadding=0 align=center class="emphasis-lesser" style="text-align:center;color:white;">
|
|
<TR>
|
|
<TD align=center>
|
|
<IMG align=middle id=AssistImg border=0 src="images/qmark.gif"
|
|
style="visibility:hidden;z-index:9" language=javascript
|
|
onclick="Agent_OnUserRequestAssistant()"><BR>
|
|
</TD>
|
|
</TR>
|
|
<TR>
|
|
<TD ID=MerlinStr1 class="text-primary"><span id="agentStr1" onclick="Agent_OnUserRequestAssistant()"><id id="L_AgentHelp1_Text">For help,</id></span></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD ID=MerlinStr2 class="text-primary"><span id="agentStr2" onclick="Agent_OnUserRequestAssistant()"><id id="L_AgentHelp2_Text">click here or press F1.</id></span></TD>
|
|
</TR>
|
|
<TR>
|
|
<TD ID=MerlinStr3_Extra_line_for_localization class="text-primary"><span id="agentStr3"><id id="L_AgentHelp3OptionalLine_Text"></id></span></TD>
|
|
</TR>
|
|
</TABLE>
|
|
</SPAN>
|
|
|
|
</SPAN>
|
|
</BODY>
|
|
</HTML>
|