Jump to content


ashu.techit

Established Members
  • Posts

    1
  • Joined

  • Last visited

Posts posted by ashu.techit

  1. Hello All,
    My task is to trigger the HTA during windows installation and showcase the static screens while the installation continues in the background.
    Now the issue I'm facing is to trigger the HTA to appear on screen.

    I'm tying to test my sample HTA file but during installation startup, all I'm seeing is "a blank white window".

    Below is the code of my HTA file:

    <html>

    <head>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

    <style>
    .fullbackground{
    position:relative;
    width:100%; /* alternative: right:0; */
    height:100%; /* alternative: bottom:0; */
    }
    img.fullbackground{
    position:absolute;
    z-index:-1;
    top:0;
    left:0;
    width:100%; /* alternative: right:0; */
    height:100%; /* alternative: bottom:0; */
    }

    .messageSection { position: absolute; width: 100%; }



    .mainbody,
    .header,
    .footer {
    padding: 5px;
    }
    .mainbody {
    margin-top: 25px;
    min-height: 150px;
    max-height: 388px;
    overflow: auto;
    }
    .messagePara { font-family: Calibri; font-size: 16pt; font-weight: bold; color: #FFFFFF; text-align: center; margin-left:20%; margin-right:20%; margin-bottom:20%;}

    .header {

    margin: auto;
    width: 60%;

    padding: 10px;
    text-align:left;
    color: #FFFFFF; font-family: Calibri; font-size: 14pt; font-weight: bold; margin-top:30px;


    }
    .footer {
    height: 40px;

    font-family: Calibri; font-size: 11pt; font-weight: bold; color: #FFFFFF; text-align: center; position: absolute; width:100%; bottom:0; left:0;
    }

    </style>

    <HTA:APPLICATION ID="oHTA"
    BORDER="none"
    CAPTION="no"
    CONTEXTMENU="no"
    Icon="autorun.ico"
    INNERBORDER="no"
    NAVIGABLE="yes"
    SCROLL="no"/>

    <script language="javascript">

    var __TITLE_VAR_TEXT = "Sample Title";
    var __COPYRIGHT_VAR_TEXT = "Sample Footer";
    var __MESSAGE_DISC_VAR_TEXT = "Sample Message";
    var __LINKBODYBACKGROUND_VAR_TEXT = "shuttle6b.jpg"; //background image

    var splashWindowWidth = 637;
    var splashWindowHeight = 479;


    if (window.screen)
    {

    splashWindowLeft = (window.screen.availWidth - splashWindowWidth) / 2;
    splashWindowTop = (window.screen.availHeight - splashWindowHeight) / 2;
    }

    try
    {

    window.moveTo(splashWindowLeft, splashWindowTop);
    window.resizeTo(splashWindowWidth, splashWindowHeight);
    }
    catch(e){}



    function windowOnLoad()
    {
    maxWindow();
    document.title = __MESSAGE_DISC_VAR_TEXT;

    document.getElementById("image").src=__LINKBODYBACKGROUND_VAR_TEXT;

    window.setTimeout("closeScreen()",5000);

    }

    function closeScreen()
    {
    self.close();
    }



    function maxWindow()
    {
    window.moveTo(0,0);

    if (document.all)
    {
    top.window.resizeTo(screen.availWidth,screen.availHeight);
    }

    else if (document.layers||document.getElementById)
    {
    if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
    {
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
    }
    }
    }

    </script>
    </head>

    <body style="text-align: center; " onload="windowOnLoad()">
    <div class="fullbackground">
    <img id="image" class="fullbackground" />
    <div class="header"> <script language="javascript">document.write(__TITLE_VAR_TEXT);</script></div>
    <div class="mainbody">
    <p id="messagePara" class="messagePara">
    <script language="javascript">document.write(__MESSAGE_DISC_VAR_TEXT);</script>
    </p>
    </div>
    <div class="footer"> <script language="javascript">document.write(__COPYRIGHT_VAR_TEXT); </script></div>
    </div>
    </body>

    </html>

    I've updated the required INI file with the following entries:-

    [sample]
    type = command
    Caption=UI
    Reboot=No
    CommandLine="mshta.exe %programfiles%\Folder_1\

    Folder_2\Folder_3\Folder_4\Sample.hta"

    I've referred the below URLs :-

    http://www.windows-noob.com/forums/topic/5968-hta-blank-screen/

    http://blogs.msdn.com/b/joelschoenberg/archive/2008/08/18/maintenance-booting-your-windows-machines.aspx

    But none of the options worked.

    I also tried with passing the HTA file in arguments as mentioned below:-

    CommandLine=mshta.exe
    Arguments="%programfiles%\Folder_1\Folder_2\Folder_3\Folder_4\Sample.hta"

    but it didn't worked.

    NOTE: I've also used the direct path of "Sample.hta" file but it still didn't show up.

    Before installation, I've tried pressing F8 key and running the HTA using mshta.exe and that works completely fine.

    Can anyone please share some suggestions of how to execute this "HTA" from INI file and the correct commandLine value ?

    Thanks in advance.
    cleardot.gif
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.