Mr. Olmert , who had been the acting prime minister since Ariel Sharon had a stroke in January , formally took office on Thursday and said he was prepared to set Israel 's boundaries during his government 's four-year term .