Op deze website gebruiken we cookies om content en advertenties te personaliseren, om functies voor social media te bieden en om ons websiteverkeer te analyseren. Ook delen we informatie over uw gebruik van onze site met onze partners voor social media, adverteren en analyse. Deze partners kunnen deze gegevens combineren met andere informatie die u aan ze heeft verstrekt of die ze hebben verzameld op basis van uw gebruik van hun services. Meer informatie.

Akkoord

Vraag & Antwoord

Anders (software)

Dell 530

None
3 antwoorden
  • Hallo,

    Wie kan mij helpen?
    Zelf ben ik in het bezit van een DELL Inspirion 530 en heb sinds kort steeds bij opstarten een "fout bij laden van DLL" melding op mijn scherm dat hij een script niet kan openen.
    Weet iemand wat dat inhoudt en beter nog hoe ik eraf kom?

    Bij voorbaat dank.
  • niet uitgesloten dat er malware op die pc is binnengedrongen, die bij de opstart een deuntje mee wil blazen….
    eerst maar eens volledig scannen met een uptodate virusscanner en vervolgens met het progje malwarebytes.
    http://www.malwarebytes.org/mbam.php
  • [quote:5e349549f6="derkdejong"]niet uitgesloten dat er malware op die pc is binnengedrongen, die bij de opstart een deuntje mee wil blazen….
    eerst maar eens volledig scannen met een uptodate virusscanner en vervolgens met het progje malwarebytes.
    http://www.malwarebytes.org/mbam.php[/quote:5e349549f6]

    Hoi Derk,

    Ik heb gedaan wat jij gevraagd hebt maar dit heeft niks gebracht.

    Het is een DELL script ben ik achter, en de fout zit in regel 30 teken 3 zegt de waarschuwing.

    Maar dan weet ik nog niet waar ik moet zoeken?

    Hieronder de gehele tekst:

    /*******************************************************************************
    ** File Name: ss_shellinclude.js
    **
    ** Summary: SupportSoft Client Shell Level Includes
    **
    ** Description: This file helps in maintaining a clear include file order at
    ** shell level. Also any functions required at shell page become
    ** part of this file. Intend is that the shell page ss_shell.htm
    ** should NOT require to include any other file.
    **
    ** Dependencies: see include section
    **
    ** Copyright SupportSoft Inc. 2006, All rights reserved.
    *******************************************************************************/
    var g_shi_MapOnError = true;
    var g_shi_AlertOnError = true;
    var g_shi_UpdateDOM = null;
    var g_shi_SnapinBarSelectedId = "";
    var g_shi_BcontResize = false;

    if (typeof(self) != 'undefined')
    {
    var shellwindow = self; // This is the shell scope.
    var externalwindow = window.external; // To the hosting container, if any.

    if (g_shi_MapOnError)
    window.onerror = ss_shi_ErrorTrap;

    /* GS Performance enhancement: Wait 1.5 minutes before updating the system tray on boot event */
    var aParameters = new VBArray(externalwindow.getArguments()).toArray();
    if (aParameters[aParameters.length-1] == "/startevent" &&
    aParameters[aParameters.length-2].indexOf("minibcont";) > 0) {
    externalwindow.SleepWithMsgDispatch(90000);
    }

    }

    var g_shi_pvt_ShellBusyTimer = null;
    var g_shi_pvt_SetResumeMode = false; // Only allow exit state to be written once.
    var g_shi_pvt_ShellLoading = true;
    var g_shi_pvt_BusyEndDelay = 250;
    var gActiveXObjectCache = {};
    var gActiveXObjectCache2 = {};

    /*******************************************************************************
    ** Name: ss_shi_ErrorTrap
    **
    ** Purpose: Traps all unhandled top-level errors. While developing, set
    ** g_shi_AlertOnError to true to receive alerts for unhandled errors.
    **
    ** Parameter: sMsg - Error message.
    ** sPage - The full path to the page the error occured on.
    ** sLine - The line the error occured on.
    **
    ** Return: true - cancels the error event.
    *******************************************************************************/
    function ss_shi_ErrorTrap(sMsg,sPage,sLine)
    {
    var sErrorMsg = "An application error has occurred…
    "+
    "Error: " + sMsg + "
    "+
    "Page: " + sPage + "
    "+
    "Line: " + sLine + "
    ";

    // Suppress error generated by minibcont popup (only notification) and close it.
    if(location.href.indexOf("configtouse=minibcont";) > -1) {
    window.external.Close();
    event.returnValue = true;
    return true;
    }

    if (g_shi_AlertOnError)
    alert(sErrorMsg);
    event.returnValue = true;
    return true;
    }

    /*******************************************************************************
    ** Name: Id
    **
    ** Purpose: Shorthand helper for document.getElementById
    **
    ** Parameter: ID - The id attribute to query the current document for.
    **
    ** Return: DOM Element
    *******************************************************************************/
    function Id(ID) {
    return document.getElementById(ID);
    }

    /*******************************************************************************
    ** Name: ss_shi_OnBeforeUnload
    **
    ** Purpose: Fires when the shell might be unloading.
    **
    ** Parameter: oEvent from the user agent.
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_OnBeforeUnload( oEvent )
    {
    try
    {
    g_Logger.Info("ss_shi_OnBeforeUnload";);
    }
    catch(ex)
    {
    try {
    g_Logger.Error("ss_shi_OnBeforeUnload()", "Unexpected Error " + ex.message);
    } catch (ex2) {}
    }
    }




    /*******************************************************************************
    ** Name: ss_shi_OnUnload
    **
    ** Purpose: Fires when the shell is actually unloading.
    **
    ** Parameter: oEvent from the user agent.
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_OnUnload( oEvent )
    {
    try {
    g_Logger.Info("ss_shi_OnUnload";);
    // Although the widget doesn't govern this section,
    // grouping this flag in the widgets section is the right place
    // for this flag. May need to move somewhere else to be idealistic.
    var sDefaultResumeMode = ss_cfg_GetValue("widgets", "ss_wdg_rsm_default_resume_mode", SS_CUI_RESUMEMODE_PROMPT);
    if (! (sDefaultResumeMode in SS_CUI_RESUMEMODE_MAP)) {
    sDefaultResumeMode = SS_CUI_RESUMEMODE_PROMPT;
    }
    ss_shi_SetResumeMode(sDefaultResumeMode);
    ss_evt_SendByName(SS_EVT_SHELL_ONUNLOAD);
    try {
    if (g_cfg_MeasureMacros == true) {
    alert(ss_cfg_GetHitCount());
    }
    } catch (e2) {}
    } catch(ex) {
    try {
    g_Logger.Error("ss_shi_OnUnload()", "Unexpected Error " + ex.message);
    } catch (ex2) {}
    }
    }


    /*******************************************************************************
    ** Name: External_OnClose
    **
    ** Purpose: This is callback function that any application running inside
    ** bcont can trap to handle direct container closures.
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function External_OnClose()
    {
    g_Logger.Info("External_OnClose";);
    try {
    var bProgramaticClose = shellwindow.g_con_ProgramClosed;
    if (!bProgramaticClose && !ss_shi_OnClosePrompt()) {
    return false;
    }
    return ss_shi_NotifyExternalClosing(true);
    } catch (ex) {
    g_Logger.Error("External_OnClose", "Unexpected Error " + ex.message);
    }
    return true;
    }

    function ss_shi_NotifyExternalClosing(bHideWhileClosing) {

    try {

    // If sync is disabled and closing bigbcong and firstrun flow is completed, then show reminder popup.
    if (!gs_shi_isSyncEnabled() &&
    ss_con_GetIniValue("", "PROVIDERINFO", "instancename", "";) == "bigbcont" &&
    ss_cfg_GetValue("firstrun","FirstRunCompleted";) =="true" ) {

    // Do not show popup if user has rejected previously
    var providerID = ss_con_GetContextValue("SdcContext:ProviderId";);
    var reminderLocation = "Software\\SupportSoft\\ProviderList\\" + ss_con_GetContextValue("SdcContext:ProviderId";);
    if (ss_con_GetRegValue("HKCU", reminderLocation, "OptinPromptDisabled";).toLowerCase() != "true";) {
    var options = (String) (ss_ui_Dialog(4,ss_loc_XLate("ss_shl_updatedisabled";)));
    if (options.indexOf(":";) > -1) { // check whether user has chosen checkbox option
    var optionArray = options.split(":";);

    // Set Reminder Checkbox option
    var reminder_checkbox = optionArray[0];
    if (reminder_checkbox == "true";) {
    ss_con_SetRegValue("HKCU","Software\\SupportSoft\\ProviderList\\" + ss_con_GetContextValue("SdcContext:ProviderId";),"OptinPromptDisabled","true";);
    }

    // Set Enable Update checkbox option
    var enable_checkbox = optionArray[1];
    if (enable_checkbox == "true";) {
    externalwindow.Hide();
    gs_shi_enableSynch(true, "";);
    }
    } else {
    return false;
    }

    }
    }

    } catch (ex) {
    // ignore: Not important if popup reminder does not show up.
    }

    // g_Logger.Info("ss_shi_NotifyExternalClosing";);
    if (bHideWhileClosing) {
    try {
    externalwindow.Hide();
    } catch (e) {}
    }
    ss_evt_SendByName(SS_EVT_BCONT_UNLOADING);
    //g_Logger.Error("ss_shi_NotifyExternalClosing",e.message);
    return true;
    }

    /*******************************************************************************
    ** Name: External_OnRefresh
    **
    ** Purpose: This is callback function that any application running inside
    ** bcont can trap to handle when multiple instances of bcont occur
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/

    var g_bDialogShowing = false;

    function External_OnRefresh(cmdline)
    {
    g_Logger.Info("External_OnRefresh";);
    try {
    var oCmdLine = ss_con_CmdToObjEx(cmdline.split(" ";));

    var allowSwitch = ss_cfg_GetValue("shell", "allow_single_instance_snapinswitch", "false";);

    // Close bcont if /close parameter is passed
    if(allowSwitch=='true' && oCmdLine["close"]) {
    ss_shi_Close();
    }

    if(allowSwitch=='true' && oCmdLine["snapins:starting_snapin"])
    {
    if(ss_shi_BusyStateCheck(oCmdLine["snapins:starting_snapin"], "User action start snapin";))
    {
    if (!g_bDialogShowing)
    {
    g_bDialogShowing = true;
    ss_ui_Dialog(1, ss_loc_XLate("ss_shl_busyprocessing";));
    g_bDialogShowing = false;
    }
    }
    else
    {

    // redirect user to the content page if guid is passed. This is used if the user already has
    // DSC open. For new DSC window, the command arguments are read.
    if (oCmdLine["snapins:starting_snapin"] == "snapin_content_template" && oCmdLine["content_guid"]) {
    try {
    gs_oDynSnapin(oCmdLine["content_guid"], '');
    var pattern = /\s+\/starthidden\s+|\s+\/starthidden$/;
    if(externalwindow.IsVisible() && !pattern.test(cmdline))
    {
    externalwindow.focus();
    }
    return;
    } catch (e) {}
    }

    if (oCmdLine["snapins:starting_snapin"] == "snapin_messagelisting" && oCmdLine["msgguid"]) {
    ss_db_DataSet("ss_msg_db_SelectedDetail", oCmdLine["msgguid"]);
    }

    ss_snp_StartStackedByUser(oCmdLine["snapins:starting_snapin"], true, parent.g_snp_SnapinName, true);
    }
    }
    // Show and bring existing instance to foreground only if the following conditions are true
    // (1) existing bcont has WS_VISIBLE flag set (it will be set even if window is minimized or have other windows on top)
    // (2) the 2nd instance's cmdLine does not have the /starthidden flag indicating it wants to do its work in hidden mode
    var ptrnBringFocus = /\s+\/bringtofocus\s+|\s+\/bringtofront$/;
    //var ptrnBringFocus = (cmdline.toLowerCase().indexOf("/bringtofront";) != -1 );
    var pattern = /\s+\/starthidden\s+|\s+\/starthidden$/;
    if(externalwindow.IsVisible() && (ptrnBringFocus.test(cmdline) || !pattern.test(cmdline)))
    {
    externalwindow.focus();
    }
    return ss_shi_NotifyExternalRefresh(cmdline);
    } catch (ex) {
    g_Logger.Error("External_OnRefresh", "Unexpected Error " + ex.message);
    }
    return true;
    }

    function ss_shi_NotifyExternalRefresh(cmdline) {
    var oEvt = ss_evt_Create(SS_EVT_BCONT_MULTIINSTANCE);

    oEvt.description = cmdline;

    ss_evt_Send(oEvt);
    return true;
    }


    /*******************************************************************************
    ** Name: ss_shi_SetResumeMode
    **
    ** Purpose: Sets the ResumeMode registry key indicating how to Resume
    ** when the Shell restarts.
    **
    ** Parameter: sMode - A member of SS_CUI_RESUMEMODE_MAP.
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_SetResumeMode( sMode )
    {
    g_Logger.Info("ss_shi_SetResumeMode";);
    try {
    if (g_shi_pvt_SetResumeMode == false)
    {
    var sProvider = ss_cfg_GetProviderID();
    var sProduct = ss_cfg_GetValue("global", "product", "ClientUI";);
    ss_con_SetRegValue(
    REG_TREE,
    REG_SPRT + "ProviderList\\" + sProvider + "\\" + sProduct + "\\",
    SS_CUI_RESUMEMODE,
    sMode
    );
    g_shi_pvt_SetResumeMode = true;
    return true;
    }
    } catch (e) {
    g_Logger.Error("ss_shi_SetResumeMode", "Unexpected error " + e.message);
    throw(e);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_ClearResumeMode
    **
    ** Purpose: Clears the ResumeMode key, and sets the global to false allowing
    ** the ResumeMode to be set again.
    **
    ** Parameter: sMode - A member of SS_CUI_RESUMEMODE_MAP.
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_ClearResumeMode( sMode )
    {
    g_Logger.Info("ss_shi_ClearResumeMode";);
    try {
    var sProvider = ss_cfg_GetProviderID();
    var sProduct = ss_cfg_GetValue("global", "product", "ClientUI";);
    ss_con_DeleteRegVal(
    REG_TREE,
    REG_SPRT + "ProviderList\\" + sProvider + "\\" + sProduct + "\\",
    SS_CUI_RESUMEMODE
    );
    g_shi_pvt_SetResumeMode = false;
    return true;
    } catch (e) {
    g_Logger.Error("ss_shi_ClearResumeMode", "Unexpected error " + e.message);
    throw(e);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_GetResumeMode
    **
    ** Purpose: Returns the ResumeMode.
    **
    ** Parameter: none
    **
    ** Return: Member of SS_CUI_RESUMEMODE_MAP.
    *******************************************************************************/
    function ss_shi_GetResumeMode()
    {
    g_Logger.Info("ss_shi_GetResumeMode";);
    try {
    var sProvider = ss_cfg_GetProviderID();
    var sProduct = ss_cfg_GetValue("global", "product", "ClientUI";);
    var sMode = ss_con_GetRegValue(
    REG_TREE,
    REG_SPRT + "ProviderList\\" + sProvider + "\\" + sProduct + "\\",
    SS_CUI_RESUMEMODE
    );
    if (! (sMode in SS_CUI_RESUMEMODE_MAP)) {
    sMode = SS_CUI_RESUMEMODE_NONE;
    }
    return sMode;
    } catch (e) {
    g_Logger.Error("ss_shi_GetResumeMode", "Unexpected error " + e.message);
    throw(e);
    }
    return SS_CUI_RESUMEMODE_NONE;
    }

    /*******************************************************************************
    ** Name: ss_shi_State_AvoidResume
    **
    ** Purpose: Is Subscribed to SS_EVT_CUI_STATE_CLEANUP in order to
    ** avoid having the ResumeMode set. This is generally called
    ** when the client is closing after completing all Snapins.
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_State_AvoidResume()
    {
    g_Logger.Info("ss_shi_State_AvoidResume";);
    try {
    ss_shi_ClearResumeMode();
    g_shi_pvt_SetResumeMode = true;
    } catch (e) {
    g_Logger.Error("ss_shi_State_AvoidResume", e.message);
    throw(e);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_Close
    **
    ** Purpose: Declares a code-based closure, with no resume.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_Close()
    {
    g_Logger.Info("ss_shi_Close";);
    try {
    ss_shi_SetResumeMode(SS_CUI_RESUMEMODE_NONE);
    ss_con_Close();
    } catch (e) {
    g_Logger.Error("ss_shi_Close", e.message);
    }
    }


    /*******************************************************************************
    ** Name: ss_shi_PromptUserToClose
    **
    ** Purpose: Causes a prompt asking the user if they wish to exit.
    ** If true, exits by user.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_PromptUserToClose()
    {
    g_Logger.Info("ss_shi_PromptUserToClose";);
    try {
    ss_shi_SetResumeMode(SS_CUI_RESUMEMODE_NONE);
    ss_con_Close();
    } catch (e) {
    g_Logger.Error("ss_shi_PromptUserToClose", e.message);
    }
    }


    /*******************************************************************************
    ** Name: ss_shi_OnClosePrompt
    **
    ** Purpose: Prompts user before exiting the application based on the config
    ** settings. This is helper function used by closing mechanics.
    ** application does NOT call it directly.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_OnClosePrompt()
    {
    g_Logger.Info("ss_shi_OnClosePrompt";);
    try {

    var xReturn = ss_evt_SendByName(SS_EVT_SHELL_CONFIRM_UNLOAD);
    if (xReturn in SENDMSG_STACKEND_MSGSET) {
    ss_evt_SendByName(SS_EVT_SHELL_UNLOAD_CANCELED);
    return false;
    }
    if (ss_con_GetIniValue("", "PROVIDERINFO", "instancename", "";) != "minibcont";) {
    //check if we need to alert on exit
    var alertExit = ss_cfg_GetValue("global", "alert_exit", "false";);
    if (alertExit == 'true' && ss_con_IsUsingBCont()) {
    if (ss_ui_Dialog(2, ss_loc_GlobalXLate("ss_glb_alertexit";)) == false) {
    ss_evt_SendByName(SS_EVT_SHELL_UNLOAD_CANCELED);
    return false;
    }
    }
    //check if we need to alert on virus setting to be turned back on
    var alertVirus = ss_cfg_GetValue("global", "alert_virus", "false";);
    if (alertVirus == 'true') {
    ss_ui_Dialog(1, ss_loc_GlobalXLate("ss_glb_alertvirus";), "";);
    }

    //check if we need to alert on busy
    var alertBusy = ss_cfg_GetValue("global", "alert_busy", "false";);
    if (alertBusy == 'true') {
    ss_ui_Dialog(1, ss_loc_XLate("ss_shl_busyprocessing";), "";);
    return false;
    }
    }
    } catch (ex) {
    g_Logger.Error("ss_shi_OnClosePrompt()", ex.message);
    throw(ex);
    }
    return true;
    }

    /*******************************************************************************
    ** Name: ss_shi_OnBeforeLangLoad
    **
    ** Purpose: shell framework uses this function to write any UI stuff before
    ** localization so that default layout can be still exposed to
    ** customization via the localization framework.
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_OnBeforeLangLoad()
    {
    g_Logger.Info("ss_shi_OnBeforeLangLoad";);
    try {
    ss_ui_CheckFlash();
    ss_ui_BrandBCont();

    // register for events
    ss_evt_Subscribe(SS_EVT_CUI_RESET_HOMESTATE, ss_shi_OnResetHomeState);
    ss_evt_Subscribe(SS_EVT_BTTNBAR_MASK, ss_shi_OnMaskButton);
    ss_evt_Subscribe(SS_EVT_BTTNBAR_UNMASK, ss_shi_OnUnmaskButton);
    ss_evt_Subscribe(SS_EVT_SNAPIN_VP_FOCUS, ss_shi_OnHighlightSnapinBarButton);

    this.focus();
    } catch(ex) {
    g_Logger.Error("ss_shi_OnBeforeLangLoad", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_OnResetHomeState
    **
    ** Purpose: shell framework uses subscribes to reset home event and uses it
    ** to set all elements (ui/tasks) to their expected startup state
    **
    ** Parameter: sMsg
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_OnResetHomeState(sMsg)
    {
    g_Logger.Info("ss_shi_OnResetHomeState";);
    try {
    ss_evt_Send({name:SS_EVT_BTTNBAR_HIDE_HOME});
    ss_evt_Send({name:SS_EVT_BTTNBAR_HIDE_BACK});
    ss_evt_Send({name:SS_EVT_BTTNBAR_HIDE_RETEST});
    ss_evt_Send({name:SS_EVT_BTTNBAR_HIDE_NEXT});
    ss_evt_Send({name:SS_EVT_BTTNBAR_HIDE_FINISH});
    } catch(ex) {
    g_Logger.Error("ss_shi_OnResetHomeState", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_OnMaskButton
    **
    ** Purpose: shell framework subscribes to rename button bar buttons event
    ** and uses localization api to rename it.
    **
    ** Parameter: oMsg
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_OnMaskButton(oMsg)
    {
    g_Logger.Info("ss_shi_OnMaskButton";);
    try {
    var sTxtResId = oMsg.textId;
    var sAnchResId = oMsg.textId;
    var sImgResId = oMsg.textId;
    ss_shi_pvt_ReLocalizeButton(oMsg.buttonId, sTxtResId, sAnchResId, sImgResId);
    } catch(ex) {
    g_Logger.Error("ss_shi_OnMaskButton", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_OnUnmaskButton
    **
    ** Purpose: shell framework subscribes to unmask button bar buttons to
    ** their original name
    **
    ** Parameter: oMsg
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_OnUnmaskButton(oMsg)
    {
    g_Logger.Info("ss_shi_OnUnmaskButton";);
    try {
    var sTxtResId = BTTN_TEXT + oMsg.buttonId;
    var sAnchResId = BTTN_ANCHOR + oMsg.buttonId;
    var sImgResId = BTTN_IMAGE + oMsg.buttonId;
    ss_shi_pvt_ReLocalizeButton(oMsg.buttonId, sTxtResId, sTxtResId, sImgResId);
    } catch(ex) {
    g_Logger.Error("ss_shi_OnUnmaskButton", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_pvt_ReLocalizeButton
    **
    ** Purpose: helper to perform button relocalization.
    **
    ** Parameter: sBttnId string id of the button
    ** sTxtResId string id of the resource to use for the button innerText.
    ** sAnchResId string id of the resource to use for the button anchor alt/title
    ** sImgResId string id of the resource to use for the button img alt/title
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_pvt_ReLocalizeButton(sBttnId, sTxtResId, sAnchResId, sImgResId) {
    g_Logger.Info("ss_shi_pvt_MaskButton";);
    try {
    var sBttnTextId = BTTN_TEXT + sBttnId;
    var sBttnHiddenTextId = BTTN_TEXT + sBttnId + "__hidden";
    var sBttnImgId = BTTN_IMAGE + sBttnId;
    var sBttnAnchId = BTTN_ANCHOR + sBttnId;

    // Inner Text
    var oElement = document.getElementById(sBttnTextId);
    if (oElement) {
    oElement.innerHTML = ss_loc_XLate(sTxtResId);
    }

    // Hidden Text (defines size of segmented buttons
    var oElement = document.getElementById(sBttnHiddenTextId);
    if (oElement) {
    oElement.innerHTML = ss_loc_XLate(sTxtResId);
    }

    // Anchor Alts/Titles
    var oAnchElement = document.getElementById(sBttnAnchId);
    if (oAnchElement) {
    var sAltKey = sAnchResId+"__alt";
    var sAltVal = ss_loc_XLate(sAltKey);
    if (sAltVal == sAltKey)
    oElement.removeAttribute("alt";);
    else
    oElement.setAttribute("alt", sAltVal);
    var sTitleKey = sAnchResId+"__title";
    var sTitleVal = ss_loc_XLate(sTitleKey);
    if (sTitleVal == sTitleKey)
    oElement.removeAttribute("title";);
    else
    oElement.setAttribute("title", sTitleVal);
    }

    // Img Alts/Titles
    var oImgElement = document.getElementById(sBttnImgId);
    if (oImgElement) {
    var sAltKey = sImgResId+"__alt";
    var sAltVal = ss_loc_XLate(sAltKey);
    if (sAltVal == sAltKey)
    oImgElement.removeAttribute("alt";);
    else
    oImgElement.setAttribute("alt", sAltVal);
    var sTitleKey = sImgResId+"__title";
    var sTitleVal = ss_loc_XLate(sTitleKey);
    if (sTitleVal == sTitleKey)
    oImgElement.removeAttribute("title";);
    else
    oImgElement.setAttribute("title", sTitleVal);
    }
    } catch(ex) {
    g_Logger.Error("ss_shi_pvt_MaskButton", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_IsSnapinBarButtonSelected()
    **
    ** Purpose:
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_IsSnapinBarButtonSelected(sElementId)
    {
    var bSelected = false;
    try {
    if (g_shi_SnapinBarSelectedId != "";) {
    bSelected = (g_shi_SnapinBarSelectedId == sElementId);
    } else {
    var oElement = Id(sElementId);
    if (oElement) {
    bSelected = ss_ui_HasClass(oElement, "clsSnapinBarButtonSelect";);
    }
    }
    } catch (ex) {
    g_Logger.Error("ss_shi_IsSnapinBarButtonSelected()", ex.message);
    throw(ex);
    }
    return bSelected;

    }

    /*******************************************************************************
    ** Name: ss_shi_OnHighlightSnapinBarButton()
    **
    ** Purpose:
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_OnHighlightSnapinBarButton(oEvent)
    {
    ss_shi_HighlightSnapinBarButton(oEvent.SnapinName);
    return SENDMSG_RESULT_OK;
    }

    /*******************************************************************************
    ** Name: ss_shi_HighlightSnapinBarButton()
    **
    ** Purpose:
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_HighlightSnapinBarButton(sElementId)
    {
    var oElement = null;
    if (!Id(sElementId)) return;
    try {
    if (g_shi_SnapinBarSelectedId != "";) {
    oElement = Id(g_shi_SnapinBarSelectedId);
    if (oElement) {
    ss_ui_SwapClass(oElement, "clsSnapinBarButtonSelect", "clsSnapinBarButtonOver";);
    }
    }

    // save the new location in the navbar and set the UI
    g_shi_SnapinBarSelectedId = sElementId;
    oElement = Id(g_shi_SnapinBarSelectedId);
    if (oElement) {
    ss_ui_SwapClass(oElement, "clsSnapinBarButtonOver", "clsSnapinBarButtonSelect";);
    }
    } catch(ex) {
    g_Logger.Error("ss_shi_HighlightSnapinBarButton()", ex.message);
    throw(ex);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_SetSnapinBarStateChanges()
    **
    ** Purpose: Locks/unlocks the complete snapin bar. Enablement/disablement of
    ** individual buttons will be ignored if this set.
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_SetSnapinBarStateChanges(bLock)
    {
    var oSnapinBar = Id("ss_shl_SnapinBar";);
    if (oSnapinBar) {
    oSnapinBar.bIsLocked = bLock;
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_DisableSnapinBarButtons()
    **
    ** Purpose: Iterates through the snapin bar buttons and disables any
    ** buttons that are currently enabled.
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_DisableSnapinBarButtons()
    {
    var oSnapinBar = Id("ss_shl_SnapinBar";);
    if (oSnapinBar) {
    if (typeof oSnapinBar.bIsLocked != "undefined" && oSnapinBar.bIsLocked)
    return; // not allowed to change states
    if (typeof oSnapinBar.bDisabled != "undefined" && oSnapinBar.bDisabled)
    return; // already in disable

    var oDivs = oSnapinBar.getElementsByTagName("DIV";);
    for(var x=0, y=oDivs.length; x<y; x++) {
    ss_ui_AddClass(oDivs[x], "clsSnapinBarButtonDim";);
    oDivs[x].disabled = true;
    var oATags = oDivs[x].getElementsByTagName("A";);
    if(oATags.length > 0)
    oATags[0].disabled = true;
    }
    oSnapinBar.bDisabled = true;
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_EnableSnapinBarButtons()
    **
    ** Purpose: Iterates through the snapin bar buttons and enables any
    ** buttons that are currently disabled.
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_EnableSnapinBarButtons()
    {
    var oSnapinBar = Id("ss_shl_SnapinBar";);
    if (oSnapinBar) {
    if (typeof oSnapinBar.bIsLocked != "undefined" && oSnapinBar.bIsLocked)
    return; // not allowed to change states
    if (typeof(oSnapinBar.bDisabled) != "undefined" && !oSnapinBar.bDisabled)
    return; // already enabled

    var oDivs = oSnapinBar.getElementsByTagName("DIV";);
    for(var x=0, y=oDivs.length; x<y; x++) {
    ss_ui_RemoveClass(oDivs[x], "clsSnapinBarButtonDim";);
    oDivs[x].disabled = false;
    var oATags = oDivs[x].getElementsByTagName("A";);
    if(oATags.length > 0)
    oATags[0].disabled = false;
    }
    oSnapinBar.bDisabled = false;
    }
    }

    /*******************************************************************************
    ** Name: ss_loc_OnAfterShellLoad()
    **
    ** Purpose:
    **
    ** Parameter:
    **
    ** Return:
    *******************************************************************************/
    function ss_loc_OnAfterShellLoad()
    {
    g_Logger.Info("ss_loc_OnAfterShellLoad";);
    try {
    //Check for Disable Refresh/Text Selection
    ss_cfg_DisableBrowserFeatures(document);
    } catch(ex) {
    g_Logger.Error("ss_loc_OnAfterShellLoad()", ex.message);
    throw(ex);
    }
    }


    /*******************************************************************************
    ** Name: ss_shi_RestartComputerPermission
    **
    ** Purpose: Requests permission from all Snapins to restart the computer.
    **
    ** This API sends the SYSTEM_RESTART_PERMISSION event.
    ** If the response is not a member of SENDMSG_STACKEND_MSGSET
    ** then permission is granted.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_RestartComputerPermission()
    {
    g_Logger.Info("ss_shi_RestartComputerPermission";);
    var bRestartOK = false;
    try {
    var sResponse = ss_evt_SendByName(SYSTEM_RESTART_PERMISSION);
    bRestartOK = ! (sResponse in SENDMSG_STACKEND_MSGSET);
    } catch (e) {
    g_Logger.Error("ss_shi_RestartComputerPermission", e.message);
    throw(e);
    }
    g_Logger.Debug("ss_shi_RestartComputerPermission", bRestartOK);
    return bRestartOK;
    }

    /*******************************************************************************
    ** Name: ss_shi_RestartComputer
    **
    ** Purpose: Initiates a restart sequence by
    ** - sending SYSTEM_RESTART
    ** - setting the ResumeMode to auto
    ** - setting the Run key
    **
    ** - calling ss_con_Reboot
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_RestartComputer()
    {
    g_Logger.Info("ss_shi_RestartComputer";);
    return ss_shi_pvt_RestartOrShutdown(ss_con_Reboot, SYSTEM_RESTART);
    }

    /*******************************************************************************
    ** Name: ss_shi_ShutdownComputer
    **
    ** Purpose: Initiates a restart sequence by
    ** - sending SYSTEM_RESTART
    ** - setting the ResumeMode to auto
    ** - setting the Run key
    **
    ** - calling ss_con_Shutdown
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_ShutdownComputer()
    {
    g_Logger.Info("ss_shi_ShutdownComputer";);
    return ss_shi_pvt_RestartOrShutdown(ss_con_Shutdown, SYSTEM_RESTART); // TODO - Make new event?
    }

    /*******************************************************************************
    ** Name: ss_shi_Prep_RestartComputer
    **
    ** Purpose: Prepares for a restart which would
    ** be initiated by another app such as
    ** Windows Update by calling
    ** ss_shi_PrepareResumeWithWindows
    **
    ** Parameter: oEvent (.mode)
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_Prep_RestartComputer(oEvent)
    {
    g_Logger.Info("ss_shi_Prep_RestartComputer";);
    if (oEvent.mode == undefined)
    ss_shi_PrepareResumeWithWindows(SS_CUI_RESUMEMODE_AUTO, true);
    else
    ss_shi_PrepareResumeWithWindows(oEvent.mode, true);
    }

    /*******************************************************************************
    ** Name: ss_shi_ShutdownComputer
    **
    ** Purpose: Completes a shutdown or restart sequence.
    **
    ** Parameter: fnTarget – ss_con_Reboot or ss_con_Shutdown
    ** sNotificationEvent – SYSTEM_RESTART or other confirmation msg.
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_pvt_RestartOrShutdown(fnTarget, sNotificationEvent)
    {
    g_Logger.Info("ss_shi_pvt_RestartOrShutdown";);
    try {
    if (sNotificationEvent)
    {
    var sResponse = ss_evt_SendByName(sNotificationEvent);
    if (sResponse in SENDMSG_STACKEND_MSGSET)
    g_Logger.Error("ss_shi_pvt_RestartOrShutdown", sNotificationEvent + " Canceling Is An Error!";);
    }

    ss_shi_PrepareResumeWithWindows(SS_CUI_RESUMEMODE_AUTO);

    var bCloseAndRespawnAsRestart = ss_cfg_GetValue("sprt_developer","closeandrespawnforrestart","false";) == "true";

    if ( bCloseAndRespawnAsRestart ) {
    setTimeout(ss_shi_Close,0);
    }
    else {
    setTimeout(fnTarget,0); // ss_con_Shutdown,ss_con_Reboot
    }
    return true;
    } catch (e) {
    g_Logger.Error("ss_shi_pvt_RestartOrShutdown", e.message);
    throw(e);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_PrepareResumeWithWindows
    **
    ** Purpose: Assists in a restart sequence by
    ** - setting the ResumeMode to auto
    ** - setting the Run key
    **
    ** Parameter: sMode (auto/prompt/none)
    ** bAllowFutureSaves - When true, allows other save calls to also be respected.
    ** When false, or ommited, future save requests are ignored.
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_PrepareResumeWithWindows( sMode, bAllowFutureSaves )
    {
    g_Logger.Info("ss_shi_PrepareResumeWithWindows";);
    try {
    ss_shi_SetResumeMode( sMode );
    ss_shi_RunOnce_Set();
    ss_shi_State_StartSave();
    if (bAllowFutureSaves != true)
    {
    ss_shi_State_AvoidSave();
    }
    return true;
    } catch (e) {
    g_Logger.Error("ss_shi_PrepareResumeWithWindows", e.message);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_CancelResumeWithWindows
    **
    ** Purpose: Reverts the preperation for a possible reboot.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_CancelResumeWithWindows()
    {
    try {
    ss_shi_ClearResumeMode();
    ss_shi_pvt_RunOnce_Clear();
    ss_shi_State_ClearDataFiles();
    return true;
    } catch (e) {
    g_Logger.Error("ss_shi_CancelResumeWithWindows", e.message);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_RunOnce_Set
    **
    ** Purpose: Sets up this instance of the Client UI to run when the computer
    ** is restarted. Because HKLM, RunOnce stops the Explorer shell
    ** we're using the HKLM RUN Key, and we'll remove ourselves
    ** the next time we start up.
    **
    ** Parameter: oQueryParams - a hash of query string members to augment the
    ** command line / query string with.
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_RunOnce_Set( oQueryParams )
    {
    g_Logger.Info("ss_shi_RunOnce_Set";);

    try {
    var sRoot = REG_TREE;
    var sKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Run\\";
    var sValue = ss_cfg_GetValue("global", "product", "";) + " AutoStart";
    var xData = "";

    g_Logger.Debug("ss_shi_RunOnce_Set", sRoot+sKey+sValue + " = " + xData );

    xData = ss_shi_RunOnce_GetLink( oQueryParams );

    //
    // set key
    return ss_con_SetRegValue(sRoot, sKey, sValue, xData);

    } catch (e) {
    g_Logger.Error("ss_shi_RunOnce_Set", "Unexpected Error " + e.message);
    }
    return false;
    }

    function ss_shi_RunOnce_GetLink( oQueryParams )
    {
    var xData = "";

    var sExePath = "";
    var sHTMPath = location.href.split("?";)[0];
    var oParams = {};
    var sParams = "";

    //
    // build query string components hash.
    for (var i in oQS) {
    oParams = oQS;
    }
    for (var i in oQueryParams) {
    oParams = oQueryParams;
    }
    //
    // migrate parameters to query string.
    for (var i in oParams) {
    if (typeof(i) != 'undefined' && i != "" && oParams != undefined)
    {
    if (i != "url";) // pass on all paramters except the url
    {
    sParams += i + "=" + escape(unescape(oParams)) + "&";
    }
    }
    }

    sHTMPath += "?" + sParams;

    //
    // determine who to start with, iexplore or bcont.
    var bUsingBcont = ss_con_IsUsingBCont();

    //
    // Adjust exe path to match executable command line arguments.
    if (bUsingBcont)
    {
    var os = ss_con_GetOS();
    var redirectUrl = ss_cfg_GetValue("startup_redirect", os.toLowerCase(), "";);
    var bcontNMExe = ss_cfg_GetValue("global", "no_manifest_bcont", "";);

    // under vista, we need to start the container without the admin requirement
    if (redirectUrl && bcontNMExe)
    {
    var sBcontFN = [];
    var sBcontName = "";
    var sLang = "";
    sExePath = externalwindow.GetPath("EXE_PATH";);
    sBcontFN = sExePath.split("\\";);
    sBcontName = sBcontFN[sBcontFN.length -1];

    sLang = ss_cfg_GetLanguage();
    sExePath = sExePath.substring(0, sExePath.lastIndexOf("\\";) + 1);
    sExePath = sExePath + bcontNMExe;
    sExePath = '"' + sExePath + '"';

    // Ideally we should also pass sHTMPath to the new command line, however Run key does not accept anything greater than MAX_PATH (260 chars)
    // xData = sExePath + ' /url "' + ss_cfg_ParseMacros(redirectUrl) + '"' + '
    estart ' + sBcontName + '
    esumestart "' + sHTMPath + '"';
    xData = sExePath + ' /url "' + ss_cfg_ParseMacros(redirectUrl) + '"' + ' /language "' +sLang + '"
    estart ' + sBcontName;
    }
    else
    {
    sExePath = externalwindow.GetPath("EXE_PATH";);
    sExePath = '"' + sExePath + '"';
    // doesn't support cmd lines longer than 260, so don't include extra info
    var sParams = "";
    for (var i in oParams)
    {
    if (typeof(i) != 'undefined' && i != "" && oParams != undefined)
    {
    // pass on all parameters except the following list, this relies on the starturl
    // having the correct config and configtouse specified
    if (i != "url" && i != "starthidden" && i != "configtouse" && i != "config";)
    {
    sParams += " /" + i + " \"" + unescape(oParams) + "\"";
    }
    }
    }
    xData = sExePath + sParams;
    }
    }
    else
    {
    sExePath = ss_shi_pvt_GetIExplorePath();
    xData = sExePath + ' ' + sHTMPath;
    }
    return xData;
    }

    /*******************************************************************************
    ** Name: ss_shi_pvt_RunOnce_Clear
    **
    ** Purpose: Clears the run once key at startup.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_pvt_RunOnce_Clear()
    {
    g_Logger.Info("ss_shi_pvt_RunOnce_Clear";);
    var sRoot = REG_TREE;
    var sKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Run\\";
    var sValue = ss_cfg_GetValue("global", "product", "";) + " AutoStart";
    return ss_con_DeleteRegVal(
    sRoot,
    sKey,
    sValue
    );
    }

    /*******************************************************************************
    ** Name: ss_shi_pvt_GetIExplorePath
    **
    ** Purpose: Returns the path to IExplore.exe, usually needed for the Run key.
    **
    ** Parameter: none
    **
    ** Return: string
    *******************************************************************************/
    function ss_shi_pvt_GetIExplorePath()
    {
    g_Logger.Info("ss_shi_pvt_GetIExplorePath";);
    try {
    var sRoot = REG_TREE;
    var sKey = "Software\\Classes\\Applications\\iexplore.exe\\shell\\open\\command";
    var sValue = "";
    var sPath = ss_con_GetRegValue( sRoot, sKey, sValue );

    var rxArg = new RegExp("%1";);
    return sPath.replace(rxArg,'');
    } catch (e) {
    g_Logger.Error("ss_shi_pvt_GetIExplorePath", "Unexpected Error " + e.message);
    throw(e);
    }
    return "";
    }

    /*******************************************************************************
    ** Name: ss_shi_MoveToWalledGarden
    **
    ** Purpose: Initiates the move to the walled garden url.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_MoveToWalledGarden( oHistoryEntry )
    {
    g_Logger.Info("ss_shi_MoveToWalledGarden";);
    try {

    //
    // Verify a remote shell was specified…
    var sRemoteShell = ss_cfg_GetValue("global", "wg_shell_url", "";);
    var sRemoteShellFull = sRemoteShell;
    if (sRemoteShell == "";) {
    g_Logger.Error("ss_shi_MoveToWalledGarden", "Can't switch to server - No WG Url";);
    return false;
    }

    ss_shi_BusyStart("", "ss_shi_MoveToWalledGarden Busy Start For Switch to Walled Garden";);

    var bCtxChange = ss_shi_ContextChange("ss_shi_MoveToWalledGarden", sRemoteShell, "", "";);

    if (false == bCtxChange)
    {
    ss_shi_BusyEnd("", "ss_shi_MoveToWalledGarden Busy End For Failed Switch to Walled Garden";);
    return false;
    }
    return true;

    } catch (e) {
    g_Logger.Error("ss_shi_MoveToWalledGarden", "Unexpected error " + e.message);
    throw(e);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_ContextChange
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return:
    *******************************************************************************/
    function ss_shi_ContextChange(sProvider, sShellBase, sRemoteShellFull, sResumeMode)
    {
    g_Logger.Info("ss_shi_ContextChange";);
    try {
    sResumeMode = sResumeMode || SS_CUI_RESUMEMODE_AUTO;

    if (! sRemoteShellFull)
    {
    sRemoteShellFull = sShellBase;
    //
    // Add any arguments as specified…
    if (sRemoteShellFull.indexOf("?";) == -1)
    sRemoteShellFull += "?";
    for (var i in oQS)
    sRemoteShellFull += i + "=" + escape(oQS) + "&";
    }

    //
    // Verify the remote Shell is available…
    var bCanSeeWalledGarden = ss_shi_IsPageAvailable(sShellBase);
    if (! bCanSeeWalledGarden ) {
    var oError = new Error(-1, "Can't switch to server - Not Found " + sShellBase);
    g_Logger.Error("ss_shi_ContextChange", oError.message);
    throw(oError);
    }

    //
    // Record the contextchange history entry
    var oEntry = {
    SwitchProvider : sProvider,
    Context : sShellBase,
    FullPath : sRemoteShellFull,
    FromContext : ss_shi_GetLocalContext()
    };

    ss_hst_Add("shell", "contextchange", false, oEntry);

    //
    // Specify Resume Mode
    ss_shi_SetResumeMode(sResumeMode);

    //
    // Notify subscribers of a context change, to avoid submitting SmartIssues
    // or whatever unloading events might be unnecessary at this point.
    //
    ss_evt_SendByName(SS_EVT_SHELL_CONTEXT_CHANGE); // TODO – Decide if we payload oEntry.

    //
    // Orphan Debug Window
    //
    try {
    g_log_WinHandle.name = "";
    g_log_WinHandle.document.title = "Orphaned - " + g_log_WinHandle.document.title;
    } catch (e) {
    g_Logger.Warning("ss_shi_ContextChange", "Error Orphaning Debugger Window " + e.message);
    }

    //
    // Navigate the shell
    //
    try {
    ss_con_Navigate(sRemoteShellFull);
    } catch (e) {
    g_Logger.Error("ss_shi_ContextChange", "Error Navigating Shell " + e.message);
    throw(e);
    }

    return true;
    } catch (e) {
    g_Logger.Error("ss_shi_ContextChange", "Unexpected error " + e.message);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_IsPageAvailable
    **
    ** Purpose: Makes an HTTP Head to find if the url is available. Generally
    ** used in areas where application check a page on the server before
    ** moving to it
    **
    ** Parameter: sURL – Url to be checked
    ** iTimeout – Time out for head request
    **
    ** Return: true : available/ false: not available
    *******************************************************************************/
    function ss_shi_IsPageAvailable(sURL, iTimeout)
    {
    g_Logger.Info("ss_shi_IsPageAvailable", "Testing " + sURL);
    var bExists = false;
    try {
    if (sURL.indexOf("http";)==0)
    {
    var iTimeout = parseInt(iTimeout || ss_cfg_GetValue("global", "wg_detect_timeout", 5000));
    var iIterations = parseInt(ss_cfg_GetValue("global", "wg_httphead_attempts", "3";));
    for (var i=0; i<iIterations; i++)
    {
    g_Logger.Debug("ss_shi_IsPageAvailable", "Starting Test " + i);
    if (ss_con_HttpFileExists(sURL, iTimeout) == true) {
    g_Logger.Debug("ss_shi_IsPageAvailable", "Test Passed " + i);
    bExists = true;
    break;
    }
    else {
    g_Logger.Debug("ss_shi_IsPageAvailable", "Test Failed " + i);
    }
    }
    }
    else
    {
    //
    // TODO – Need to unescape some local paths?
    //
    var rx = new RegExp("file:\/\/\+([a-z]\:.*)","gi";);
    var sLocalUri = sURL.replace(rx, "$1";);
    var sLocalUri = sLocalUri.split("?";)[0];
    if (ss_con_FileExists(sLocalUri) == true) {
    bExists = true;
    }
    }
    } catch (e) {
    g_Logger.Error("ss_shi_IsPageAvailable", e.message);
    throw(e);
    }
    g_Logger.Debug("ss_shi_IsPageAvailable", "File Found? " + bExists);
    return bExists;
    }

    /*******************************************************************************
    ** Name: ss_shi_ReloadShell
    **
    ** Purpose: Reloads the shell, resuming with the given mode.
    **
    ** Parameter: sMode – (auto/prompt/none)
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_ReloadShell( sMode )
    {
    g_Logger.Info("ss_shi_ReloadShell";);
    try {
    ss_shi_SetResumeMode(sMode);
    ss_evt_SendByName(SS_EVT_SHELL_CONTEXT_CHANGE);
    location.reload(true);
    } catch (e) {
    g_Logger.Error("ss_shi_ReloadShell", e.message);
    throw(e);
    }
    }

    /*******************************************************************************
    ** Name: ss_shi_ReloadShellAuto
    **
    ** Purpose: Reloads the shell and resumes automatically.
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_ReloadShellAuto()
    {
    g_Logger.Info("ss_shi_ReloadShellAuto";);
    ss_shi_ReloadShell(SS_CUI_RESUMEMODE_AUTO);
    }

    /*******************************************************************************
    ** Name: ss_shi_ReloadShellAuto
    **
    ** Purpose: Reloads the shell and resumes by prompting the user.
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_ReloadShellPrompt()
    {
    g_Logger.Info("ss_shi_ReloadShellPrompt";);
    ss_shi_ReloadShell(SS_CUI_RESUMEMODE_PROMPT);
    }


    /*******************************************************************************
    ** Name: ss_shi_BusyStateCheck
    **
    ** Purpose: Query the busy state of the shell.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_BusyStateCheck( sSnapinName, sLogMsg )
    {
    sLogMsg = sLogMsg || "";
    sSnapinName = sSnapinName || "shell";
    g_Logger.Info("ss_shi_BusyStateCheck", sLogMsg);
    //ss_utl_LogCallStack(ss_shi_BusyStateCheck);

    try {
    return ! ss_shi_BusyEnd( sSnapinName, sLogMsg );
    } catch (e) {
    g_Logger.Error("ss_shi_BusyStateCheck", e.message);
    }
    }


    /*******************************************************************************
    ** Name: ss_shi_BusyStart
    **
    ** Purpose: Called by Snapin pages when their busy state is set to true.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_BusyStart( sSnapinName, sLogMsg )
    {
    sLogMsg = sLogMsg || "";
    sSnapinName = sSnapinName || "shell";
    g_Logger.Info("ss_shi_BusyStart", sLogMsg);
    //ss_utl_LogCallStack(arguments.callee);

    try {
    if (g_shi_pvt_ShellBusyTimer)
    clearTimeout(g_shi_pvt_ShellBusyTimer);

    var oEvent = ss_evt_Create(
    SS_EVT_SHELL_BUSY_START,
    "The shell is entering a busy state.",
    null
    );
    oEvent.SnapinName = sSnapinName;
    var Response = ss_evt_Send(oEvent);
    var bResponseOK = ! (Response in SENDMSG_STACKEND_MSGSET);

    if (bResponseOK) {
    ss_bn_DisableEnableShellButtons();
    ss_shi_DisableSnapinBarButtons();
    ss_ui_DisableHelp(true);
    g_Logger.Info("ss_shi_BusyStart", "Accepted " + sSnapinName);
    return true;
    } else {
    var fnBlocker = oEvent.blocker;
    var fnScope = fnBlocker.GetScope();
    var fnSig = ss_utl_GetFunctionSignature(fnBlocker);
    g_Logger.Info("ss_shi_BusyStart", "Canceled " + sSnapinName + " By " + fnScope + "::" + fnSig );
    return false;
    }
    } catch (e) {
    g_Logger.Error("ss_shi_BusyStart", e.message);
    throw(e);
    }
    return false;
    }


    /*******************************************************************************
    ** Name: ss_shi_BusyEnd
    **
    ** Purpose: Attempts to set the shell busy state to false. This will not
    ** occur if any snapin is currently Busy.
    **
    ** Parameter: none
    **
    ** Return: true/false - true indicating the busy state *MAY* be ended
    *******************************************************************************/
    function ss_shi_BusyEnd( sSnapinName, sLogMsg, sFromOnunload )
    {
    sLogMsg = sLogMsg || "";
    sSnapinName = sSnapinName || "shell";
    g_Logger.Info("ss_shi_BusyEnd", sLogMsg);
    //ss_utl_LogCallStack(arguments.callee);

    if (g_shi_pvt_ShellLoading == true)
    {
    g_Logger.Info("ss_shi_BusyEnd", "Canceled While Shell Loading";);
    return false;
    }

    try {
    try {
    var sTestSnapinName = "";
    for (var i=0; i<Snapins.OpenSnapins.length; i++) {
    sTestSnapinName = Snapins.OpenSnapins.name;
    var oSnapinWindow = ss_snp_GetWindow(sTestSnapinName);
    if (oSnapinWindow != null) {
    var bBusy = oSnapinWindow["g_pinc_pvt_PageBusy"] == true;
    if (bBusy) {
    g_Logger.Info("ss_shi_BusyEnd", "Canceled " + sSnapinName + " by " + sTestSnapinName + " being busy." );
    return false;
    }
    }
    }
    } catch (e) {
    g_Logger.Warning("ss_shi_BusyEnd", "Unexpected Error " + e.message);
    }

    var oEvent = ss_evt_Create(
    SS_EVT_SHELL_BUSY_END,
    "The shell is exiting a busy state.",
    null
    );
    oEvent.SnapinName = sSnapinName;
    var Response = ss_evt_Send(oEvent);
    bResponseOK = ! (Response in SENDMSG_STACKEND_MSGSET);

    if (bResponseOK) {
    if (g_shi_pvt_ShellBusyTimer)
    clearTimeout(g_shi_pvt_ShellBusyTimer);

    if (sFromOnunload) {
    ss_shi_BusyEndExec(sSnapinName,sLogMsg,true);
    } else {
    g_shi_pvt_ShellBusyTimer = setTimeout(function(){
    ss_shi_BusyEndExec(sSnapinName,sLogMsg,false)
    }, g_shi_pvt_BusyEndDelay);
    }

    ss_ui_DisableHelp(false);
    g_Logger.Info("ss_shi_BusyEnd", "Accepted Queued BusyEnd " + sSnapinName);
    return true;

    } else {
    var fnBlocker = oEvent.blocker;
    var fnScope = fnBlocker.GetScope();
    var fnSig = ss_utl_GetFunctionSignature(fnBlocker);
    g_Logger.Info("ss_shi_BusyEnd", "Canceled " + sSnapinName + " By " + fnScope + "::" + fnSig );
    return false;
    }
    } catch (e) {
    g_Logger.Error("ss_shi_BusyEnd", e.message);
    throw(e);
    }
    return false;
    }

    /*******************************************************************************
    ** Name: ss_shi_BusyEndExec
    **
    ** Purpose: Called by ss_shi_BusyEnd on a delayed timer, and will officially
    ** indicate we are no longer busy at the shell level.
    **
    ** Parameter: none
    **
    ** Return: true/false
    *******************************************************************************/
    function ss_shi_BusyEndExec( sSnapinName, sLogMsg )
    {
    sLogMsg = sLogMsg || "";
    sSnapinName = sSnapinName || "shell";
    g_Logger.Info("ss_shi_BusyEndExec", sLogMsg);
    //ss_utl_LogCallStack(arguments.callee);

    var bResponseOK = false;
    try {

    var oEvent = ss_evt_Create(
    SS_EVT_SHELL_BUSY_END,
    "The shell is exiting a busy state.",
    null
    );
    oEvent.SnapinName = sSnapinName;
    var Response = ss_evt_Send(oEvent);
    bResponseOK = ! (Response in SENDMSG_STACKEND_MSGSET);

    if ( bResponseOK ) {
    ss_bn_EnableDisableShellButtons();
    ss_shi_EnableSnapinBarButtons();
    ss_evt_SendByName(SS_EVT_SHELL_BUSY_END_COMPLETED);
    g_Logger.Info("ss_shi_BusyEndExec", "Executed For " + sSnapinName);
    return true;
    } else {
    var fnBlocker = oEvent.blocker;
    var fnScope = fnBlocker.GetScope();
    var fnSig = ss_utl_GetFunctionSignature(fnBlocker);
    g_Logger.Info("ss_shi_BusyEndExec", "Canceled " + sSnapinName + " By " + fnScope + "::" + fnSig );
    return false;
    }
    } catch (e) {
    g_Logger.Error("ss_shi_BusyEndExec", e.message);
    // no throw, is on timeout.
    }
    return false;
    }


    /*******************************************************************************
    ** Name: ss_shi_RestartEnvironment
    **
    ** Purpose: Stub for restarting the container.
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_RestartEnvironment()
    {
    g_Logger.Info("ss_shi_RestartEnvironment";);
    return ss_shi_ReloadShell();
    }

    /*******************************************************************************
    ** Name: ss_shi_GetBlankFilePath
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_GetBlankFilePath()
    {
    g_Logger.Info("ss_shi_GetBlankFilePath";);
    var sMacroPath = "%ROOTPATH%%COMMON%\\common\\snapins\\shell\\ss_blank.htm";
    var sExpanded = ss_cfg_ParseMacros(sMacroPath);
    return sExpanded;
    }

    /*******************************************************************************
    ** Name: ss_shi_GetDatabagDirectory
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_GetDatabagDirectory()
    {
    g_Logger.Info("ss_shi_GetDatabagDirectory";);
    try {
    var sDirUserServer = ss_con_GetContextValue("SdcContext:DirUserServer";);
    var sStateDatabags = sDirUserServer + "\\state\\databags\\";
    if (!(ss_con_FolderExists(sStateDatabags)))
    ss_con_CreateDir(sStateDatabags);

    return sStateDatabags;
    } catch (e) {
    g_Logger.Error("ss_shi_GetDatabagDirectory", e.message);
    throw(e);
    }
    return "";
    }

    /*******************************************************************************
    ** Name: ss_shi_GetQualifiedDataFileName
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_GetQualifiedDataFileName( sNamePart )
    {
    g_Logger.Info("ss_shi_GetQualifiedDataFileName";);
    try {
    // returns a fully qualified user-specific
    // if configured
    // product specific,
    // configuration-to-use specific
    // file name.
    var bUseProduct = ss_cfg_GetValue("global","save_data_useproduct","true";)=="true";
    var bUseConfig = ss_cfg_GetValue("global","save_data_useconfig","true";) =="true";
    var sBase = ss_shi_GetDatabagDirectory();
    if (bUseProduct) {
    var sProduct = ss_cfg_GetValue("global","product","";);
    if (sProduct)
    sBase += sProduct+".";
    }
    if (bUseConfig) {
    var sConfig = ss_cfg_ToUse();
    if (sConfig)
    sBase += sConfig+".";
    }
    if (sNamePart) {
    sBase += sNamePart;
    }
    return sBase;
    } catch (e) {
    g_Logger.Error("ss_shi_GetQualifiedDataFileName", e.message);
    throw(e);
    }
    return "";
    }

    /*******************************************************************************
    ** Name: ss_shi_State_StartSave
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_State_StartSave()
    {
    g_Logger.Info("ss_shi_State_StartSave";);
    ss_evt_SendByName(SS_EVT_CUI_STATE_SAVE);
    }

    /*******************************************************************************
    ** Name: ss_shi_State_StartRestore
    **
    ** Purpose:
    **
    ** Parameter: none
    **
    ** Return: none
    *******************************************************************************/
    function ss_shi_State_StartRestore()
    {
    g_Logger.Info("ss_shi_State_StartRestore";);
    /*
    Use selfupdate_force_new_location to determine if we should respect new SU package, if not, then contine
    to run from current location. (backward compatibility)

    If the package_version is set in registry than a Self Updater package was installed.
    Check the Self Updater path and necessary bcont files, if they exist change to that install path.

    If package requires a bcont restart (bcont_restart) then close current bcont, open new bcont, else
    we do a context change.
    */
    try {
    var bUseNewLoc = (ss_cfg_GetValue("global","selfupdate_force_new_location", "false";)=="true"?true:false);
    if(bUseNewLoc) {
    /*Get paths*/
    var sRoot = ss_cfg_ParseMacros("%ROOTPATH%";);
    var sProvider = ss_cfg_GetProviderID();
    var sProduct = ss_cfg_ParseMacros("%PRODUCT%";);
    var sDestDir = ss_con_ExpandSysMacro("%ProgramFiles%";) + sProvider + "\\";
    var sCommon = ss_cfg_ParseMacros("%COMMON%";);
    var sDestShell = sDestDir + sCommon + "\\common\\snapins\\shell\\ss_shell.htm";
    /*Get install and SU versions*/
    var sVersion = ss_cfg_GetMachineValue("global", "package_version";);
    var iVersion = Number((sVersion && sVersion != "undefined" && sVersion != undefined) ? sVersion : -1);
    var sCurVersion = ss_cfg_GetValue("global", "package_version";);
    var iCurVersion = Number((sCurVersion && sCurVersion != "undefined" && sCurVersion != undefined) ? sCurVersion : 0);







Beantwoord deze vraag

Dit is een gearchiveerde pagina. Antwoorden is niet meer mogelijk.