PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   HTC Apache (http://forum.ppcgeeks.com/forumdisplay.php?f=14)
-   -   Make OEM for .cab with setup.dll (http://forum.ppcgeeks.com/showthread.php?t=7729)

gguruusa 08-30-2007 09:34 AM

Make OEM for .cab with setup.dll
 
1 Attachment(s)
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.

gguruusa 08-30-2007 09:44 AM

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).

luv2chill 08-30-2007 11:36 AM

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!

Perasite 08-30-2007 01:30 PM

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?

gguruusa 08-30-2007 03:01 PM

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?

bmtbandit 08-30-2007 03:07 PM

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.

gguruusa 08-30-2007 06:53 PM

That's easy enough to do, but doesn't integrate into the kitchen very well.


All times are GMT -4. The time now is 12:11 AM.

Powered by vBulletin® ©2000 - 2025, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0