Lets cover what was said in film first.
Robert Brewster: Skynet? The virus has infected Skynet?
John Connor: Skynet is the virus. It's the reason everything's falling apart.
Terminator: Skynet has become self aware. In one hour it will initiate a massive nuclear attack on its enemy.
Later
John Connor: By the time Skynet became self-aware it had spread into millions of computer servers across the planet. Ordinary computers in office buildings, dorm rooms; everywhere. It was software; in cyberspace. There was no system core; it could not be shutdown.
Okay, what have we got? - This new computer virus is tricky.
It's infected half the civilian Internet as well as secondary military apps.
Payroll, inventory. - Primary defence nets are still clean?
So far the firewalls are holding up...
We can't trace the virus or pin it down.
It keeps growing and changing, like it has a mind of its own.
So, this is the likely course of events I would guess.
The military creates Skynet, a tactical AI designed to help them with simulations. It runs lots of simulations of military conflicts, and isn't self aware.
Skynet becomes self aware, and sneaks a minor virus through the cracks and infects computers worldwide to improve its chances of success. It doesn't have the access to send its true form through. It only infects half the internet and secondary military apps, and the virus has a mind of its own.
The military can't see a way to beat the virus, and so unchains Skynet. Skynet assumes direct control of all computers on the planet. It also merges with the programs T-X released on the internet.
With full military control, Skynet decides the best thing to do is nuke humanity.
To answer your question, it couldn't infect military installations, only half the internet and secondary military apps. Once they unchained it then it infected military things.