function Component()
{
	if (installer.isInstaller()){
		var product_id;
		if(installer.value("prog_x86",false)=="true") 
			product_id = "F18EFAF01E2120E498FA3D78D6AB5888";
		else
			product_id = "FF71470E888E846478C8372ED5465DD0";
		var tsvn_version = installer.execute("reg", new Array("QUERY", "HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Installer\\Products\\"+product_id, "/v", "Version"))[0];
		if (tsvn_version){
			var elements = tsvn_version.split(" ");
			if (parseInt(elements[elements.length-1]) >= 0x4f0000) {
				component.setValue("Default",false);
				component.setValue("ForcedInstallation",false);
				component.setValue("Description","Программа уже установлена");
				component.enabled = false;
			}
		}
	}

}

Component.prototype.createOperations = function()
{
    // call default implementation to actually install the registeredfile
    component.createOperations();
	var inst_file;
    if(installer.value("prog_x86",false)=="true") {
    //x86
		inst_file = "putty-0.79-installer.msi";
	} else {
		inst_file = "putty-64bit-0.79-installer.msi";
	}
    var native_path=installer.toNativeSeparators(installer.value("TargetDir")+"/"+inst_file);
    if (component.enabled)
        component.addOperation("Execute","msiexec","/i",native_path);
    component.addOperation("Delete",native_path);
}
