iTunes and apps question

My home system died and I had to reformat and reinstall the OS. I downloaded iTunes again and of course all of my apps are gone. If I try to sync my phone, it says that all of my apps on the phone will be replaced by the ones on my computer (i.e. I lose all of my apps on my phone too).

I know that I can go into the App Store and redownload the apps one by one for free, but is there a way to do a mass download from the app store of all of the apps that I have bought in the past?

One more question, I had to reauthorize my computer after I rebuilt it. Before that, I authorized two others (work and the previous rendition of my current one). I no longer have the previous two computers. Is there a way that I can deauthorize them without being able to log into iTunes on them?

You can deauthorize all of your computers at the same time, once per year. IIRC you might have to have reached the limit of 5 before they’ll let you do it. Authorize or deauthorize your computer for iTunes Store purchases - Apple Support

As for the other issue, I’m not aware of any way to mass download apps. Usually if I have music or apps on my phone that aren’t on the computer, it asks if I want to copy them in. Maybe that doesn’t work if you don’t already have that device configured in your iTunes. Yet another reason to keep backups, I guess. Buy a USB hard drive (they’re available for well under $100) and use Time Machine, so this doesn’t happen again.

Click “Cancel” when it offers to sync, then select the phone in the list on the left, right-click, and select “Transfer purchases” to move the apps to the computer. Might be slightly different on Windows. Connect iTunes to your account again before you do this, if you haven’t already.