<?xml version="1.0" encoding="Shift_JIS"?>
<job>
    <script language="JScript">
        <![CDATA[
// This script sets NITROVIEWER_ROOT and starts the Viewer's SRL file.
// The NITROVIEWER_ROOT environment variable is required to use NITRO-CHARACTER.

var envKind = /*"SYSTEM"*/"USER";
var strViewerRoot = "NITROVIEWER_ROOT";

var wsh = WScript.CreateObject("WScript.Shell");
var fso = WScript.CreateObject("Scripting.FileSystemObject");

var strViewerRootPath = fso.GetParentFolderName(fso.GetParentFolderName(WScript.ScriptFullName));


wsh.Environment(envKind).item(strViewerRoot) = strViewerRootPath;

// WScript.Echo("environment varialble" + strViewerRoot + "to\"" + strViewerRootPath + "\".");

var objArgs = WScript.Arguments;

var commandLine = "%TWLSYSTEM_ROOT%\\tools\\NitroViewer\\controller\\nvctlr.exe";

for ( var i = 0; i < objArgs.Count(); i++ )
{
  commandLine += " " +  objArgs.Item( i );
}

wsh.Exec( commandLine );

        ]]>
    </script>
</job>
