Helium in nanoporous media has attracted much interest as a model Bose system with disorder and confinement. Here we have examined how a change in porous structure by preplating a monolayer of krypton affects the superfluid properties of $^4$He adsorbed or confined in a nanoporous Gelsil glass, which has a three-dimensional interconnected network of nanopores of 5.8 nm in diameter. Isotherms of adsorption and desorption of nitrogen show that monolayer preplating of Kr decreases the effective pore diameter to 4.7 nm and broadens the pore size distribution by about eight times from the sharp distribution of the bare Gelsil sample. The superfluid properties were studied by a torsional oscillator for adsorbed film states and pressurized liquid states, both before and after the monolayer Kr preplating. In the film states, both the superfluid transition temperature $T_{mathrm c}$ and the superfluid density decrease about 10 percent by Kr preplating. The suppression of film superfluidity is attributed to the quantum localization of $^4$He atoms by the randomness in the substrate potential, which is caused by the preplating--induced broadening of the pore size distribution. In the pressurized liquid states, the superfluid density $rho_{mathrm s}$ is found to increase by 10 percent by Kr preplating, whereas $T_{mathrm c}$ is decreased by 2 percent at all pressures. The unexpected enhancement of $rho_{mathrm s}$ might indicate the existence of an unknown disorder effect for confined $^4$He.