It does indeed depend on the frame. Older Trek bonded Al frames did NOT have a cable guide inside the top tube and if you pulled both the housing and cable out, you faced a fishing expedition to replace them.
I recommend pulling out ONLY the housing at first. Then thread the new housing back into the frame using the inner cable as a guide. Finally, replace the inner cable. This is the safest approach whether there is or is not an internal guide tube.