Royal melts from moisture, not from sun or it's heat. But you've got other issues that will ruin things......the sun is the worst problem.
The sun is o.k. on royal, but you can't use any food colors in it, all the color will bleach out from the sun. At the most you might get 1 month out of the color before it fades. Royal make from real egg whites might turn yellow instead of a bright white as it bleaches out, so instant meringue will give you a better white.
You could also try make the frosting part out of fondant/gumpaste, but it will fade in color also.
On top of the frosting issues, you need to use styrofoam as your cupcakes because real cupcakes can shrivel as they harden.
Really the only thing that is going to hold up is using the permaice over styro.. I don't know where you'll find fake cupcake styro's that fit nicely into liners/wrappers. You'll have to use cupcake wraps instead of liners and hand bevel the sides. I do think I might have seen large cupcake styro dummies......but I don't recall where.