PDA

View Full Version : How to delete a registry key using a CAB


hmdshmds
9th August 2008, 08:18 PM
Hi
I am having hard time in making a cab file to delete a registry value.
as an example I tried to import the following into WinCE CAB manager:
[HKEY_LOCAL_MACHINE\System\Platform]
"PSAtRoot"=-

so that I can delete PSAtRoot from registry....
the WinCE CAB manager import nothing !!
this is working for desktop but not for PPC
any help on how to delete items in registry using cab file... or anything that is automated!
Thanks

TheChampJT
10th August 2008, 05:13 AM
Install the .cab file known as PHM RegEdit. Also, before you delete any registry values, make sure you know what your doing!

xd1936
10th August 2008, 05:45 AM
I believe he is wanting a cab that makes the change, not a registry editing program. I personally would make a mortscript install.mscr and uninstall.mscr, and make your own custom cab with mort's included setup.dll :)

TheChampJT
10th August 2008, 05:59 AM
I believe he is wanting a cab that makes the change, not a registry editing program. I personally would make a mortscript install.mscr and uninstall.mscr, and make your own custom cab with mort's included setup.dll :)

I know what they want, just showing that it's a lot easier to open a reg editor and do it manually, then creating a list of commands to execute a simple deletion of one entry.

raiisak
10th August 2008, 07:21 AM
I know what they want, just showing that it's a lot easier to open a reg editor and do it manually, then creating a list of commands to execute a simple deletion of one entry.

You clearly missed the question and the purpose why he is posting in Development and Hacking section. Hes asking todo a specific task in a cab operation and you advice him to install a reg editor and be carefull?? Jesus.. If you got nothing to say, dont say it. Sorry, but youre reply pissed me off here!


Hi
I am having hard time in making a cab file to delete a registry value.
as an example I tried to import the following into WinCE CAB manager:
[HKEY_LOCAL_MACHINE\System\Platform]
"PSAtRoot"=-

so that I can delete PSAtRoot from registry....
the WinCE CAB manager import nothing !!
this is working for desktop but not for PPC
any help on how to delete items in registry using cab file... or anything that is automated!
Thanks

Mate, read this. I think its a good start for youre question :)

You can specify a pre/post XML when compiling your CAB via CabWizSP. PreXML will be carried out before the main INF instructions as opposed to PostXML codes which are carried out after the INF instructions. Kindly check this sample CabWizSP syntax:
CODE
cabwizsp Sample.inf /postxml PostXML.xml /cpu ARMv4


What happens when you run the code?
CabWizSP will compile instructions in 'Sample.inf' to output 'Sample.ARMv4.CAB'. It will add 'PostXML.xml' to the output CAB. The target device CPU would be 'ARMv4' (SP2003)

The post XML file may contain your 'delete file' instructions. An example would be:

<characteristic type="FileOperation">
<characteristic type="\Storage\windows\AppMgr\Install\Target File.ext" translation="install">
<characteristic type="Delete">
<parm name="ForceDelete" />
</characteristic>
</characteristic>
</characteristic>


Above code will force delete 'Target File.ext' at \Storage\windows\AppMgr\Install. Note that the files you wish to compile should be in the same folder as the INF, the (Post) XML and the CAB making files (makecab.exe, cabwiz.ddf, CabwizSP.exe)

http://www.modaco.com/index.php?showtopic=235258&view=findpost&p=844503

You should read the whole tread aswell good info for you on cab and registry :)
http://www.modaco.com/content/smartphone-customisation-general-discussion/235258/create-cab-files-to-change-registry/



Play whit this for register changes, tbh I havent deleted in registry via cab before. I overwrite in cab form and wrap it whit provxml when cooking.

TheChampJT
10th August 2008, 07:05 PM
You clearly missed the question and the purpose why he is posting in Development and Hacking section. Hes asking todo a specific task in a cab operation and you advice him to install a reg editor and be carefull?? Jesus.. If you got nothing to say, dont say it. Sorry, but youre reply pissed me off here!

