PPCGeeks Forums HTC Arrive HTC HD2 HTC Thunderbolt HTC Touch Pro 2 HTC Evo 4G HTC Evo 3D Samsung Galaxy S II Motorola Droid X Apple iPhone Blackberry
Go Back   PPCGeeks > Windows Mobile > WM HTC Devices > HTC Apache
Register Community Search

Notices


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-30-2007, 09:34 AM
gguruusa's Avatar
Deep Thinker
Offline
Pocket PC: Tin Can
Carrier: Atomic Vibration
Location: Mountain top
 
Join Date: Jan 2007
Posts: 3,252
Reputation: 4726
gguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributions
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Make OEM for .cab with setup.dll

So you want to make an OEM of your favorite program's .cab? And it's not working? Does it have a setup.dll? Maybe this will work for you.

Many programs use a setup.dll in their .cab to load certificates and do other sundry work as part of a programs installation. Since the average person can't pull the certificate or other bit of magic out of the setup.dll, I wrote this little piece of code. It's not very complicated - it just calls the routines in a setup.dll, just like a normal installation does.

Here's what you do:
Use a program like MSCEInf to extract your cab contents.
Put the setup.dll in your OEM project. (rename it to something like OEM_APPinitials_setup.dll)
put the registry entries identified in the .inf in your .rgu file
Put all the files in the appropriate directories (this can be tricky - I suggest starting with placing them exactly where the .cab would, then trying to move them once you have it working)
Put DLL_Invoker2.exe in an OEM folder (you only want one copy of this program in your kitchen - I put mine in my customize OEM folder - maybe Luv2Chill wil lump it into a future kitchen)
DLL_Invoker2 takes these options:
  • DLL_Invoker2 setup_dll_name.dll DLL_Entry Install_Dir [FirstRun] [RunOnce]
    • setup_dll_name.dll - the name of the .dll the .cab normally uses to install the application
      DLL_Entry - one of [INSTALL_INIT | INSTALL_EXIT | INSTALL_INIT_EXIT]
      Install_Dir - where the application files are installed (probably /windows, but sometimes you have to use the original install dir)
      FirstRun - one of [True | False] flag passed to INIT_EXIT indicating if first call.
      RunOnce - [True] If present, will set "HKLM\Software\Apps\GGuruUSA's DLL Invoker\{application_name}" to true, prohibiting DLL_Invoker2 from running again for {application_name}. Delete the key if you want to run it again.
so, make a shortcut something like this shortcut for SPB Plus:
/windows/DLL_Invoker2 OEM_PPlus_setup.dll /windows INSTALL_EXIT True True

add a line in initflashfiles that copies your shortcut to /windows/startup

that's it! with any luck, your app will load on first boot just like it was installed from the .cab.

While most applications can be made into OEMs this way, not everything can be made into a useful OEM. Some apps don't like running from /windows, and some apps have dialogs that pop up during the install. Sometimes you can get these to work, and sometimes getting them to work doesn't gain you much. Some setup.dlls are very poorly written and make lot's of bad assumptions. YMMV.
Attached Files
File Type: zip OEM_Tools.zip (6.4 KB, 20 views) Click for barcode!
__________________
Grammar: The difference between knowing your shit and knowing you're shit.
Reply With Quote
  #2 (permalink)  
Old 08-30-2007, 09:44 AM
gguruusa's Avatar
Deep Thinker
Offline
Pocket PC: Tin Can
Carrier: Atomic Vibration
Threadstarter
Location: Mountain top
 
Join Date: Jan 2007
Posts: 3,252
Reputation: 4726
gguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributions
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
You can find SPB Plus OEMed in this manner in my ftp directory. As far as I know, it's the only fully functional OEM of SPB Plus there is.

On the ToDo list for OEMs built this way is getting rid of the /windows/startup shortcuts after first boot - they don't serve any purpose after first boot and can be deleted.

If you run across odd applications this way of building an OEM won't work for, please send them my way.

Please keep in mind that while more robust at installing an application and certainly a lot easier for the typical app, this method of building an OEM does cost a little storage space for the setup.dll and a little extra startup time on first boot. Heck, it's possible your PPC will hang if too many OEMs are built this way in your ROM (if you run across this situation, definitely let me know - I already have a solution in mind).
Reply With Quote
  #3 (permalink)  
