A Ginzburg-Landau theory is presented for a superconductor that can also sustain a weakly first-order structural phase transition. The distortion and the superconducting order parameters are coupled so that the distorted system tends to favor superconductivity. The equations are solved for a variety of situations. It is found that for some range of the parameters a distorted, superconducting equilibrium bulk could have, when superconductivity is locally destroyed (e.g., by the presence of a magnetic field), an undistorted surface layer, discontinuously superimposed on the bulk; and that for a different range of parameters a nonsuperconducting, undistorted equilibrium bulk can sustain surface superconductivity in the presence of a local, surface distortion. The discontinuous changes in the distortion parameter introduce, in effect, an additional coherence length, not calculable from dimensional arguments. The theory could be applicable to the new ceramic high-temperature superconductors, and may perhaps serve as a basis for the description of the appearance and disappearance, repeatedly observed, of nonequilibrium very-high-temperature superconductivity in some oxides.