Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using a startup script to deploy Microsoft Office 2007 Standard. It's not working quite right and I'm trying to find logging information for it. Unfortunately, no log is being generated by setup. I've tried configuring the log at %temp%\, C:\, %systemroot%\temp and leaving it at defaults, all to no avail. Nothing is showing up in the event logs, either. Is there anywhere else I can go to look for information on what's going on with the installer?

Edit: Here is the script that I'm currently running:

// WSH System Objects
var shell = new ActiveXObject("WScript.Shell");
var fso = new ActiveXObject("Scripting.FileSystemObject")
var env = shell.Environment("Process");

// Well Known Constants
var EVENT_SUCCESS = 0;
var EVENT_ERROR = 1;
var EVENT_WARNING = 2;
var EVENT_INFORMATION = 4;
var EVENT_AUDIT_SUCCESS = 8;
var EVENT_AUDIT_FAILURE = 16;

// Custom Constants
var MESSAGE_DEPLOYMENT_START = "Outlook deployment started.";
var MESSAGE_ALREADY_DEPLOYED = "Deployment halted. Outlook already deployed at ";
var MESSAGE_ERROR_UNKOWN_GUID = "Deployment halted. An unknown Office product GUID has been detected.";
var MESSAGE_SETUP_STANDARD = "Initializing setup for Office12 Standard Edition. See Install log at " + env("TEMP") + "\\SetupExe(*).log";
var MESSAGE_SETUP_PROPLUS = "Initializing setup for Office12 Professional Plus. See install log at " + env("TEMP") + "\\SetupExe(*).log";
var MESSAGE_OFFICE_NOT_DETECTED = "Office was not detected; deployment aborted.";
var MESSAGE_OFFICE_VERSION_NOT_DETECTED = "Office version could not be detected; deployment aborted.";
var MESSAGE_UNKNOWN_ERROR = "An unknown error has occurred: ";
var MESSAGE_UNKNOWN_GUID = "Detected an unknown GUID";
var ECODE_CANNOT_READ_VALUE = 2;
var REG_OFFICE12_64 = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Office\\12.0\\";
var REG_OFFICE12_32 = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Office\\12.0\\";
var REG_OFFICE12_REGISTRATION = "Registration";
var REG_OUTLOOK_INSTALL_LOCATION = "InstallRoot\\Path";
var DEPLOYMENT_SOURCE_STANDARD = "\"\\\\netapps\\apps\\Microsoft\\Office 2007 Standard\"";
var CONFIG_PATH_STANDARD = "\"\\\\netapps\\apps\\Microsoft\\Office 2007 Standard\\Config.xml\"";
var DEPLOYMENT_SOURCE_PROPLUS = "\"\\\\netapps\\apps\\Microsoft\\Office 2007 Professional Plus\"";
var CONFIG_PATH_PROPLUS = "\"\\\\netapps\\apps\\Microsoft\\Office 2007 Professional Plus\\Config.xml\"";
var OFFICE12_STANDARD_GUID = "{90120000-0012-0000-0000-0000000FF1CE}";
var OFFICE12_PROPLUS_GUID = "{90120000-0011-0000-0000-0000000FF1CE}";

// Log start of script.
messageEnvironmentSettings = "Environment Settings: \n";
messageEnvironmentSettings += "%TEMP%: " + env("TEMP") + "\n";
messageEnvironmentSettings += "%SYSTEMROOT%: " + env("SYSTEMROOT") + "\n";
messageEnvironmentSettings += "%WINDIR%: " + env("WINDIR") + "\n";

shell.LogEvent(EVENT_INFORMATION, MESSAGE_DEPLOYMENT_START + "\n\n" + messageEnvironmentSettings);


//***************** Get root Office registry key.**************
var regOfficeRoot;

try
{
    shell.RegRead(REG_OFFICE12_64);
    regOfficeRoot = REG_OFFICE12_64;
}
catch (e)
{
    if ((e.number & 0xFFFF) == ECODE_CANNOT_READ_VALUE)
    {
        try 
        {
            shell.RegRead(REG_OFFICE12_32);
            regOfficeRoot = REG_OFFICE12_32;
        }       
        catch (e2)
        {
            if ((e2.number & 0xFFFF) == ECODE_CANNOT_READ_VALUE)
            {
                // Office is not installed. Log and quit.
                shell.LogEvent(EVENT_INFORMATION, MESSAGE_OFFICE_NOT_DETECTED);
                WScript.Quit(0);
            }
            else
            {
                shell.LogEvent(EVENT_ERROR, MESSAGE_UNKNOWN_ERROR + e2.message);
            }
        }
    }
    else
    {
        shell.LogEvent(EVENT_ERROR, MESSAGE_UNKNOWN_ERROR + e.message);
    }
}

