How do you install a hub dynamo?
Briefly:

1) yes, you can re-use the existing rim.

2) yes, you could shorten the existing spokes, but that would be expensive and foolish.

3) The installation is the same except now you have wires so you need to plug them into the hub too.

The main issue is (2). Spokes are usually only reused when the rim is being replaced with an identical rim (usually a new one for a worn one), and even then most wheelbuilders will prefer new spokes. Spokes bend a little as they're built into the wheel, and getting those bends in exactly the right place when you rebuild the wheel is effectively impossible. So you'll build the wheel, ride it a little, the spokes will bend back and you'll have to re-tension everything. Usually more than once. If you're paying someone to do this it's cheaper to just buy new spokes.

It's possible to shorten spokes, there are spoke cutting tools for this. They're normally used to make really short spokes (for putting a dyno hub into a 16" wheel, for example) but these days it's possible to buy spokes online in almost any size. But you could sit there and shorten all the spokes in your wheel. But again, if you're paying someone else to do this for you it will be more expensive than a new set of spokes. The tool is also much more expensive than a set of spokes.

If your rim is in good condition that's the bit to keep. If it is worthwhile, you may be better off selling the whole wheel and buying a new rim anyway.