Just been reading the Art of Rigging books from CGToolkit. In there the show how to rig a spring using a wire deformer through the centre of the spring. This allows the spring to deform with changing its coil diameter.
You should be able to use the same idea for the accordion and connect a set of staight line joints(through C/line) to the wire deformer. Then set up some utility nodes to calculate total length of joint chain and divide this by number of joints and plug this into the scale of each joint (usually X axis).
Using utility nodes is the best option as an expression has to be evaluated each frame where as utility nodes are a direct connection.
Visit Joe Harkins website for a set of scripts to help set up the above joint chain.
Joe Harkin's web site.