Cab file manipulation - Windows Mobile Development and Hacking General

I'm hacking on a Wm app and have some problem with deployment.
The application works fine but I have to change a Uri in a config file inside the installer Cab before installing it every time. -> Of course I'm lazy and want to automate the process of changing the file.
The reason for not including the configuration in the application itself is that I'm signing the Cab/app , so its an trust issue
This is what I want to do:
Open the installer Cab and extract file
Edit file
Replace original file in Cab
Re-Sign the Cab
Anyone have ideas plz share, I don't need a complete solution just some ideas/outline of how it could be done scripted or programmatic.
Tnx all for a great community, I keep testing much of the stuff here on my kaizer.

Related

Auto install of CAB files

Hi all,
I have a cab file (call it cab1) containing three files to install on a WM5.0 device. These three files are another cab file (call it cab2) and two config files. I drop cab1 onto the device and it executes. This puts cab2 and the two config files into the correct folders that I want. This is all fine
What I need to happen then is for cab2 to auto execute without anymore interaction. How can I add this instruction to cab1?
Dropping cab2 into the startup folder and waiting for the device to soft reset is not an option for me
The whole install needs to happen on the device by sending a single cab file to the device i.e. I cannot use any msi etc to install over ActiveSync
I've created the cabs in VS2005
Thanks for any help
This one is tricky. You need to create a setup.dll for cab1 then have it launch an exe and exit. The exe will wait about a second for th cab installer to complete then launch the installation of cab2.
i believe this is the only way to accomplish what you want with one cab without combining the content of cab1 and cab2 in to a single cab.
Thanks levenum
Combining the cabs is what I would like to do but cab2 is signed so I can't unpack it without breaking it. That's why I went down the road of putting it into another cab with the other files I need to install
Is there a way to add a post-install command to launch cab2 in the setup.dll of cab1(or anywhere else)?
What levenum means is that you can't launch the installation of the second cab from the first one. The reason for this is that only one instance of wceload.exe can be running.
You need to build a setup.dll in the first cab file. The first cab must also have an exe that will install the second cab file. You launch the exe from the setup.dll. The exe must wait until wceload.exe has shut down after installing the first cab before it can install the second one by running createprocess on wceload.exe with the right arguments.
If you don't know how to make the setup.dll, take a look in the Windows Mobile 5.0 SDK. It includes an example on how to do this.
Did you get it?
Øystein

making .cab files

For some reason, the .cab I made to fix the QuickGPS issue will *NOT* install. It was made with WinCE Cab Manager like I have made every other .cab file which has always worked.
Trying to install on the Kaiser.
Can someone figure out what went wrong? I'm frustrated.
Thanks...
-Mc
In my oppinion there is a _setup.xml missing in your cab file. So the installer doesn't know what to do with your file. You should try to make such a file and intigrate it into your cab. The easiest way is to use and modify an existing _setup.xml from an other archiev.
For i do not know which filetype the file you try to install (that is defined in the _setup.xml, too) has i can not be shure. But if it is an dll you have modifyed u'll have to unregister it before modyfying and reregister it before you put it into the installer.
search for "unsigner" and "msigner", for signing dll's
One last hint. I use ZipStar for creating cab files. That is much easier for it has the look and feel of winzip.
this is strictly a reg patch .cab. I've used WinCE Cab Manager for a while now with no issues. I also checked some of my previous cabs and none of those had .xml files in them either so this looks consistant.
I've NEVER installed any of my cabs on the Kaiser so I'm wondering if the issue is the OS. I'll try to install this cab on my K-Jam just to see if it works there. If it does, the issue is a compatability issue.
If I manually create the xml file and create a cab using ZipStar, is that all there is to it or is it going to be missing something? I've never used ZipStar and not familiar with how it handles PPC .cab files. I checked out their website and I don't read German.
Thanks again for your help. I'll give your recommendations a shot.
-Mc

Cab file creating