//************************ Find out if Outlook is installed.*******************************
try
{
    var outlookInstallationLocation = shell.RegRead(regOfficeRoot + "Outlook\\" + REG_OUTLOOK_INSTALL_LOCATION);

    // Log and exit.
    shell.LogEvent(EVENT_INFORMATION, MESSAGE_ALREADY_DEPLOYED + "\"" + outlookInstallationLocation + "\"" );
    WScript.Quit(0);
}
catch (e)
{
    if ((e.number & 0xFFFF) == 2)
    {
        // Key didn't exist; Outlook is not installed. Supress registry read error.
    }
    else
    {
        shell.LogEvent(EVENT_ERROR, MESSAGE_UNKNOWN_ERROR + e.message);
    }
}




//***************** Discover version of office installed.**************
var detectedOfficeGuid;
try
{
    shell.RegRead(regOfficeRoot + "Registration\\" + OFFICE12_STANDARD_GUID + "\\");
    detectedOfficeGuid = OFFICE12_STANDARD_GUID;
}
catch (e)
{

    if ((e.number & 0xFFFF) == ECODE_CANNOT_READ_VALUE)
    {
        try
        {
            shell.RegRead(regOfficeRoot + "Registration\\" + OFFICE12_PROPLUS_GUID + "\\");
            detectedOfficeGuid = OFFICE12_PROPLUS_GUID;
        }
        catch (e)
        {
            shell.LogEvent(EVENT_ERROR, MESSAGE_OFFICE_VERSION_NOT_DETECTED);
            WScript.Quit(1);
        }
    }
    else
    {
        shell.LogEvent(EVENT_ERROR, MESSAGE_UNKNOWN_ERROR + e.message);
    }
}


//************************* Installation ******************************

if (detectedOfficeGuid == OFFICE12_STANDARD_GUID)
{
    var messageSetup = MESSAGE_SETUP_STANDARD;
    var deploymentCommand = DEPLOYMENT_SOURCE_STANDARD + "\\setup.exe /config " + CONFIG_PATH_STANDARD;
}
else if (detectedOfficeGuid = OFFICE12_PROPLUS_GUID)
{
    var messageSetup = MESSAGE_SETUP_PROPLUS;
    var deploymentCommand = DEPLOYMENT_SOURCE_STANDARD + "\\setup.exe /config " + CONFIG_PATH_STANDARD;
}
else
{
    shell.LogEvent(EVENT_ERROR, MESSAGE_ERROR_UNKNOWN_GUID);
    WScript.Quit(1);
}

shell.LogEvent(EVENT_INFORMATION, messageSetup + "\n" + deploymentCommand);
var setupExec = shell.exec(deploymentCommand);

shell.LogEvent(EVENT_INFORMATION, "Exit Code: " + setupExec.ExitCode);
share|improve this question
    
why don't you post your install script and maybe someone can figure out why it isn't logging? –  August Jun 15 '12 at 14:42
    
Perhaps you would like to add some sort of logging within the install script to verify whether it's running in the first place. –  Hyppy Jun 15 '12 at 15:47
    
I've added the script. –  bshacklett Jun 15 '12 at 16:52
    
I'm getting data from Process Monitor that makes it look like the script is dying before Setup.exe can do its thing. I'm working on forcing it to block. –  bshacklett Jun 15 '12 at 17:54

1 Answer 1

up vote 0 down vote accepted

Well, I've found the problem. The setup executable was being terminated by Windows before it could do much of anything, which made things quite confusing. It seemed like the installer was just not doing its job correctly.

It seems that the setup executable was being called asynchronously and Windows was not waiting for it to finish before continuing the boot process. The following code appears to have resolved the problem:

while ( setupExec.Status == 0 )
{
    WScript.sleep(1000);
}

I added this loop directly after the setup executable is called. It checks the status of the running process, then sleeps for one second until the process exits on its own. This ensures that the installer actually gets to do what it wants to do.

share|improve this answer
    
I'll refrain from choosing my answer for a while just in case someone else has a better idea of how to resolve the problem. –  bshacklett Jun 15 '12 at 19:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.