Normally you do that when you distribute your app.
Its done by the installation program that you use.

could you be more specific ?