i just put together a cab file (for personal use) to remove sms threading (due to upgrading roms alot etc)
however i have hit a brick wall.
i do not know how to make the device restart after install?
i have compared to other cab files but the only difference is the other cabs install files not registry?
i'm not all that good with programming however i would really like to complete this cab for ease of reloading a new rom - so any input would be grateful - thank you
For cab file creating i use PocketPC Installation Creator. In the menu there is a check box to set the 'reboot after installation' behaviour. I played with it but noticed that my device only rebooted after installation of files. Because i found it to much effort to look into it, i didn't. After all it is quite easy to reboot manually.
You could use MSCEinf to examine different cabs and look for the reboot after installation setting (http://www.codeppc.com/telechargements/msceinf/msceinf.htm)
I also noticed that some people make cab files from .xml files (sleuth for example). Maybe this method has other options than cabarc in combination with inf files.
Cant give you any answers, still hope it will be of any help.
Good luck and post back result if you figured it out.
Arjan
The easiest way tocreate CAB files is to purchase a copy of WINCE Cab Manager from OCP Software
they have just released a new version which supports Vista
i created the xml document then created the cab from it.
should have said that sorry.
so i was looking for a way to restart device via the xml..
thanks for the input so far

[HELP] How to register a dll?

I try to create a program which consists of
.asx files (to show online tv channels),
.lnk files (shorcuts to the .asx files) and
a .dll file which contains only some .ico files (icons of the tv channels).
I added all these files to a cab using WinCE Cab Manager and tried to install it on my ppc. So far so good. The problem occurred when the message “The program can not be installed. Choose another location” appeared during installation, just after the process bar was filled.
Although I have no idea about computer programming, I have created many cab’s with WinCE Cab Manager for skins I have created for several programs. Anyway, I realized that the problem occurred due to the .dll file, since this is the first time I add such a file in a .cab.
I created my .dll file using a .dll from another program which had only icons in it, as well. I deleted them using Restorator 2007 and I had an “empty” .dll sized 4KB. Then I added my icon files using XN Resource Editor.
I searched the Internet to see what might be the problem with the .dll and I found out that I have to “register” my .dll file. I really have no idea what this means but it needs to be done. I also found an option in WinCE Cab Manager for “self-registering” file, but it didn’t work either.
So, the question to you dev guys is how can I register my .dll file, or should I create it from the beginning with another way?
Please help! Thanks in advance!
sorry to repost but it seems that posts keep coming in this forum and this thread is already in the second page and I'm afraid that noone will see it and reply to it. By the way, is there any special sub-forum for such questions?
This may help. I use his instructions to edit existing DLL's
http://www.modaco.com/content/i9x0-...88904/lisbian-taskbars-for-i910/#entry1023568
It will unsign the dll which will probably fail on your custom dll but it should sign it when you are done editing.
NilsP
Many thanks for your suggestion but unfortunately it didn't work for me.
As you said, this is mainly for resigning already signed .dll files.
Any other help will be appreciated. I can attach it here if anypne is willing to help. Or just tell me the way. Thanks!
I deploy a few dll's with my app, without any problem. If the installer complains about the location, what did you specify where it should go?
There are 2 approaches to solve this problem:
1.) If you have a private key to match a certificate in the device's certificate store, sign the .dll and .cab with this private key and it will be installed with elevated privledges, and be successful. To facilitate this you can install the "SDK Certificates" - and sign with the matching private key (you should be able to find these on a search, term "SDKCerts" or similar)
2.) Look for an "Application Unlocker" or other security reduction tool, run it, and you should be able to install the cab. On this note, if you check here, it will give you a more technical overview of the security policies. You want to change 4101 / 0x1005 to "SECROLE_MANAGER" (8) - which tells the system to install it with elevated privledges. Also make sure 4102 / 0x1006 is set to 1 to allow unsigned applications.
6Fg8
I don't believe that is the location I specified that causes the problem because when I deleted the .dll file from the .cab, it was installed properly. How do you create your dll files? With programming or you just edit existing files? If I send you my .ico files, will you be able to create the .dll file for me?
Da_G
Thanks but both approaches seem very complicated for me!
So, will I need Visual Basic in order to do this or is there any easier way? Can anyone sign the dll for me?
angelos_cy said:
6Fg8
How do you create your dll files? With programming or you just edit existing files? If I send you my .ico files, will you be able to create the .dll file for me?
Click to expand...
Click to collapse
Yes with programming, C++ or .net. Never had any issue with signing. I can try to make a dll if you send me the icons (or post them here if they aren't too secret ).
6Fg8 said:
I can try to make a dll if you send me the icons (or post them here if they aren't too secret ).
Click to expand...
Click to collapse
I have sent them to you by pm. They are not secret at all but I will create a "program" (wannabe ) with that dll and I want that program to be a surprise for users of the forum where I'll post it. I may post it on xda too, but it's nothing important.
Many thanks!
angelos_cy said:
The problem occurred when the message “The program can not be installed. Choose another location” appeared during installation, just after the process bar was filled.
Click to expand...
Click to collapse
This happens because you've changed resources in signed file, which changed file checksum and invalidated it's signature, and Windows installer refuses to install file with invalid signature. But it won't refuse to install this file WITHOUT signature at all - so use unsigner (search for it on XDA) to remove signature completely; if you encounter error, try to remove signature from original (unmodified) file, and then change resources in it...
6Fg8
the_ozyrys
Thanks to both of you!
6Fg8 has created and signed the dll for me and it finally worked, but I also tried the_ozyrys' method and it also worked.
So thanks to baniaczek too, since he created the unsigner.exe.
Everything worked fine with the dll. Now the cab is installed properly.
However, I have another problem. Just after the installation of the cab on my ppc, it seems that the device freezes for about a minute. This is propably because my cab contains a lot of shortcuts (.lnk files) that go under Programs folder.
So, I would like to ask for another favour, if it's possible. As I said I intend to give this cab to others too. Since this delay can make them believe that my program has freezed their device, I would like to make the cab restart the device just after installation and after uninstallation as well. I think this is made with the "Setup.dll" which I don't know how to create.
If anyone knows how to do this and has the time for it, could you please create this setup.dll for me. If the cab is needed to do this, just tell me to send it to you.
Thanks in advance!
Anyone? Plzzzzzzz!
If you want to sign .dll or .exe u can use the apps posted in the two posts below
http://forum.xda-developers.com/showthread.php?t=432041
or
http://forum.xda-developers.com/showpost.php?p=3530246&postcount=18
raykisi
Thanks for your answer but 6Fg8 and the_ozyrys already helped me on that.
My question now is how to create a setup.dll in order to make my .cab to prompt the user to restart the device after installation and uninstallation. If anyone can do it for me, I can send you the .cab which I alreday created and you can add the setup.dll with those functions.

[REQ] Any Way to modify CAB installations

I'm curious if there is any way to modify the cab installations so that we can be asked which start menu folder we would like the shortcut to be placed in?
I have the Start Menu set up so nicely (thanks to Indagroove) but any time I update an app or install a new app I have to go move the link and then restart my phone so it does not appear in the 6.5.x Start Menu.
Any real developers have any ideas?
Way 1
buy "WinCE Cab Manager"
install it on your PC
open .cab files with it
modify .cab files
save .cab files
Way 2
same as above... but as someone who already has WinCE Cab Manager
Way 3
extract files in .cab
edit the files in the .cab with notepad, ultaredit,...
hope it will be ok
repack .cab
easy...
That's what I do now.
Oh well, thanks for replying though.

Categories

Resources