INDIANAPOLIS — Senator Ted Cruz of Texas, desperate to alter the course of a presidential primary fight in which Donald J. Trump is closing in on victory, announced Wednesday that Carly Fiorina would be his running mate if he won the Republican nomination.

The move, a day after Mr. Trump scored unexpectedly wide victory margins in sweeping five East Coast states, amounted to the grandest diversionary tactic a presidential candidate can stage — or at least the grandest one available to a candidate trailing by about 400 delegates who failed to win more than 25 percent of the vote in any state on Tuesday.

Taking the stage after 4 p.m. before a modest but spirited crowd in a cavernous pavilion here, Mr. Cruz described Mrs. Fiorina, the former presidential candidate and Hewlett-Packard chief executive, as “brilliant and capable” and deeply principled, and praised her for having “shattered glass ceilings.”

Mr. Cruz’s criteria for a pick, in his telling, seemed to be aimed squarely at Mr. Trump. “Do they think through decisions in a rash and impulsive way?” he asked. “Do they pop off the handle at whatever strikes them at any given moment?” He held up Mrs. Fiorina as someone who knows “where jobs come from.”