/* manifest.js - Writes a custom XML manifest for each executable/library 6 command line options must be supplied: name - Name of the executable/library into which the mainfest will be embedded. version - Version of the executable arch - Architecture intended. type - Application type. exe_level - Application execution level. [asInvoker|highestAvailable|requireAdministrator] outfile - Final destination where mainfest will be written. Example: cscript manifest.js name=mysql version=5.0.32 arch=X86 type=win32 exe_level=asInvoker outfile=out.xml */ try { var args = WScript.Arguments for (i=0; i < args.Count(); i++) { var parts = args.Item(i).split('='); switch (parts[0]) { case "name": var app_name= parts[1]; break; case "version": var app_version= parts[1]; break; case "arch": var app_arch= parts[1]; break; case "type": var app_type= parts[1]; break; case "exe_level": var app_exe_level= parts[1]; break; case "outfile": var manifest_file= parts[1]; break; default: WScript.echo("Invalid argument supplied."); } } if (i != 6) throw new Error(1, "Incorrect number of arguments."); var manifest_xml= "\r\n"; manifest_xml+= "\r\n"; // Identify the application security requirements. manifest_xml+= "\t\r\n"; manifest_xml+= "\t\t\r\n\t\t\t\r\n\t\t\t\t"; manifest_xml+= "