Old 08-30-2007, 11:36 AM
luv2chill's Avatar
Retired Staff
Offline
Pocket PC: Apache (PPC6700); Titan (Mogul)
Carrier: Sprint
Location: Lawrence, KS
 
Join Date: Nov 2006
Posts: 1,524
Reputation: 143
luv2chill is keeping up the good workluv2chill is keeping up the good work
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via ICQ to luv2chill Send a message via AIM to luv2chill Send a message via MSN to luv2chill Send a message via Yahoo to luv2chill Send a message via Skype™ to luv2chill
Nice job, but is there any way to accomplish this from the PC while building the OEM itself rather than on the PPC after first boot? Like just dump all of the "intended" reg edits from the setup.dll to a text file? It would be better in cases where some of the reg entries would need to be adjusted to suit an OEM situation vs. normal cab install.

Thanks!
Reply With Quote
  #4 (permalink)  
Old 08-30-2007, 01:30 PM
Perasite's Avatar
Retired Staff
Offline
Pocket PC: HTC Touch Pro
Carrier: Sprint
Location: Yuma, AZ
 
Join Date: Sep 2006
Posts: 1,929
Reputation: 2026
Perasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIPPerasite is a VIP
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Also, I've read that provxml files get processed during the first boot after a new rom flash. Couldn't those be used to delete the no longer necessary links out of startup, or would the provxml run before the startup link did its thing?
__________________
Now with VGA support on all software!

Projects: (PeraStats 1.7) (PeraCount with Clock 1.3) (PeraCount 1.3) (PeraProfiler 1.2) (S2U2Lock 1.1)
Reply With Quote
  #5 (permalink)  
Old 08-30-2007, 03:01 PM
gguruusa's Avatar
Deep Thinker
Offline
Pocket PC: Tin Can
Carrier: Atomic Vibration
Threadstarter
Location: Mountain top
 
Join Date: Jan 2007
Posts: 3,252
Reputation: 4726
gguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributions
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Sadly, no, you have to run the setup.dll on first boot so that it can do it's magic (usually install certificates, sometimes other stuff too). A lot of that stuff is in the DRM section of the registry so a simple cut/paste doesn't work. AnimatedToday is a good example of that - it's magic registry settings change with every install (I'm still puzzled as to where the hell the values are coming from and what their purpose is) and it won't run at all without their magicalness.

The provxml files won't work to do the delete because the provxml files run before /windows/startup gets processed. I'm toying with the idea of moving all the shortcut stuff into the registry - that way you could chain a bunch of them together and force flow control upon the install process. Plus, it reduces the process to just one shortcut instead of a shortcut for each OEM - and that can delete itself. Maybe in v2.

Hmmm - maybe invoking from provxml? Didn't think of that, but it might add additional complications for some programs because the world isn't really fully built while all the provxml stuff is occuring. I dont' know. Anyone know how to execute a file from provxml?

Last edited by gguruusa; 08-30-2007 at 03:13 PM.
Reply With Quote
  #6 (permalink)  
Old 08-30-2007, 03:07 PM
bmtbandit's Avatar
PPCGeeks Regular
Offline
Pocket PC: xv6700
Carrier: Verizon
Location: Pittsburgh, PA
 
Join Date: Feb 2007
Posts: 215
Reputation: 75
bmtbandit is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Send a message via AIM to bmtbandit Send a message via Skype™ to bmtbandit
What about having a config file that calls themselves in order from a custom "Setup.dll", then then deletes its own shortcut. I don't know much about setup.dll's but I would not think it would be that hard to make one that goes to a set file, gets a list of dlls, executes, and deletes it own known shortcut.
Reply With Quote
  #7 (permalink)  
Old 08-30-2007, 06:53 PM
gguruusa's Avatar
Deep Thinker
Offline
Pocket PC: Tin Can
Carrier: Atomic Vibration
Threadstarter
Location: Mountain top
 
Join Date: Jan 2007
Posts: 3,252
Reputation: 4726
gguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributions
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
That's easy enough to do, but doesn't integrate into the kitchen very well.
Reply With Quote
Reply

  PPCGeeks > Windows Mobile > WM HTC Devices > HTC Apache


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -4. The time now is 08:22 PM.


Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
©2012 - PPCGeeks.com