Abstract
We simulate the evolution of the circumstellar medium around a massive star. We take the relevant input parameters for our simulation from a stellar evolution calculation: mass loss rate, wind velocity and the number of ionizing photons as a function of time. By pursuing the calculation through the various stages of massive star evolution, using a realistic mass loss history as input, we simulate the creation and evolution of a wind-blown bubble around the star up to the time of the supernova explosion. Unlike most previous work on this subject, we include the effects of photo-ionization. From our calculations we can conclude that photo-ionization affects both the size and mass-distribution of the circumstellar bubble during the main sequence and red supergiant stage.