Yes, it is possible with a component, but it will take a little longer as there are more directories and files.
Create a folder on your desktop (e.g "gallery"), then copy the XML file from:
into your newly created folder.
Open the XML file and inside you will see something like:
So inside your gallery folder, create 2 sub-directories called "site" and "admin".
Now to copy the main component files.
ROOT/administrator/component/com_component and copy the entire contents (apart from the XML you copied before), into your "admin" directory
The go to
ROOT/component/com_component and copy the entire contents, into your "site" directory
Look again in your XML file and you will also see a reference to some language files, for example:
Looking at this example, you will now need make sure you have to following directory path created:
Once done, copy the 2 language files (from your server):
into the directory you create just a minute ago.
You will also need to repeat the same process for the admin language files, but of course ensuring they go in the "admin" directory instead.
Once all done, zip up the component and try installing it.
If there are any errors about missing files, have another look at the XML file and see if you've missed anything, such as media (CSS, JS etc)
Hope this helps