xda-developers.com
forum.xda-developers.com
wiki.xda-developers.com Wiki HomePage
FAQ | Xanadux

RecentChanges | FindPage | | LikePages | BackLinks

OEM Package Tutorial

Preface

This wiki page was created by _Alex_ and is actively maintained by him. If If you have any questions or comments before, during or after reading this wiki entry, or just want to say 'thanks', please reply to this thread. Before you do reply, you may want to save yourself some time by reading the FAQ section below.

On the hunt for new ingredients?

So, you've exhausted all your existing options with the 300+ OEM packages found within my consolidated Pandora/PPCGeeks/Alex OEM Package kit and you're interested in making new ingredients? Well look no further, as this guide will not only tell you what to look for but how to put it together, so you too can create OEM packages.

Target Audience

Before we begin, please make sure that you've installed oodles of CABs, have to take off your shoes to count how many ROMs you've flashed and have also made some interesting creations in the kitchen too. If you haven't gotten that far, you might want to try doing all three before continuing to read...

Disclaimer

Please understand that I or the others who contribute to this page take NO RESPONSIBILITY in the actions you take before, during or after you read this, nor are we responsible for any damage or loss that may occur by following any of the steps mentioned within this document. We are also not responsible for any actions or damages that occur due to typos or errors in transmission. By continuing to read this, you acknowledge that any actions you take are your own and you assume full responsibility for those actions. PROCEED WITH CAUTION!


Primer

An OEM package, which you should be familiar with by now, is very much like a CAB file. This method of application deployment is used only within a cooked ROM. Assuming that you've done your fair share of cabs,flashing and cooking, we'll skip straight to the important stuff. So you've taken a look into an OEM package folder and you've wondered what are all these files??? Here's the layout:

Strange alphanumeric sequences?!?!

What the heck is f7af6a61-da7b-42d5-988c-628140c997a1.dsm??? Well, each OEM package uses a Universal Unique Identifier (UUID) to identify itself. This UUID is used in up to three distinct places within an OEM package. In this tutorial, we'll rely upon Ervius' Package creator to generate one for us.

Make sure to use the same UUID within a single OEM package and do not use multiple UUIDs in a single OEM Package or ?BuildOS will puke!!!

So what's a .dsm?

UUID.dsm contains a file listing of all the files within an OEM package. For regular folks, it is not necessary to generate a .dsm as ?BuildOS will generate one for you.

However, if you want your cooked ROM to be extractable with a package tool (too advanced for this tutorial), you will need to generate a .DSM file. You can use buildDSM.exe by Nandlal_mk (Thanks Custel).

So what's a .rgu?

UUID.rgu is where the registry information is contained for the OEM package. All Microsoft Operating Systems since Windows 95 use the Windows Registry to hold important application information and Windows Mobile is no different.

.rgu files are formatted exactly like .reg files which can be exported from programs such as SOTI Pocket Controller Pro, PHM ?RegEdit and SKTools. If you have .reg files, you can simply change the extension from .reg to .rgu. Please note that version of ?BuildOS used in the Kaiser ROM kitchen is case sensitive and will freak out if you name the file .RGU, so don't and avoid a future headache :)

If your package does not require registry information, then you do not need to include an rgu file within your OEM package.

So what's INITFLASHFILES.TXT?

This file is used by the ?BuildOS package tool for file copy operations & directory creation. By default, all files within an OEM package go into \Windows. If you want any of your files to be copied elsewhere, specify it in this file. If you want everything in \Windows, then you won't need an INITFLASHFILES.TXT file either.