The OP asked for an AUTOMATED way to delete the reg entry, not how to setup an xml file for deletion of the key during ROM cooking. And yes, you better believe I said make sure you know what your doing! If a person asks how delete a registry entry with this type of thread started for it, I'm a bit concerned with the fact they might not know what they are doing. So, really I'm soooooo sorry I hurt you feelings, but I did give an answer, it wasn't rude, and I gave caution to the person who wants to change the registry.

Ohhhhhh! Your post made me so sad :(!

HAAAAA! LOL :D!

hmdshmds
10th August 2008, 08:48 PM
TheChampJT : thanks for welling to help

raiisak : Thanks alot for the the help
while searching I found away to delete registry entry using (Provisioning)pre/post xml in the WinCE CAB Manager.
I modified the xml code accourding to this MSDN article (http://msdn.microsoft.com/en-us/library/aa457882.aspx)
this my xml code :
<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKEY_LOCAL_MACHINE\System\Loader">
<noparm name="EnableUpperModules" />
</characteristic>
</characteristic>
<characteristic type="Registry">
<nocharacteristic type="HKEY_LOCAL_MACHINE\System\Loader\LoadModuleLow" />
</characteristic>
</wap-provisioningdoc>


unfortunately nothing deleted !
did I miss something?

g77
10th August 2008, 11:14 PM
Why don't you create this _setup.xml:
<wap-provisioningdoc>
<characteristic type="Install">
<parm name="InstallPhase" value="install" />
<parm name="OSVersionMin" value="4.0" />
<parm name="OSVersionMax" value="6.99" />
<parm name="BuildNumberMin" value="0" />
<parm name="BuildNumberMax" value="-536870912" />
<parm name="AppName" value="YOUR NAME APP" />
<parm name="InstallDir" value="%CE2%" translation="install" />
<parm name="NumDirs" value="0" />
<parm name="NumFiles" value="0" />
<parm name="NumRegKeys" value="2" />
<parm name="NumRegVals" value="1" />
<parm name="NumShortcuts" value="0" />
</characteristic>
<characteristic type="Registry">
<characteristic type="HKEY_LOCAL_MACHINE\System\Loader">
<noparm name="EnableUpperModules" />
</characteristic>
</characteristic>
<characteristic type="Registry">
<nocharacteristic type="HKEY_LOCAL_MACHINE\System\Loader\LoadModuleLow" />
</characteristic>
</wap-provisioningdoc>
and then make the cab with ms makecab (http://support.microsoft.com/kb/310618):
makecab _setup.xml mycab.cab

hmdshmds
11th August 2008, 12:12 AM
g77:
hmm... the output CAB cannot be installed
"try installing again to a different location"
any clue?

raiisak
11th August 2008, 01:59 AM
Going to try youre cab :)

sean222
11th August 2008, 08:48 AM
...while searching I found away to delete registry entry using (Provisioning)pre/post xml in the WinCE CAB Manager.

Thanks for that idea! I managed to delete the entire ClearType key from the registry using the Post-XML option in WinCE Cab manager.

I now have a cab that deletes the ClearType key and thus disables cleartype! (From a rom that has cleartype enabled by default because the key exists)

Here is what I put in the Post-XML:


<characteristic type="Registry">
<nocharacteristic type="HKLM\System\GDI\CLEARTYPE" />
</characteristic>

raiisak
11th August 2008, 10:57 AM
Thanks for that idea! I managed to delete the entire ClearType key from the registry using the Post-XML option in WinCE Cab manager.

I now have a cab that deletes the ClearType key and thus disables cleartype! (From a rom that has cleartype enabled by default because the key exists)

Here is what I put in the Post-XML:


<characteristic type="Registry">
<nocharacteristic type="HKLM\System\GDI\CLEARTYPE" />
</characteristic>

Thats funny. Its the wery same string I use in kitchen. Didnt think of cabing it. N1 hehe.

Kolossi
26th August 2008, 09:35 PM
Originally Posted by hmdshmds
hmm... the output CAB cannot be installed
"try installing again to a different location"
any clue?

I got this issue too, so for hmdshmds or anybody else who finds this thread, the answer is simply (well after a day of tracking it down :rolleyes:) that in the registry path, the root part must be in the short form "HKLM" etc, and NOT "HKey_Local_Machine" as hmdshmds/g77 had it.

I've put an article on my website explaining about it, and also - care of a Microsoft blog entry - how to get Visual Studio 2005 to build this right into the installer without any other external software. See Removing Registry Keys with WM6 Deployment (http://www.kolossi.co.uk/joomla/index.php?option=com_content&view=article&id=49:removing-registry-keys-with-wm6-deployment&catid=43:windows&Itemid=72). (*UPDATE 1-Sep-2008* Previously, the IE7 phishing filter was reporting the above link as a "possible" phishing site. It absolutely is not and the false warning was reported to Microsoft and has now been corrected.)

Happy coding guys and gals :)

rogerard
8th September 2008, 09:21 PM
I'm trying to remove unwanted Today Panel items. After some trial and error, I've been able to come up with the following code:


<wap-provisioningdoc>
<characteristic type="Registry">
<nocharacteristic type="HKLM\Software\Microsoft\Today\Items\&quot;Owner Info&quot;" />
</characteristic>
</wap-provisioningdoc>


When I try to import it using SASHAMI, nothing happens; and when I try using 'Advanced Configuration Tool', I receive


System.SystemException:
Error Code #:
2147500037
at
Microsoft.WindowsMobile.Configuration.Configuratio nManager.MainConfigurator(XmlDocument configDoc, UInt32 flags)
at
Microsoft.WindowsMobile.Configuration.Configuratio nManager.ProcessConfiguration(XmlDocument configDoc, Boolean metadata)
at
AdvancedConfig.□.□(Object □, EventArgs □)


Apparently, there's still something wrong with my XML, but I'm at a loss. Anybody have any ideas?

Thanks
Roger

randy_s
6th May 2009, 11:39 PM
well, maybe a bit late answer but you cant remove 'folders' which contain values.. you need to remove them one by one, at least i cant get any further the nthat!

RyanMogul
7th May 2009, 03:49 AM
unfortunately nothing deleted !
did I miss something?

This might be a little late as I was not a member when you posted here, but to provision with a cab you should leave out the </wap-provisioningdoc> from the top and bottom. It will not fail to parse including that string and its confusing when it still doesnt work. That is your problem. Remove wap provisioning string from top and bottom. Here is how it should look.

<characteristic type="Registry">
<characteristic type="HKEY_LOCAL_MACHINE\System\Loader">
<noparm name="EnableUpperModules" />
</characteristic>
</characteristic>
<characteristic type="Registry">
<nocharacteristic type="HKEY_LOCAL_MACHINE\System\Loader\LoadModuleLow" />
</characteristic>

smuppy
28th May 2009, 04:17 PM
Hi!

I am, as everyone else posting in this thread, trying to remove a bunch of registry settings using a cab-file. Thanks to this thread, my hopes of success were raised once more :)

