etc/config/windows/projectdef.js
// freedte - if undefined or true then free dte inside function
if undefined or true then free dte inside function
if undefined or true then free dte inside function
function InitVSObjects(config, freedte)
{
    getCompilerOpts(config);
    try
    {
        dte = WScript.CreateObject("VisualStudio.DTE." + VERSION);
        if (DEVENV == "")
        {
            var comName = dte.FullName.replace(/\.exe$/i, ".com");
            DEVENV = fso.FileExists(comName) ? comName : dte.FullName;
        }
    }
    catch (e) {}
    if (CONVERT)
    {
        if (ICCCONVERT == "")
            ICCCONVERT = "ICProjConvert90.exe";
        var ICConvertTool = ICCCONVERT;
        var arrPath = new Array(ICConvertTool);
        if (0 > ICConvertTool.indexOf("\\"))
        {
            if (null != dte)
            {
                try
                {
                    var isettings = dte.GetObject("IntelOptions");
                    for (var i = 1; i <= isettings.CompilersCount; ++i)
                    {
                        var paths = isettings.Compiler(i).ExecutablePath.split(";");
                        for (var j = 0; j < paths.length; ++j)
                            arrPath.push("\"" + isettings.Evaluate(paths[j]) + "\\" + ICConvertTool + "\"");
                    }
                    isettings = null;
                }
                catch (e) {}
            }
        }
        var success = false;
        for (var i = 0; i < arrPath.length; ++i)
            if (TestUtil(arrPath[i]))
            {
                success = true;
                ICCCONVERT = arrPath[i];
                break;
            }
        if (!success)
        {
            WScript.StdErr.WriteLine(ICCCONVERT + " conversion utility not found");
            WScript.StdErr.WriteLine("You should check ICCCONVERT configuration variable");
            WScript.Quit(3);
        }
    }
    if (("undefined" == typeof(freedte) || true == freedte) && (null != dte))
    {
        dte.Quit();
        dte = null;
    }
    try
    {
        VCProjectEngine = WScript.CreateObject("VisualStudio.VCProjectEngine." + VERSION);
    }
    catch (e)
    {
        WScript.StdErr.WriteLine("Unable to create VCProjectEngine object: " + e.message);
        return false;
    }
    return true;
}
function InitVSObjects ( config , freedte ) { getCompilerOpts ( config ) ; try { dte = WScript . CreateObject ( "VisualStudio.DTE." + VERSION ) ; if ( DEVENV == "" ) { var comName = dte . FullName . replace ( / \.exe$ / i , ".com" ) ; DEVENV = fso . FileExists ( comName ) ? comName : dte . FullName ; } } catch ( e ) { } if ( CONVERT ) { if ( ICCCONVERT == "" ) ICCCONVERT = "ICProjConvert90.exe" ; var ICConvertTool = ICCCONVERT ; var arrPath = new Array ( ICConvertTool ) ; if ( 0 > ICConvertTool . indexOf ( "\\" ) ) { if ( null != dte ) { try { var isettings = dte . GetObject ( "IntelOptions" ) ; for ( var i = 1 ; i <= isettings . CompilersCount ; ++ i ) { var paths = isettings . Compiler ( i ) . ExecutablePath . split ( ";" ) ; for ( var j = 0 ; j < paths . length ; ++ j ) arrPath . push ( "\"" + isettings . Evaluate ( paths [ j ] ) + "\\" + ICConvertTool + "\"" ) ; } isettings = null ; } catch ( e ) { } } } var success = false ; for ( var i = 0 ; i < arrPath . length ; ++ i ) if ( TestUtil ( arrPath [ i ] ) ) { success = true ; ICCCONVERT = arrPath [ i ] ; break ; } if ( ! success ) { WScript . StdErr . WriteLine ( ICCCONVERT + " conversion utility not found" ) ; WScript . StdErr . WriteLine ( "You should check ICCCONVERT configuration variable" ) ; WScript . Quit ( 3 ) ; } } if ( ( "undefined" == typeof ( freedte ) || true == freedte ) && ( null != dte ) ) { dte . Quit ( ) ; dte = null ; } try { VCProjectEngine = WScript . CreateObject ( "VisualStudio.VCProjectEngine." + VERSION ) ; } catch ( e ) { WScript . StdErr . WriteLine ( "Unable to create VCProjectEngine object: " + e . message ) ; return false ; } return true ; }
freedte - if undefined or true then free dte inside function
freedte - if undefined or true then free dte inside function
// use devenv.com executable, if it present // no file path specified // try to detect the path