Its easy to do on the 3ds all you need is GodMode9.
1. Launch GodMode9 by holding (Start) during boot
2. Select User Installed Title: [A:] SYSNAND SD
3. Hold (R) and press (A) at the same time to open the drive options
4. Select “Search for titles”
5. Press (A) to continue
6. Press (A) on the .tmd file to select it, then select “TMD file options…”, then select “Build CIA (standard)”
7. Your installable .cia formatted file will be outputted to the /gm9/out/ folder on your SD card