  It has been proposed that during the formation of the first generation stars
there might be a "dark star" phase in which the power of the star comes from
dark matter annihilation. The adiabatic contraction process to form the dark
star would result in a highly concentrated density profile of the host halo at
the same time, which may give enhanced indirect detection signals of dark
matter. In this work we investigate the extragalactic $\gamma$-ray background
from dark matter annihilation with such a dark star formation scenario, and
employ the isotropic $\gamma$-ray data from Fermi-LAT to constrain the model
parameters of dark matter. The results suffer from large uncertainties of both
the formation rate of the first generation stars and the subsequent evolution
effects of the host halos of the dark stars. We find, in the most optimistic
case for $\gamma$-ray production via dark matter annihilation, the expected
extragalactic $\gamma$-ray flux will be enhanced by 1-2 orders of magnitude. In
such a case, the annihilation cross section of the supersymmetric dark matter
can be constrained to the thermal production level, and the leptonic dark
matter model which is proposed to explain the positron/electron excesses can be
well excluded. Conversely, if the positron/electron excesses are of a dark
matter annihilation origin, then the early Universe environment is such that no
dark star can form.
