Many people are missing two points here.
1) The Viraat and its harriers were never meant to attack enemy shores and fight air battles with their air forces. They might be able to strike the shores of a nation with no credible air defence or air force, but that is not what the Indian navy had in mind when it purchased the Viraat, and it is not for that remote possibility that they operated an aircraft carrier at TREMENDOUS costs all these decades.
The role of the aircraft carrier for the Indian navy was always sea control, and naval superiority on the high seas. Any enemy naval fleet that operated without air cover would be decimated by the IN's air wing. The harriers carry potent anti ship missiles, and each one of these can sink one enemy ship. These aircrafts would do CAP of the IN's carrier fleet, and they would be able to detect, track and attack enemy ships long before the ships of either side can see or detect each other. So think about what a huge advantage an air cover gives to the IN, over a naval force that has no air cover. Despite the harriers being old in the tooth, two generations outdated, lacking any credible air to air capability, they can still fire anti ship missiles, and therefore can still fulfill the roles the In air arm played so far.
People look at the USN and its formidable array of super hornets with the ability to take on any air force, and assume that this is what our own air wing is intended for. It is not; taking the fight to enemy shores would have been near impossible for the harriers and viraat even when they were spanking new. The mig 29Ks and the Rafales-Ms and super hornets can do that, which is why in future the IN may be looking at such roles too. But their air arm will primarily be tasked with fleet defence.
In a USN task force, the aircraft carrier is the main weapon to fight war, while the accompanying ships mainly protect it. For IN, and most navies with a small air wing or medium sized carrier, it is the other way round - the carrier and its air wing protect the task force.
As I said though, with the introduction of potent multirole platforms like the mig 29K or Rafale-Ms (or whatever we choose for IAC-2), the navy may be looking at surprise ground attacks too. But it is the IAF that will be primarily tasked with that role.
2) Even if the viraat is old in the tooth, and lacks the punch it had in its hayday, it is still important to retain it in the navy and continue carrier operations, so that we don't lose the experience and skills gained in all these years. Even a gap of 3-4 years in conducting carrier operations can damage the continuity of our skill sets, which is what the British navy tried to point out when they put their carrier in cold storage for a few years. If a war breaks out, the Viraat may not participate in frontline battles at all; but still, carrying out carrier ops every day during peace time will ensure continuity of skills, which is why the navy is soldiering on with the grand old lady at great cost. These are very complicated skill sets - it is not just about pilot skills in taking off and landing on the moving carrier, but also the organizational and technical skills required to operate an airport-cum-city that moves in the high seas, and is expected to fire and be fired upon.
Watch any good documentary about the Viraat or other carrier operations, to know how many skill sets have to converge and work together for such a feat.