Here is a sample INITFLASHFILES.TXT and a brief explanation of each line:

  • Directory("\Program Files\"):-Directory("?MusicID")

    • Create a folder named ?MusicID in \Program files

Directory("\Program Files\?MusicID"):-File("MUSICID.EXE","\windows\000-MUSICID.EXE") ** In the directory \Program Files\?MusicID, create a copy of file named MUSICID.EXE, whose original file path is \windows\000-MUSICID.EXE Directory("\Windows\Start Menu\Programs"):-File("?MusicID.lnk","\Windows\?MusicID.lnk") ** In the directory \Windows\Start Menu\Programs, create a copy of the file named ?MusicID.lnk, whose original file path is \windows\?MusicID.lnk

So what's ???.PROVXML?

PROVXML is short for 'Provisioning XML', which is used exclusively for Microsoft deployment. There is a specific file naming convention used by Microsoft, and no PROVXML file should have the same name within the entire ROM that you're building. PROVXML supports many configuration service provider commands with the most common being FileOperation and Registry. Further information on the use of PROVXML is beyond the scope of this tutorial.

If you choose to modify one, use an existing one and add stuff to it, as opposed to creating your own. For some STRANGE reason, creating your own won't work, no matter what you try to do. (Thanks Sleuth255)

So what's OPTIONS.XML?

This file is used by the ?BuildOS package tool to tell folks what your OEM package is and does. Let's start with a sample OPTIONS.XML and the breakdown of each component:

<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
 <Items>
  <Item name="CAMERA_4_08_28288_00" group="ATT OEM 1.60.502.3.Alex1" checked="true">
    <Tip>AT&T Camera OEM Package.  Without this package, you won't be able to use your camera!</Tip>
    <Guid type="p">46845f1f-3ad5-43e4-b92d-aaef4ad5b5ea</Guid>
  </Item>
</Items>

The stuff you care about is as follows:

  • Item name = The name of the application contained within this OEM package
  • group = The application group / category this OEM package belongs to
  • checked = Whether or not you want this item to be checked (true) or unchecked (false) by default. Useful to remind people that this is a critical OEM package and needs to be installed in their cooked ROM or something won't work! (e.g., Camera functionality!!!)
  • Tip = helpful information about the function of this OEM package
  • GUID = UUID. You need to put the UUID here to identify your OEM package. Technically a GUID is not a UUID according to wikipedia and other sources, but we'll just ignore that for this tutorial :D

OPTIONS.XML is the only file REQUIRED for you to create in an OEM package.

So what's XXXXXXX.XXX???

Those are the application files you're trying to add into your cooked ROM!!! =8^D


Converting Cabs to Packages with Ervius Package Creator

If you haven't read someone elses guide before and tried their method of making an OEM package, consider yourself lucky. The manual processes described by some, going through the lengthly process of extracting a CAB file, converting SETUP.XML to registry formats, creating an INITFLASHFILES.TXT manually and so forth takes A LOOONG TIME and I applaud all of those OEM Package builders who used the old methods, because those methods for creating an OEM package was truly an error prone exercise in futility and patience!!!

The method I describe below is semi-automated and uses Ervius Package Creator & Benthon's MSCEInf.exe. Everyone should thank Ervius & ?BenThon, because we now can convert a cab to an OEM package in a matter of minutes instead of hours...

Setting up & running for the first time

  1. You can skip this entire step if you're using the Kaiser ROM Kitchen w/ Alex's latest updates, as I've included all the files for you. Go ahead and select 'p' from the ROM Kitchen menu and then jump down to 'Steps to convert cab to OEM package'.
  2. All of the files below, plus the cab or the OEM package folder must be in a folder on your C: drive! If not, you will have problems running this program. It's a limitation created by Ervius, not me...
  3. Download and uncompress BenThon's MSCEInf.exe and Ervius Package Creator to the same directory
  4. Rename MSCEInf.exe to MSCEInfen.exe
  5. Run packages creator 5 4.exe. When running for the first time, you will see the following two error messages:

    • "Error reading Settings file. I delete it!!!" - Click on OK.
    • "Unhandled exception has occurred in your application..." - Click Continue.
  6. Check the following boxes (settings will be saved in settings.ini for future execution)

    • Select 'ENG' to change to English.
    • Check 'Prefix files for duplicate in package subfolders'
    • Check 'Enable options'

Steps to convert cab to OEM package

  1. Click on 'Open CAB file' and select a cab file to convert.
  2. Click on the 7th icon from the left, 'Extract CAB files with original names in a folder'.
  3. When the folder selection menu comes up, click on 'OK' regardless of the location shown. It will create a folder named after the cab in the same directory where the cab is located.
  4. It will seem like nothing happened, but be assured that the files have been extracted. Click on the X to close the window.

    • If you really forgot to click on 'extract' and nothing was extracted, an error message will appear - "U've cancelled creating package from cab analyzer... exit!"
  5. The next window that appears, known as the 'initflashfiles tab' is for executable and help file links. Select which files you want your links and the folders to place them. Select and apply for each link and when finished, click done to proceed.
  6. You're now back to the main menu. The UUID for DSM and RGU has been pre-generated. You have the option of going back to 'open initflashfiles tab', creating option.xml with a group, or completing the package.
  7. Once you have chosen the appropriate options.xml category, click on 'Complete Package.
  8. Your cab has now been converted to an OEM package in a subdirectory where the original cab resided.

Creating Packages from ROM files

  1. To extract a ROM OEM/SYS folder into OEM packages, you first need to start copying/moving files. Files can be named as similar items to the application itself (e.g. PTT for AT&T's Push To Talk). You can also find other file references in initflashfiles.dat.
  2. Next you'll need to hunt for the registry settings. This can be contained in .rgu or .PROVXML files throughout the OEM and SYS folders. Copy/Cut and paste only the ones relevant to your OEM package.
  3. Using Ervius Package Creator for DSM/RGU UUID

    • Ervius Package Creator also has another button for creating OEM packages. It can:

      • Create initflashfiles.txt if you have a folder structure within your OEM package
      • Convert setup.inf or _setup.xml to .RGU format
      • Generate a random UUID for .dsm and .rgu files
  4. The true test - building the OEM package onto another device or ROM

    • If you did a excellent job of copying/moving files and registry entries, then your application should function normally on another device or another ROM. The only way to find this out is to cook it into one and test away.

Enjoying your new ingredients?

If you enjoyed this tutorial and you're feeling generous, click here.


Thanks

Thanks to jcespi2005 for all his help in the ROM Kitchen and his encouragement!!! It's his attitude that made me want to contribute in the first place...

Thanks also goes out to kyphur, who inspired me to expand upon his post in the kitchen by writing this and sharing. It's sharing chefs like him that will make us all great chefs!

Thanks to Sleuth255 for the info about editing provxml files instead of creating them from scratch.

Thanks to CUSTEL for where to find buildDSM.exe.

Thanks for all the people responsible for the ROM tools, bepe, ervius, benthon, dark simpson, itsme, mamaich, pof, tadzio, theblasphemer, jugglerLKR and anyone else that may have been forgotten. Without their tools, we wouldn't have anything to build upon!

And finally, thanks goes out to all the moderators and administrators at xda-developers for keeping this site running, as without them, we'd never have had the chance to do all these great things.


FAQs

  • Q: Where can I find other OEM Packages?
  • A: PPCGeeks Apache Kitchen, Hermes Pandora Kitchen, Himalaya OEM Packages, Himalaya Wiki for OEM Packages, Atom OEM Packages, .Net Framework & SqlceMobile Compact 3.5 OEM Packages, Actual working Net CF 3.5 OEM Package, All Extracted HTC Apps (cab & oem included), _Alex_'s UltraClean AT&T 1.60 ROM w/ OEM packages, folders and radio, _Alex_'s 161.04MB HTC 1.56 ROM w/OEM Packages, folders & radio, Kaiser ROM Kitchen OEM Packages v0.1 (see bottom of post)
  • Q: "Erreur d'insertion de ligne ?RichEdit", when yuu pick a .cab file in MSCEInf.exe.
  • A: The message is in French, means “Error inserting line ?RichEdit”. It’s probably caused by non-Unicode language setting. Please check your region and language settings. Vista: Control Panel -> Clock, Language, and Region -> Region and Language Options -> ?Tab Administrative -> ?Button Change System Locale, Select “English (United Status)” for current system locale; XP Control Panel -> Regional and Language Options -> ?TabAdvance -> Select a language, Select “English (United States)”.
  • Q: I had a problem while flashing within my OEM package and it says my RGU file is invalid. What's wrong?
  • A: When you run your new package through buildOS, you may encounter some errors within the .RGU file. Here are some known issues:

    • Issues with Ervius Package Creator

      • """, convert to \" instead
    • Issues with MSCEInf.exe from XML/Registry tab

      • Extra spaces before / after = (e.g., key = value)
      • Extra spaces before / after : for dword
    • Issues with other registry conversion apps

      • Converting decimal to dword hex

        • Use the built-in Windows calculator to convert decimal to hex.
  • Q: I've noticed that some applications have SETUP.DLL or another DLL which is used in the installation process and hides the registry files from Ervius package creator. How do I go about finding these registry entries?
  • A: Export the entire registry using your favorite registry editor (e.g., PHM Registry Editor) before and after your installation. Copy both folders to your PC and use Windiff to compare them. The differences between the before and after registry exports will be what the application installation process had changed.
  • Q: Do you have any ROM specific 'how to extract' guides?
  • A: Kaiser ROM Folder Layout -- Older version of this guide, see towards the bottom for the Kaiser ROM layout.

Back to Kaiser Wiki | Back to Main Page


Last edited on January 10, 2008 8:36 am.


Edit | PageHistory | Diff | PageInfo
You are signed in as:
?mrgeoff