I tried all of the examples posted in this thread without success, found a link on modaco which lead me to this msdn-article:

http://msdn.microsoft.com/en-us/library/ms834737.aspx

Works like a charm... Thanks a BUNCH guys!

Angelusz
1st July 2009, 06:01 PM
As this is the first thing found when googled - I'll add a little information.

For files, you need to remove each and every file contained in a folder before the folder itself can be removed.

For registry keys, you do not need to remove seperate values. Deleting a registry key, deletes all contained values and subkeys.

e20140
8th August 2009, 11:14 PM
Great post. Just what I needed.
But I have problem with WinCE CAB Manager version 3.0.0.22. Anything I added to the pre or post XML, the CAB file cannot be install. Took me forever to debug and nothing works. Anybody?
I finally switch to version 2 and it works perfectly.

e20140
8th August 2009, 11:44 PM
I take it back, Wince CAB manager sucks. ver 2.1.0.35 cannot import reg file. :mad:

sank
14th August 2009, 11:50 PM
Searching also brought me to this thread. I was wanting to delete files as well as registry entries. They dont' work quite the same, as I found out the slow way. After long hours of searching, I finally found this reference: http://msdn.microsoft.com/en-us/library/ms834745.aspx and I'll quote it here for convenience. It demonstrates create and remove directory, as well as move, copy, extract, and delete files. Maybe this is obvious or not needed for people with a cab tool, but since I am too stubborn to install or use a tool, I am making this the old fashioned way, with my favorite text editor.

Cheers,


<wap-provisioningdoc>
<characteristic type="FileOperation">

<characteristic type="%CE14%" translation="install">
<characteristic type="MakeDir" />
<characteristic type="Minesweeper.lnk">
<characteristic type="Shortcut">
<parm name="Source"
value="%CE2%\winmine.exe" translation="install"/>
</characteristic>
</characteristic>
</characteristic>

<characteristic type="%CE2%\files" translation="install">
<characteristic type="MakeDir" />

<characteristic type="file1.txt">
<characteristic type="Extract">
<parm name="Source" value="file1.001" />
</characteristic>
</characteristic>

<characteristic type="file2.txt">
<characteristic type="Copy">
<parm name="Source"
value="%CE2%\files\file1.txt" translation="install"/>
</characteristic>
</characteristic>

<characteristic type="file3.txt">
<characteristic type="Move">
<parm name="Source"
value="%CE2%\files\file2.txt" translation="install"/>
</characteristic>
</characteristic>

<characteristic type="%CE2%\files\file1.txt"
translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>

<characteristic type="%CE2%\files\file3.txt"
translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>

<characteristic type="%CE2%\files" translation="install">
<characteristic type="RemoveDir" />
</characteristic>

</characteristic>
</characteristic>
</wap-provisioningdoc>

narshorn
17th August 2009, 10:10 AM
Well, tha's really well documented but I am lost here for now :(

I want to delete the registry key "HKCU\Software\Microsoft\Today"
because of skin problems, and I have specific skin that re-writes this whole key when applying new theme at fisrt start up anyway.

So I tested the following via advanceconfig and it didn't work, AC gives me an error :


wap-provisioningdoc>
<characteristic type="Registry">
<nocharacteristic type="HKCU\Software\Microsoft\Today" />
</characteristic>
</wap-provisioningdoc>


I also tried to save this as a .provxml to be cooked at the end of EXT
but it doesn't work either.

Could somebody guide me ? Is my syntax wrong (mostly) ???

brds,

nar

sank
17th August 2009, 05:59 PM
did you try spelling out HKEY_CURRENT_USER ? I'm just following the example on page 2.

e20140
17th August 2009, 07:47 PM
Narshorn, you are missing a < at the beginning and don't spell out HKEY_CURRENT_USER; otherwise, everything looks good.

Metroid Prime
29th January 2010, 09:05 PM
Any help please

I want to delete a registry file, but not I know I am doing wrong

xml code in postxml?

the code

<wap-provisioningdoc>
<characteristic type="Delete">
<characteristic type="HKLM\Software\HTC\testfolder">
<noparm name="testfile1" />
</characteristic>
</characteristic>
</wap-provisioningdoc>


incorrect?

or

<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\Software\HTC\testfolder">
<noparm name="testfile1" />
</characteristic>
</characteristic>
</wap-provisioningdoc>


or

<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\Software\HTC\testfolder">
<noparm name="testfile1" />
<characteristic type="Delete">
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>


or

<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKLM\Software\HTC\testfolder\testfile1">
<noparm name="ForceDelete" />
</characteristic>
</wap-provisioningdoc>


install oks but not action any.. that the problem?

any help please

Tylwith
18th February 2010, 03:04 PM
just

<characteristic type="Registry">
<characteristic type="HKLM\Software\HTC\testfolder">
<noparm name="testfile1" />
</characteristic>
</characteristic>

bobzero
7th December 2010, 01:52 AM
Thanks i followed the microsoft example in the above post.