[Q] How to replace \Windows\ .dlls - Windows Mobile Development and Hacking General

I want to replace phcanhtc.dll and phcanrc.dll with these dll (http://forum.xda-developers.com/showthread.php?p=5910397#post5910397) for wm6.5.3 with all fixes but I do not know how to do it.
I've searched on forum without relevant results.
Please help

me too, i really dont know

Why not simply, when device is booting i.e. processing HKLM\init, override old dll-version with new dll-version?
Code:
Launch9999="CopyDLLs.exe"
Depend9999=hex:14,00,1E,00

Could You elaborate a bit on that information? I mean, what is "CopyDLLs.exe" and how does it work? Where to find more information about it (Google doesn't return much...)? What is the "Depend" key and what does that HEX mean?
TIA

Thought the concept behind the solution proposal I outlined above is reconstructable to everyone:
1) you simply add two lines to [HKEY_LOCAL_MACHINE\init] with which an executable ( of your choice, I use freeware TULL.exe for those reasons - you can name it how you want to do it, ex. CopyDLLs.exe ) is started. BTW: 'DependXXXX' is the load order index for 'LaunchXXXX' and 'hex' indicates that it's a binary value.
2) using TULL.exe you create a related .INI-file that is read by TULL.exe (or renamed to CopyDLLs.exe, what I think is more meaningful) with contents like this:
Code:
;overide xyz dll
C "\Save\xyz.dll" "\Windows\xyz.dll"
;done
FYI: TULL.exe you can downlad here

Thank You for that valuable information! I have been using and customizing WM four years now and I have so far understood that it's impossible to replace DLL-s which are in ROM and cannot be overwritten with Resco or similar file manager. Although I don't need it anymore (I would have a year ago), it's still good to know. One question tho, if I may... By asking "what does hex mean" I didn't really mean that, I know there are DWORDs, binary values etc, sorry about that I actually meant what does that value do. But You already answered that. I still wonder, how is that load order index constructed, I mean, how do I know what to put there?
TIA.

OverWrite vs. Override
1) You have to distinguish between terms 'overwrite' (i.e. physical replacement) and 'override' (i.e. logical replacement). The method I suggested is to 'override' a DLL before its first use. If a DLL is already loaded, the method of course will NOT work (only the internal DLL counter is incremented by 1)!
2) With regards to how determine DependXXXX value (excerpt from http://msdn.microsoft.com/en-us/library/aa446914.aspx):
The other option for launching an application at boot time is to use the HKLM\Init keys, this requires that the application call back into the operating system by calling SignalStarted( ); to let the operating system know that the application is running. The reason for this is that the HKLM\Init keys have two parts, LaunchXX and DependXX. The LaunchXX key (where XX is a numeric value) simply points at the executable to launch. For example, take the following snippet from my operating system image registry file (once the operating system is built, the complete registry can be examined in text form in the build release folder as reginit.ini)
[HKEY_LOCAL_MACHINE\init]
"Launch10"="shell.exe"
"Launch20"="device.exe"
"Depend20"=hex:0a,00
"Launch30"="gwes.exe"
"Depend30"=hex:14,00
The snippet from the registry above launches three processes, Shell, Device, and GWES. Notice that device.exe (Launch20) has a dependency on Hex:0a (10 decimal). This equates to Launch10, or shell.exe, so the Shell process needs to signal the operating system that it's up and running so that any dependencies (in this case device.exe) can then be started. The same is also true of gwes.exe (launch30), device.exe depends on hex:14 (20 decimal), so GWES can't run until device.exe calls SignalStarted.

OK, thank You again for the thorough explanation. I just want to confirm one thing - as far as I understand from that description, it would also be possible to launch an *.exe which will copy and overwrite the original DLL before it's loaded in boot order? I ask because a bunch of the DLL files cannot be overwritten after the device has booted. Like I said, some of the files in ROM can be overwritten and some cannot be. I have so far suspected that the ones that cannot be overwritten cannot be overwritten because a) they are already loaded; b) they are locked by some process. I cannot imagine any other mechanism that distinguishes between one DLL and another. Would it work or am I missing something here?

You didn't read it carefully
Again: YOU HAVE TO DISTINGUISH BETWEEN OVERWRITE AND OVERRIDE. We all know that a file located in ROM never can be 'overwritten', but 'overridden', this due to the fact how WinCE searches for a DLL called by an application: 1 -> in directory where the application is located, 2 -> in folder \Windows, 3 -> in folder declared in CE's SystemPath and 4) finally in ROM.
Ending this excursion into the world of WinCE: If you make the desired DLL-copy-operations directly after device.exe (CE 5) / device.dll (CE 6) has done its job (means file system is mounted and ready to be used) you can 'override' each ROM-located DLL if it isn't already lasting (loaded) in RAM, means you simply copy new version of DLL to folder \Windows. BTW: The DLLs you see in \Windows might be located in ROM, or not ( i.e. located in RAM - folder \Windows itself is RAM), this depends on how OEM implemented this.
Only a practical example I've in use:
Code:
;
;increase storage memory (KB)
W \NandFlash\CE-Utilities\SetSystemMemoryDivisionKB.exe, 3072
; delay execution by the passed value in milliseconds
D 1000
;load backlight settings
W \NandFlash\CE-Utilities\regimp.exe, /f:\NandFlash\MyRegistry\backlight.ini /s
W \NandFlash\CE-Utilities\RegFlushKeys.exe
;prepare using .NET CF 3.5 instead .NET CF 2.0 (ROM located)
C "\NandFlash\NetCFCfg\device.config" "\Windows\device.config"
[COLOR="Red"]C "\NandFlash\MyCESystemPath\mscoree.dll" "\Windows\mscoree.dll"[/COLOR]
; delay execution by the passed value in milliseconds
D 1000
Original ROM-located mscoree.dll (part of pre-installed .NET CF 2.0) gets overriden with mscoree.dll that comes with .NET CF 3.5, thus now .NET CF 3.5 is running instead of .NET CF 2.0

Thanks again for Your answer, which is again thorough and informative. Basically You answered "Yes" to my question I say this because - as I am not as knowledgeable about WinCE system as You are - it seems I just call the process that You describe as "overriding" simply "overwriting". This is because I wasn't aware how WinCE searches for a file or how the \Windows\ folder contents is handled / processed. And also because when I copy a DLL file to \Windows\ folder, Resco simply asks "Do You want to overwrite...?" etc I am not a WinCE developer, I'm simply an enthusiast and I might call things more simply, sorry for that. But I think I got valuable information from You one way or another and the most important thing is, I got the point. However You call it.

@jwoegerbauer: Thanks friend for the nice examples and explanations .
Cheers!!!

I want to copy a new NLS file to a WinCE device, before system was loaded.
I've tried to do what you suggested here, jwoegerbauer, with my Mio C520.
I've wrote registry keys to activate the sciprt I wrote, before the system loaded - with no success.
I've tried both MortScript and TULL as script-language - both with no success.
The registry keys that I've tried to import are:
Code:
[HKEY_LOCAL_MACHINE\init]
"Launch25"="\My Flash Disk\Temp\CopyNLS.exe"
I've tried also to import
Code:
"Depend25"=hex:14,00
which cause the system to freeze in the main menu (before MP is loaded), and
Code:
"Depend30"=hex:14,00,28,00
which cause the system to freeze in the boot load.
I'll be happy to know what else can I try to activate the code.

If the wince.nls is located in the XIP already you cannot override it. It is loaded before the FAT partition is there and the filter driver could redirect calls to the FAT copy of a dll.
You need to re-cook with the wince.nls moved to the SYS, seems however that some specialties need to be taken care of when doing so (search here at XDA for this).

So, I understand that my only option is to implant a soft-reset during the installaion of MioPocket.
Do you know how to do soft-reset with those chinese devices?

Reset does not help you if the wince.nls is located in the XIP. You will not be able to replace it with any means - the OS will load it before you have any chance to interfere.
Your only option is to replace the OS (with a cooked one) where the wince.nls is different from the start - or where it is not located in the XIP partition.
Why do you want to replace the wince.nls? Probably your problem can be solved another way?

Well, actually, in the Mio C520 - reset does help me. It's re-written the wince.nls file with the one I copied, and used it very well.
My problem now is my Chinese device, based on WinCE 6.0 embedded.
I've installed MioPocket on it, and translate some of the words to Hebrew. The problem is that the hebrew is 'backwards', meaning if for ex. instead of "Hello" - It'll show "olleH".
Here is screenshot of both devices, to the left is the Mio C520, which is OK, and to the right is the Chinese device, which is written 'backwords'
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
So I thoght - maybe, if I'll made the Chinese device to do soft-reset, just like the Mio - maybe the problem will be solved.
But maybe you are right, and there's completely another solution to this problem. I sure hope there is...

Well, I can neither read Chinese nor Hebrew - so nothing to guide you here.
Not sure what you wanted to achieve with the new wince.nls
What I understood is that this files basically gives you all the entries in the Locale panel of the settings file - so where you can select the format of the time/date or currency. First you select the Locale (not UI language which is a different setting) and then you can pick for each of the items defined by this locale set the relevant options that are stored in the wince.nls file. It also holds all menu items of that local setting in all languages - which makes it quite big depending on the number of languages supported.
So if you could "replace" the wince.nls, then for sure it is not in the XIP and all my previous comments are useless for you.
If you are after swapping the direction of writing on your device this is a totally different thing. I am sure it is not part of the .nls but a system setting for the UI part of the device. You may need to search for "Arabic Support" or alike in the Windows CE forums around the world. I have not seen much discussed here at XDA for this specialty.
Good luck!

After a search inside the GPS file system (I forgot to mention that in the original menu of the GPS the Hebrew was just fine - meaning from right to left - what led me to think there's something in the OS responsible for that) - I found a file named SetLanguage.exe which may be repsosible to display the hebrew in the right direction.
Anyone in here can hex the file and understand what's it's usage?
I attached also file named Arab.dll, maybe is also related..
Any help will be much appriciate!

Absolute OFF-TOPIC
@Cheetah64d
SetLanguage.exe (by Lenovo Beijing Ltd.) you attached depends on libraries
Arab.dll, MultiLanDll.dll, ApicalDrvApi.dll, AppLoginDll.dll, MFC80U.dll and COREDLL.dll.
Click to expand...
Click to collapse
This executable is only useable on very specific devices.
As stated by MS, Windows CE by default uses the fonts as listet next to implement hebrew
Arial (subset 1_08) arial_1_08
Arial Bold (subset 1_08) arialbd_1_08
Courier New (subset 1_08) cour_1_08
Tahoma (subset 1_08) tahoma_1_08
Tahoma Bold (subset 1_08) tahomabd_1_08
Click to expand...
Click to collapse

Related

MSCEInf (Cab Analyser) : in the same vein as ThemeGenCE

Just published yesterday, another program MSCEInf (http://www.codeppc.com/telechargements/msceinf/msceinf.htm)
is a Cab Analyser which show you all the things done if you install a CAB on your PocketPC : Files, Registry settings, shortcuts...
It lets you extract all files with original names and build the inf file as it was build before compiled to CAB.
So you can make changes, if you need it, and rebuild the CAB with the program of Microsoft CABWIZ (installed by Microsoft Theme Generator).
It works with all Cabs (also with TSK which are Cabs with extension changed).
It is still in french! but easy to understand. If you find that it is helpful, i can translate it in "loosely" english !
Like ThemeGenCE, it accepts "Open With" command and Drag and Drop on the window (drag and drop a cab on the opened window).
Friendly, Benoît
Thanks benoit - an english version would be nice - my french is not that good :wink:
English version has been sent to the webmaster of CodePPC 5 minutes ago.
Maybe on line today... or in two months...
Friendly, BenThon
MSCEInf in English
Now available in English !
http://www.codeppc.com/telechargements/msceinf/MSCEInfEn.zip
Friendly, BenThon
Merci bien Benoit pour MSCEInf.
It's a great one.
thx
Re: MSCEInf in English
BenThon said:
Now available in English !
http://www.codeppc.com/telechargements/msceinf/MSCEInfEn.zip
Friendly, BenThon
Click to expand...
Click to collapse
thanks benoit!
Nice app. Very well done.
tip: can you make clicking the column header sorting that column?
Cheers
Yes, it is possible. But I have just sent to the webmaster of CodePPC a version 1.3.8 with "cosmetic" improvements.
Maybe for the next one ...
Friendly, Benoît
Nice app. Very well done.
tip: can you make clicking the column header sorting that column?
Click to expand...
Click to collapse
In which pages do you think it will be useful ?
Thanks
Sorry for the late reply.
I also use your app when checking what is installed. Sometimes the deinstallation of apps is not perfect on ppc.
So sorting on items that I want to remove (files/dirs and registry hives)
would be very useful.
But is sorting when clicking the column header not default? I assume not.
Is it possible to make it extract only selected files from the cab?
Thanks
Sort Tabs
I have just implemented the alpha sort for each columns in each tabs.
I will put in the next version. Thanks for the suggestion !
I can send you this version if you give me a mail.
Friendly, Benoît
New Version of MSCEInf (1.3.9)
New Version of MSCEInf (1.3.9)
Improvements :
1) Alphabetic sort on each column in each tab.
2) New button for choosing files to extract :
Either check the checkboxes for selecting files to extract.
Or Drag and Drop files to the right column of selected files and also the ability to unselect file by Drag and Drop from the column of selected files to the recycled bin.
3) Links, About box...
4) Cosmetics...
MSCEInf Webpage
Thanks benoit - i find myself using this program more and more!
Look forward to future updates :wink:
Thanks.
If you are planning more opstions ;O)
- extract using the full path name (directory structure)
- drag & drop from the Files tab directly (with posibbility to do a selection
with the more (click, ctrl+click etc)
Got an error once reusing the already started program when dropping a cab onto it. It wasn't the cab. Retried it but could not reproduce it.
The error was in french while I use he english version.
Again great prgram. I use it nearly every day now.
Cheers
Nice App,
A super feature would be if you can double Click a file and open it with its associated application or as second option notepad (or favorite editor). so you can have a look inside with extracting all first.
Maybe even save it back afer modifictions or a feature to replace an existing file.
@BenThon
Nice tool, great work!
In the right direction to become a full alternative to 'WinCE CAB Manager', for which author claims 149US$ :evil:
If we could delete/ insert new entries/files directly in your tool and rebuilt the CAB, it would be superb ;-)
Suugestions for MSCEInf
Thanks for your encouragements !
My comments :
1) Extract files with full path name : not difficult to do (maybe later).
2) Drag and Drop from Files Tab : not difficult to do (maybe later).
3) Double click and open files with
- associated application
- Notepad
not difficult to do (maybe later).
4) Delete/Insert new entries and rebuild the cab : more laborious to do. But you can use the rebuild INF file after editing and Cabwiz to rebuild the cab. It is not difficult to do.
Next version of MSCEInf (1.4) is quite finished. Now, the program also read the _setup.xml file and extract all datas in it. It also rebuild a traditional INF file.
PS : Maybe, instead of the 145 $ for Cab Manager, my program will become a Cardware (postcard from your location)...
Work in Progress !
2) Drag and Drop from Files Tab : not difficult to do (maybe later).
3) Double click and open files with
- associated application
- Notepad
Click to expand...
Click to collapse
Points 2) and 3) are now implemented. Will be published with future version !
Point 1) for tomorrow !... Maybe...
building cab files...
anyone out there know of any good tutorials for using cabwiz and building an inf file from scratch? I have looked and looked! Basically I want to build some basic theme cabs and a few cabs that make registry changes and then put them into my extended rom. (I do a lot of experimenting and therefore a lot of hard resets!)
thanks, jess
MSCEInf V1.4 New version on line !
Contributions of version 1.4
This version now allows the reading of the files "_ setup.xml" contained in the CAB :
- Rebuilt the tree structure of file XML with possibility of extending or of reducing branches of the tree.
- Also Rebuilt a conventional INF file (can be copied to the clipboard).
- Creates a Memo (can be copied to the clipboard) with the Register keys in a format of the Regedit type (for the "Geeks").
For the CABS with a conventional INF file like those with a "_setup.xml" file :
- Possibility of "Using Folder Names" for files saving.
- Additional Informations on the files with also possibility of sorting on these new columns :
- Size of the file.
- Date and Hour of the file.
- Type of the file (its extension).
- Possibility of Multiselection on the files (Shift, Control).
- Possibility Drag and Drop for one or more files towards the Explorer (Folder, Desktop...).
- Contextual Menu on the file under the cursor (Right Button) allowing :
- Open the file with the associated application (If it is a program - Extension "EXE" - the launching of the program is prohibited, which is surer. The icon of the program is shown) or "Open with..." if there is no association.
- Open the file with the Notepad.
If MSCEinf is defined as an application for opening CAB, the program will be loaded. If it was minimized, it will be restored.
If the button of Checking of Signature is activated, MSCEInf authorizes 2 signatures ' MSCE ' and ' CE4+ ' and only those (If it is not one of the two authorized signatures, the pointer of the mouse positions on the button of checking of signature after having posted a message of alarm). If not activated, there is no checking of the signature of the CAB.
With this version you can reorder columns in Files Tabs.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
CodePPC Page
MSCEInf Page
English Version
French Version
German Version

RegToXml - Convert registry files to provisioning xml files

Do we need another tool for converting registry files to provisioning XML files? Maybe not, but I wasn't happy with existing solutions, so here's my offering. It runs on Windows (not on Windows Mobile), and will convert any registry data file given to it into a file of the same name, but with a .xml extension.
This is eventually going to be a small part of a larger project I'm working on, but I thought I'd release it now to get any early feedback.
Features:
Command line interface (or just drag and drop the registry file onto the .exe)
Converts Unicode and ANSI file formats: .reg (v4 and v5), .rgu, .cereg
Supports continuing line breaks (lines split with \)
Supports all data types (including REG_BINARY containing non-unicode data)
Supports key and value deletion instructions
Robust to non-fatal failure: informative warnings and errors will be displayed (if run from the command line).
Accessible as an API (to .net apps) - add a reference to the .exe file, then call the static method RegToXml.RegToXml.Convert
The intention is for this to provide bullet-proof conversion of any valid registry files, so I'd really appreciate any bug reports (preferably with a copy of the registry file that failed!). Comments and suggestions welcome too.
Alex
Edit: This tool is now available as part of SDConfigGen, and will no longer be separately updated in this thread.
AlexVallat said:
Do we need another tool for converting registry files to provisioning XML files? Maybe not, but I wasn't happy with existing solutions, so here's my offering.
This is eventually going to be a small part of a larger project I'm working on, but I thought I'd release it now to get any early feedback.
Features:
Command line interface (or just drag and drop the registry file onto the .exe)
Converts Unicode and ANSI file formats: .reg (v4 and v5), .rgu, .cereg
Supports continuing line breaks (lines split with \)
Supports all data types (including REG_BINARY containing non-unicode data)
Robust to non-fatal failure: informative warnings and errors will be displayed (if run from the command line).
Accessible as an API (to .net apps) - add a reference to the .exe file, then call the static method RegToXml.RegToXml.Convert
The intention is for this to provide bullet-proof conversion of any valid registry files, so I'd really appreciate any bug reports (preferably with a copy of the registry file that failed!). Comments and suggestions welcome too.
Alex
.NET Framework (required)
Click to expand...
Click to collapse
Hi alex
I have error with Net CF
what version is required ? I have V2
brunoisa10 said:
Hi alex
I have error with Net CF
what version is required ? I have V2
Click to expand...
Click to collapse
It should be OK with 2.0. Just a thought, you mention .Net CF - are you trying to run this on Windows Mobile? I should have been more specific, this is a Windows (PC) tool for generating xml provisioning files which are then used by SDAutorun.
Alex
I use http://ceregeditor.mdsoft.pl/
Radimus said:
I use http://ceregeditor.mdsoft.pl/
Click to expand...
Click to collapse
So do I, it's a great application! I'm not sure I understand your point, though?
AlexVallat said:
So do I, it's a great application! I'm not sure I understand your point, though?
Click to expand...
Click to collapse
it will export the reg, it will convert to a cab... what else does it need to do?
Radimus said:
it will export the reg, it will convert to a cab... what else does it need to do?
Click to expand...
Click to collapse
It doesn't export to cab, if I read correctly, it exports to *.XML
Exitao said:
It doesn't export to cab, if I read correctly, it exports to *.XML
Click to expand...
Click to collapse
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
CERegEditor can export registry data. Once you have registry data, you may choose to it to a cab using the CERegEditor Convert menu as illustrated above by Radimus. If what you want is a cab file, RegToXml probably isn't what you are looking for.
If you want to convert it to an xml provisioning file, though, I don't believe CERegEditor has that functionality. You can use my RegToXml tool to do that.
Alex
I'm not trying to be difficult, but if we are to assume the cab works as advertised, then the xml is already inside the cab...
winrar or winzip or whatever to extract the cab....
All that aside, it is obviously not the only solution to this process and any efforts by a local dev is nothing but outstanding.
I have just started looking into XML provisioning, I had only done CAB installs previously. If this app will grow into a utility that can manage fileoperations like creating folders, moving/creating shortcuts, and such this will be a very worthy endeavor.
OK, I guess you could use CERegEditor generate a cab file, extract _setup.xml from it, rename it, and edit it to remove the extraneous dummy file copying stuff. I'd suggest that using this tool instead would be easier than that. Of course if what you want to end up with is actually a cab, rather than an xml file, then there's less point to it!
The reason I (personally) want to generate xml files from registry files is for use with SDAutoRun, where they are included in the SDConfig.txt with the XML: statement.
Alex
even a "wizard" type of app, that would create XML provisioning files for email accounts would be a life saver and a standard app for all UC flashers.
New account -> select provider (pop3,ldap,gmail,exchange,etc) -> acctname -> pw -> options -> another acct -> create XML? -> create cab? -> donate 1$
I like the idea. I'm currently working on an SDConfig.txt auto-generator, but once I've finished that, a wizard-based provisioning file editor could be a cool project.
@AlexVallat,
your RegToXml converter does not handle reg-lines which contain "multi-sz", hence it is useless for me.
jwoegerbauer said:
@AlexVallat,
your RegToXml converter does not handle reg-lines which contain "multi-sz", hence it is useless for me.
Click to expand...
Click to collapse
It's been three years... I don't actually even have a windows mobile device any more.
That said, RegToXml should support values of type REG_MULTI_SZ. Check that you are using the latest version (0.6) - if not, it's part of SDConfigGen now. You can just extract RegToXml.exe from the zip file if that's all you want, though.
AlexVallat said:
It's been three years... I don't actually even have a windows mobile device any more.
That said, RegToXml should support values of type REG_MULTI_SZ. Check that you are using the latest version (0.6) - if not, it's part of SDConfigGen now. You can just extract RegToXml.exe from the zip file if that's all you want, though.
Click to expand...
Click to collapse
RegToXML is a Win32 app, hence no mobile device needed. To be on the safe side again downloaded SDConfigGen.0.6.zip and ran RegToXML.exe (06.08.2008, 12 KB) contained in it. Same result, i.e. multi-sz lines not converted. BTW, if you are still interested in your project, the rgu-file I want to get converted is attached.
jwoegerbauer said:
the rgu-file I want to get converted is attached
Click to expand...
Click to collapse
As it turns out, .rgu files are not identical to .reg files. I've had a look around, but haven't been able to find a specification for the .rgu file format, but the "multi_sz:" thing is definitely not compatible with the .reg file format.
It would be nice to be able to support .rgu files too, and if I can get a spec for them I might even update the project to do so, but I can't just assume that they are identical except for multi-strings and then claim support for them.
If you can get your registry data in a .reg file instead of a .rgu, RegToXml will be able to process it.
Alex
AlexVallat said:
As it turns out, .rgu files are not identical to .reg files. I've had a look around, but haven't been able to find a specification for the .rgu file format, but the "multi_sz:" thing is definitely not compatible with the .reg file format.
It would be nice to be able to support .rgu files too, and if I can get a spec for them I might even update the project to do so, but I can't just assume that they are identical except for multi-strings and then claim support for them.
If you can get your registry data in a .reg file instead of a .rgu, RegToXml will be able to process it.
Alex
Click to expand...
Click to collapse
Created with CeRegEditor a .REG-file which contains hex(7) <=> multi_sz lines - I've attached it. Same result as previously reported: Lines containing a hex(7) <=> multi-sz value weren't converted. I give up, thank you for your time.
BTW: the delimiter,terminator for multi-sz values in provxml-files is 
Code:
<parm name="TestValueMultiString" value="string1string2string3" datatype="multiplestring" />
Appendix:
People knowing of MortScript might use this script I created to batch-process the RegToXML converter:
Code:
#RegToXML.mscr
ErrorLevel("warn")
Local()
SetMessageFont(12, "Tahoma")
Path = SystemPath("ScriptPath")
MST = MortScriptType()
If(MST ne "PC")
BigMessage("^NL^This script is intended^NL^to be run at your desktop PC.^NL^Hence you must use^NL^MortScript's PC Version !!!", , FileBase(Path))
Exit
EndIf
BigMessage("Put .REG file(s) in the^NL^\REG_Original directory.", FileBase(Path))
If(FileExists(Path\"REG_Converted\*.reg"))
Delete(Path\"REG_Converted\*.reg")
EndIf
ForEach reg In Files(Path\"REG_Original\*.reg")
SetFileAttribute(reg, "system", FALSE)
SetFileAttribute(reg, "readonly", FALSE)
EndForEach
Xcopy(Path\"REG_Original\*.reg", Path\"REG_Converted", TRUE, TRUE)
idx = 0
ForEach reg In Files(Path\"REG_Converted\*.reg")
idx += 1
RunWait("RegToXml.exe", reg)
Delete(reg)
EndForEach
idx2 = 0
ForEach xml In Files(Path\"REG_Converted\*.xml")
idx2 += 1
EndForEach
BigMessage("" & idx & " file(s) processed^NL^" & idx2 & " file(s) converted", FileBase(Path))
jwoegerbauer said:
Created with CeRegEditor a .REG-file which contains hex(7) <=> multi_sz lines - I've attached it. Same result as previously reported: Lines containing a hex(7) <=> multi-sz value weren't converted. I give up, thank you for your time.
Click to expand...
Click to collapse
I took a look at the .reg file. Firstly, it isn't valid as the value names "\Storage Card\MioAutoRun\Programs\Microsoft .NET CF 3.5\Microsoft .NET CF 3.5.GAC" haven't got the \ characters escaped. I fixed that with a search and replace, but it also looks like the multi-string values contain unicode data, which is also not valid for the reg format. I don't know why CeRegEditor is producing invalid reg files like this.
As you are giving up, though, I won't pursue this any further.
Alex
Cleaning up reg/rgu
Thank you for your tool! I'm still using it in my Kitchen
I want to point out a nice other tool to clean up reg/rgu (delete duplicated stuff, sort it etc.) you and others might be interested in too;
[UTIL] REG/RGU Cleaner
Have fun cooking!
Senax

[Q] Can I rename StartMenu -> Settings

Hello,
To be as short as possible:
I'm trying to cook a Polish ROM out of the dump of a well known WWE ROM around here (of course under a permission of the noble Chef). I managed to find/edit/translate all the neccesary *.mui, *_manila and *.htm files and the outcome appears OK but I have one issue I can't really work out by an easy way. I mean the "Settings" shortcut in StartMenu. I want it to be called "Ustawienia" as it's called in Polish.
I know that the names/paths of several system folders are stored in the package called Base_Lang_0415 which consists of several mui files. I know that the Settings name/path is stored in "shellres.dll.mui".
Now the problem: I got a Base_Lang_0415 from one of Polish chefs but the package changes physical paths to almost all the system folders like
Start Menu -> Menu Start
Programs -> Programy
Settings -> Ustawienia
Favorites -> Ulubione
My Documents -> Moje dokumenty
and many other (i don't even know which ones).
Since I can only work on the ROM dump without any kitchen (and honestly I don't need a kitchen since I only exchange some mui and manila files and add some reg entries - at least up to now), I try to avoid influence on the folders structure. On the other hand I think it doesn't make sense to rename all these folders because an average user will not even notice the change. I want the change only the appearance of the Start Menu and I don't really care about what would be the names of physical folders.
So I started trying to edit only the shellres.dll.mui (with Unsign -> ResHacker -> Sign procedure). First I changed only the string Settings into Ustawienia living the physical path string intact.
But after exchanging the mui file in \Windows\ the Start Menu showed only one icon - Today.
So I changed the name entry and the path entry and changed the physical path of the \Windows\Start Menu\Settings into \Windows\Start Menu\Ustawienia.
But the effect with the new mui was the same and additionally my "Ustawienia" folder has been moved to the Programs folder.
I tested some other combinations of the strings inside mui and physical paths but without any positive effect.
Does some of you know what do I have to do to change only the Settings folder but not to change all the rest?
I understand that you want to do these out of kitchen? I think you should dump an original rom of your own lang and take a look at the initflashfiles.dat. This archive describes the names of windows folders, including Settings
or using a good Mortscript.......
Well, working on dump is not very convinient but as soon as I perform only file/registry operations it's not so bad.
I have the original initflashfiles.dat from stockROM, so I know more less which paths I should change in to new ones. The problem is that everytime my Chef releases new version of his ROM I would have to compare his new initflashfiles with the old initflashfiles for changes and apply the changes manually to the initflashfiles from the stockROM.
But for me it would be the best If I could edit shellres.dll.0415.mui only once changing the name and/or path ONLY for Settings folder, and eventually rename only the Settings folder. Thats a solution I am looking for.
I used MortScript to rename shortcuts inside StartMenu -> Programs. But the problem is that I can run mort i.e. by a config.txt file, but in this moment all the system folders which have the -permdir- attribute in initflashfiles are not moveable or renameable. Also the files inside all the system folders are not deleteable and this means I would have to COPY all the files into new catalogues making the ROM bigger and bigger.
That's why I think I must influence the initflashfiles if I am to use Base_Lang_0415. And this is OK if I would have to modify 1 or 2 paths, but I don't want to modify 25 paths or so...
So my only chance is that somebody would post yet another way to make the Settings appear as Ustawienia (with or without modyfying physical directories).
I don't know how to explain it better because of my English...
Well, i have to agree that Initflashfiles thing is the best way and ,dont worrie, i doubt that your Chef will change Initflashfile for every Rom,even, i never change it from the beginning.
Isn't the initflashfiles a place where are all the files that are indended to be copied/linked to other locations than \Windows\?
That means every new program file or even start menu shortcut will appear in initflashfiles, doesn't it?
Nope.
You can also create Folders in it..little example:
Code:
Directory("\Windows\Start Menu"):-PermDir("Settings")
Skrobel said:
Isn't the initflashfiles a place where are all the files that are indended to be copied/linked to other locations than \Windows\?
Click to expand...
Click to collapse
Nope.
When we import a new program file we have an app.dat file that has inside the instructions to copy files/shortcut over Windows, Initflashfiles its no more touched for that purpose.
Another little example:
Code:
Directory("\Windows\Start Menu\Programs\Tools"):-File("Total Commander.lnk","\Windows\Total Commander.lnk")
This come from App.dat , as you can see it works like Initflashfile.
That means every new program file or even start menu shortcut will appear in initflashfiles, doesn't it?
Click to expand...
Click to collapse
But in case you have to do Hard Reset, all will be lost. And twice...
I think the best option is cook it in first time. Best regards
Well that's what I meant that initflashfiles consists of the paths (directories and files) of all the things we want to put in different folders than \Windows\.
And yes - I want to cook all the Polish files to make it a normal ROM (also after HR).
But in order to clarify:
You Guys say that the only way to rename the Settings in StartMenu is to cook the whole Base_Lang_0415 and to change all the paths in initflashfiles?
Hello all
Sorry for refreshing such an old thread but over a year later I bumped into the exactly same problem.
The only difference is that I use PRB kitchen this time (Jackos's kitchen to be exact).
And all I want to do is to rename the freakin' "Settings" into "Ustawienia" in Start Menu. I thought I found all the references to the Start Menu. I altered the Shellres.dll.0415.mui (responsible for most of system paths), I altered initflashfiles.dat to prepare a permDir in \Windows\Start Menu\Ustawienia, I changed all the keys in registry that I could find...
But still after a flash I have an empty Start Menu with only "Today" link. When I look into the directory structure with Total Commander, everything seems to be OK (all the structure in \Windows\Start Menu\programs is fine) except that my "Ustawienia" folder has been moved from \Start Menu\ to \Start Menu\Programs\
I don't know how, I don't know what else am I missing.
Please help me to get my full translation of the Start Menu...
You're missing "Settings" folder
Actually, full fixing of this stuff isn't that easy, these paths should be hardcodded somewhere (i think so)
Actually it is as easy as it can be.
Made a quick test with Polish language without changing anything and all works as it should.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Well, I've seen Polish ROMs so it actually has to be possible.
@Spiaatie - can you tell me HOW you actually did it?
I see that all the Start Menu links are in Polish on your screenshot. I presume you exchanged at least Base_Lang_0415 package and at least initflashfiles.dat?
Skrobel said:
@Spiaatie - can you tell me HOW you actually did it?
I see that all the Start Menu links are in Polish on your screenshot. I presume you exchanged at least Base_Lang_0415 package and at least initflashfiles.dat?
Click to expand...
Click to collapse
I took 23153 as the Base and all Polish language packages from 28205.
And initflashfiles.dat from [here]
Well... This is a proof that it can be done. However I don't wan't to build up a new ROM. I downloaded Jackos' kitchen just to be able to prepare his ROM in Polish.
Jackos used 21690 for his ROMs as a Base. But actually it is a mixture of packages from many different builds choosen carefully and tested for maximum compatibility and stability.
I want to stay as close to the original as possible except for the language. Honestly I had to prepare many of the .mui files myself because none of the "ready" 0415 build packages worked with Jackos ROM. And now as I have a set of fully working .muis I want to include them into the kitchen (actually I already did it), change any further files I have to change (I copied all the 0409 packages, checked each of them file by file including app.reg, app.dat, provxml etc. altering them basing on files I found in polish packages over the internet). And I bumped into the Start Menu problem.
I will check everything once again but I thought some of you might know where else the paths are stored in the system besides .mui, initflasfiles and the [HKLM\Security\Shell\StartInfo\Start].
There must be a way to change the paths properly...
I finally found a proper copy of shellres.dll.0415.mui. I had to adjust the initflashfiles.dat a bit, and of course paths in all my app.dat. But I have no idea why this shellres.....mui works with this ROM and the other ones doesn't work. The resource structure looks completely the same. All the resource IDs are filled.
Only RCML_DLGDATA section looks differently. I mean the resource IDs are the same, but they have different data. I don't know what and how should I change because everything in there is binary data.
However ultrashot must had been right. The paths have to be hardcoded somewhere else, because in this .mui file the name "Today" is translated differently into "Główny", which directly means "Main". I tried to change this translation, but there are many occurences of this word in this file, and whatever I change in any of it (of course I started with changing all of them) I immediately havethe problem that my Start Menu consists only of the Today link (correctly translated ).
So I left it like it is.
I'm sure however that everythings that concerns Start Menu naming and structure is stored in this single file, because I changed only this file out of the whole Base_Lang_0415 package.
You need to use an mxip_lang.vol that already contains the translation for the call to the settings. Best is to pick one from any shipped ROM of the same version that has your language included.
On smartphone it is settings.lnk, on your device possible settings.cpl (not sure).
Look at the provxml files how other localizations are done and create one in a similar way for your item.
Edit: look at the "Beginners Guide to Windows Mobile (prepare for cooking)" in my signature - you find all the basics for localization there.
Hello Tobbbie,
Thanks for the advice. I read your tutorial many months ago. Actually I kept an eye on your discussion within the OSbuilder thread...
This time I'm almost sure that mxip_lang.vol has not much to do as I have one copy of shellres....mui with which I get "Settings" in my start menu, and I have 2 different versions of the same file which gives me "Ustawienia" (the one I want). So it has to be independent on the other files. The problem starts when I try to adjust the paths myself. It seems like the String resources are somehow connected with binary data stored in this file.
If about the mxip_lang and generally .vol files: do you know how they can be edited by any chance?
Skrobel said:
If about the mxip_lang and generally .vol files: do you know how they can be edited by any chance?
Click to expand...
Click to collapse
Those are databases, that's my clue for you today.
Surprisingly I know!
But that's not a big clue for me. I never had much to do with databases, and in this particular case uncle Google refused to help me...

[PC] DevHealthAnalyzer v2.0 and rpack

I've decided to post these tools here.
rpack - not a ResourcePacker, but the tool that can be used to remove useless sections from resource-only libraries making more memory available for applications.
Usage:
Make a backup of your kitchen
Drag&Drop your *.mui files to rpack.exe. Their size will be reduced.
Make sure you didn't kill USEFUL libraries.
Original thread
DevHealthAnalyzer - memory analysis utility. Can be used to determine the most memory-eating libraries. Then you can reversmod them (yes, reversmodded libraries reserve less ram than recmodded ones) or make r/w sections shared.
Screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
From my experience - it looks like the most popular ROMs have the worst memory management
Original thread
v2.0 (15.05.11):
changed output file format (although, old files still can be opened)
more info
better UI
Download DevHealthAnalyzer v2.0
Great work ultrashot. The DevHealthAnalyzer looks nice. Is the DevHealth that is run on device the on from this thread?
mwalt2 said:
Great work ultrashot. The DevHealthAnalyzer looks nice. Is the DevHealth that is run on device the on from this thread?
Click to expand...
Click to collapse
Yes, it is totally the same. Thanks for pointing - I forgot to attach it to the first post.
Also, what is the significance of the blue, green, and white cells in the output? Does the exe column just show what the dll is tied to? I know next to nothing about this stuff , but it does look like there are some files loaded in slot0 that I should reversemod.
mwalt2 said:
Also, what is the significance of the blue, green, and white cells in the output? Does the exe column just show what the dll is tied to? I know next to nothing about this stuff , but it does look like there are some files loaded in slot0 that I should reversemod.
Click to expand...
Click to collapse
Blue means NULL - unused or reserved areas.
Green means that this memory block is from DumpMap.txt
White cell - from DevHealth log.
EXE column shows exes that use this library at the moment.
Main purpose of this app is that it lets you find which recmodded libraries waste 64 KBs of you slot 0 while they really need less RAM.
Thank you for sharing Ultrashot.
If I understand right I need to run Devhealth on the device but when I do I get a Netcf error.
I'm running Netcf version 3.5.9085.00
Laurentius26 said:
Thank you for sharing Ultrashot.
If I understand right I need to run Devhealth on the device but when I do I get a Netcf error.
I'm running Netcf version 3.5.9085.00
Click to expand...
Click to collapse
You should run devhealth.exe, not devhealthanalyzer.exe
Oh yeeh I didn't realise there where two exe, that's it, thanks again.
ultrashot said:
You should run devhealth.exe, not devhealthanalyzer.exe
Click to expand...
Click to collapse
Laurentius26 said:
Oh yeeh I didn't realise there where two exe, that's it, thanks again.
Click to expand...
Click to collapse
DevHealth is to dump memory map from the device and DevHealthAnalyzer is to Analyze the dumped data on pc.
Copy the text data from mem_X.txt into DevHealthAnalyzer.
@ultrashot; Thanks for the tool. Its very essential.
BTW; is it possible to analyze other slots also? i.e slot1, slot2, slot3 and etc ?
I know Dumpmem has this feature but its slight buggy or like, when used in newer OS cores since it was developed very long time ago for WM2002. Not sure how well it works on newer OS cores.
I guess DevHealth also provides data about other slots but it would be great to see in GUI tools like DevHealthAnalyzer.
Just a query. I'm not that expert in memory maps either.
Thanks...
Best Regards
CRACING said:
DevHealth is to dump memory map from the device and DevHealthAnalyzer is to Analyze the dumped data on pc.
Copy the text data from mem_X.txt into DevHealthAnalyzer.
@ultrashot; Thanks for the tool. Its very essential.
BTW; is it possible to analyze other slots also? i.e slot1, slot2, slot3 and etc ?
I know Dumpmem has this feature but its slight buggy or like, when used in newer OS cores since it was developed very long time ago for WM2002. Not sure how well it works on newer OS cores.
I guess DevHealth also provides data about other slots but it would be great to see in GUI tools like DevHealthAnalyzer.
Just a query. I'm not that expert in memory maps either.
Thanks...
Best Regards
Click to expand...
Click to collapse
In fact, DHA makes maps of all slots because there is no info about slot 0. Then it merges them.
If you create a map you can take a look at info about other processes, but I don't save it in a *.slotmap file as all other slots aren't so interesting.
ultrashot said:
In fact, DHA makes maps of all slots because there is no info about slot 0. Then it merges them.
If you create a map you can take a look at info about other processes, but I don't save it in a *.slotmap file as all other slots aren't so interesting.
Click to expand...
Click to collapse
Yeah you are right.
Edit: BTW; I have too much null spaces and by seeing the posts in asusmobile.ru, AndrewSh said they are memory holes.
Should we correct it and remove those memory holes?
If so please let me know how? sorry for my noob queries!
Just an hour back, I have reversmode'ed few dlls on HTC packages and saved space in Slot0. About 1.3 MB. MAX Amount 24736 KB.
Thanks...
Best Regards
CRACING, while ultrashot is offline for now - I will try to answer
These NULLS normally happen if the library was a file (not module) while cooking and it's loaded without fixed address to slot 0. Try to reversmode all dlls that have NULL space reserved and cook again. Than - make test and you will see that almost all NULLs are gone...
I wanna warn - do not try to reversmode rsaenh.dll - leave it as is. Otherwise you will get unbootable rom.
Normally I have 27484 kb free for Leo at the moment
BTW, if you browse through asusmobile.ru topics - you are welcome to post there your requests and comments in English - we appreciate that
Yeah, I learned about rsaenh.dll the hard way! Took a while to trace it back to that one, that taught me to take baby steps.
I think if you put rsaenh.dll on the do not split list (or do not relocate list, with the proper addresses already set), it may be ok. Or, comment out the 'loadmodulelow' value in your boot.rgu, and it may work as a module. I'll let you try it, though, lol. (Maybe on a rainy day I'll see if I can get it to work for the hell of it.)
AndrewSh said:
CRACING, while ultrashot is offline for now - I will try to answer
These NULLS normally happen if the library was a file (not module) while cooking and it's loaded without fixed address to slot 0. Try to reversmode all dlls that have NULL space reserved and cook again. Than - make test and you will see that almost all NULLs are gone...
I wanna warn - do not try to reversmode rsaenh.dll - leave it as is. Otherwise you will get unbootable rom.
Normally I have 27484 kb free for Leo at the moment
BTW, if you browse through asusmobile.ru topics - you are welcome to post there your requests and comments in English - we appreciate that
Click to expand...
Click to collapse
Hello,
Thanks for your reply.
I though its NULL reserved space for files but NULL space is also below modules. i.e mdpl, htcdevservice, htcgeosrvc and many modules.
Thats why I have confused.
Is it because the modules aren't reloc correctly or those are reserved for the modules which aren't loaded? I'm using OSKitchen to build ROMs.
However, I have attached my last memory map dump. From 1828000 to 18BF000 are files. i.e conncurrencemgr.dll, ntfconfig.dll, notificationmanager.dll, voammbenc.dll, lap_pw.dll, pimdlg.dll and rsaenh.dll
Please have a look...
Thanks...
Best Regards
CRACING, hi!
You can force some of your dlls not to be loaded to slot 0 to release space. That can be performed by sharing r/w sections of modules and files.
I think ultrashot will explain here in the topic how to make that. I don't want to do that because it's his research and his brilliant idea. Besides - he's a real professional and he will do it much better than me.
Anyway - almost all HTC services can be processed to share r/w sections. And thus they will never be dropped to slot 0 on boot.
As I can see from your map - 80 % of your files and modules with NULL can be shared.
We will wait for topicstarter's post concerning the matter. If he does not - I will try to describe how to do that.....
But this process it quite dangerous - you should backup your kitchen before sharing r/w.
AndrewSh said:
CRACING, hi!
You can force some of your dlls not to be loaded to slot 0 to release space. That can be performed by sharing r/w sections of modules and files.
I think ultrashot will explain here in the topic how to make that. I don't want to do that because it's his research and his brilliant idea. Besides - he's a real professional and he will do it much better than me.
Anyway - almost all HTC services can be processed to share r/w sections. And thus they will never be dropped to slot 0 on boot.
As I can see from your map - 80 % of your files and modules with NULL can be shared.
We will wait for topicstarter's post concerning the matter. If he does not - I will try to describe how to do that.....
But this process it quite dangerous - you should backup your kitchen before sharing r/w.
Click to expand...
Click to collapse
That would be awesome. Looking forward...
Thanks a lot...
Best Regards
Meanwhile – the translation of original ultrashot’s explanation at asusmobile:
How to share r/w section:
1. For the file: using LordPE program set flag Shareable on r/w section (C0000040->D0000040)
2. For the module: edit imageinfo.bin – change 402000C0 for 402000D0
All files and modules should be backuped!!! Every modified file/module should be tested separately.
Additional explanation from Barin
For module and file – it’s necessary to change RW section flags (set up additional flag IMAGE_SCN_MEM_SHARED = 0х10000000)
Example: RW section has flags C0002040
It’s necessary to add flag 0х10000000
0xC0002040 OR 0x10000000 = 0xD0002040
How to modify imageinfo.bin from 402000C0 to 402000D0: Calculate the offset to the appropriate flag o32_rom and then edit with any HEX-editor
Module o32_rom structures start at 0х70 address in imageinfo.bin consistently
The structure of o32_rom:
DWORD o32_vsize
DWORD o32_rva
DWORD o32_psize
DWORD o32_dataptr
DWORD o32_realaddr
DWORD o32_flags
That means - the address of the flags of any section will be equal to 0x70 + (0x18 * <section number>) + 0x14
Sections are numbered from zero.
AndrewSh said:
2. For the module: edit imageinfo.bin – change 402000C0 for 402000D0
All files and modules should be backuped!!! Every modified file/module should be tested separately.
Click to expand...
Click to collapse
How to do this?
I checked in IDA and HexEdit. No such things.
AndrewSh said:
Click to expand...
Click to collapse
And could tell me which is this tool?
May be I saw but couldn't remember.
Sorry for noob queries.
Thanks a lot...
Best Regards
CRACING said:
How to do this? I checked in IDA and HexEdit. No such things.
Click to expand...
Click to collapse
I use WinHex - and normally you should look for 402000C0 Hex Value - modify if exists See attached image.
CRACING said:
And could tell me which is this tool?
Click to expand...
Click to collapse
OsBuilder (BTW - the full version allows to share r/w sections of modules and files "on the fly" without modifying original ones and without hex calculators and other sophisticated ****)

Custom 'Desktop (create shortcut)' - Remove .fileextension - Shortcut

Hi guys n girls,
Intro
I am not sure if this is even relevant on here or not? But I figured I should share anyway. Like I mean I don't know how many of you guys use your desktop now that there is the start screen? Or how many of you even use right click menu much but for myself right click is the most used functionality I use in Windows and quite frankly come to expect from other IT systems (web, Linux etc) so this may or may not apply.
Problem/Issue
I have for ever got sick and tired of right click -> open Send to Menu and creating a Desktop Shortcut for a file or app....then needing to go to the Desktop right click the newly made shortcut and then removing the trailing file extension, dash and words shortcut in brackets. If you are like me and you want a solution where you just right click -. Create shortcut and forget and not need to do anymore then look no further.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Solution
I have small AutoIT app (compiled script) that does exactly that.
Desktop (create shortcut).au3 SHA1 - 630A9CE23BF669035EEB089C2948BBD8B38BB505
Desktop (create shortcut).exe SHA1 - 829518AD4233E59D686822D960AAC71405D57CCD
Desktop (create shortcut).ico SHA1 - 16239287978841199F8A2FC56AA36EE55F197083
Download Link Desktop (create shortcut).zip
Virustotal readout - God knows why anyone would use any of the virus scanners flagging AutoIT as a virus. This indicates to me that they are merely only searching for header info and not actually decyphering any of the code. That should be alarming to anyone. Anyway here it is, it gets 2 false negatives out of 52.
https://www.virustotal.com/en/file/...8c0dc26f98e780ae4fc546ed/analysis/1398978188/
Now the code so that you can compile it all your self. For the Geeks in other words
I have commented each part so that those of you just learning or getting a grasp of AutoIT can understand. It is really quite simple however it does take in to consideration a lot of things which many .au3 script writers tend to neglect, such as returning of the proper file extension does not mean StringTrimRight($filename, 4), as it doesn't account for long extension names nor does stopping at a period/point/fullstop.....what happens when a directory has a period? What about names of files that have other periods such as This.is.an.example.file.name.au3
Code:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=Desktop (create shortcut).ico
#AutoIt3Wrapper_Outfile=Desktop (create shortcut).exe
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.10.2
Author: Jarmezrocks
Script Version: 1.0
Script Function: The purpose of creating this was due to an annoyance with Windows 7 where
I was constantly editing the shortcuts created from the right click 'Send To'
create 'Desktop (create shortcut)' where I would need to remove the junk that
Microsoft attached as a postfix i.e. - (short cut) and remove the file
extension as well. E.g. Notepad.exe -> creates a shortcut 'Notepad.exe - (shortcut)'
when what I really wanted created was a shortcut called 'Notepad'
This AutoIT script was created to solve this issue/annoyance.
Usage: Place the compiled exe where ever you like (here's the inception part LOL)
right click the compiled exe and create a shortcut (remember you won't have to do this ever again haha)
rename it 'Desktop (create shortcut)' the same as the Desktop (create shortcut).Desklink
item in the Send To menu.
Locate your Send To menu: Start -> Run -> type this: shell:sendto -> press enter
This opens the directory for your Send To items, likely located somewhere like
C:\Users\<User Name>\AppData\Roaming\Microsoft\Windows\SendTo
Paste the shortcut to the exe here
Note: You will now have a duplicate in the Send To menu, so I advise that you hide the old .Desklink item
Right click -> File Properties -> Hidden
Done!
Test by Right clicking any file and choosing Send To -> Desktop (create shortcut)
Acknowledgements: AutoIT Forums;
User Harlequin for this post/thread -> http://www.autoitscript.com/forum/topic/86839-how-get-file-extension/#entry623386
User Voodooman for this post/thread -> http://www.autoitscript.com/forum/topic/122807-remove-extension-from-the-filenameexample/?p=1110846
Future plans: Following versions (still testing - *I have a bug I need to iron out) should allow the user to double click the executable and
Choose to install it to the Send To context menu and automate the part outlined above in the usage section (hide the old desklink)
and create a shortcut of it's self. It should do checking so that if the user double clicks the exe again it checks for either the
existing Desklink extension or the shortcut.lnk and prompt the user if they want to remove it and restore the original Windows functionality.
#ce ----------------------------------------------------------------------------
Global $Input = $CmdLineRaw ; Obtain the selected file full path (name of file and location) as a string parsed as a command line parameter i.e %1
Global $LinkFileName = RemoveExt(GetFileName($Input)); Generate the file name from the input using the following functions
; These are pretty self explained - Thanks Voodooman (You may have necro-bumped an expremely old thread created by n00b years before who has now become a developer but we all forgive you - your post is valid)
Func RemoveExt($Input)
Local $ExtArray = StringSplit($Input, ".")
Return StringReplace($Input, "." & $ExtArray[$ExtArray[0]], "", -1)
EndFunc ;==>RemoveExt
Func RemoveExtRegExp($Input)
Return StringRegExpReplace($Input, "\.[^.]*$", "")
EndFunc ;==>RemoveExtRegExp
Func GetFileName($Input)
Local $PathArray = StringSplit($Input, "\/")
Return $PathArray[$PathArray[0]]
EndFunc ;==>GetFileName
; Importance of the following. As pointed out by Harlequin using any StringRightTrim methods of obtaining the extension doesn't account for several things
; "." can located in the path of a folder name and "." can appear more than once within files or folders i.e What would one do when trying to return
; the extension of a html file or any other long extension file type?
Func CreateLink()
If $CmdLineRaw Then ;Check if it's a command parameter i.e. %1 or path to the file you want a shortcut made for
For $YLoop = StringLen($CmdLineRaw) To 1 Step -1 ; Loop through the all of the "." in the path and string from the last "."
If StringMid($CmdLineRaw, $YLoop, 1) == "." Then
$Ext = StringMid($CmdLineRaw, $YLoop) ; Generate the extension type
$YLoop = 1
EndIf
Next
Local $Type = RegRead("HKEY_CLASSES_ROOT\." & $Ext, "") ; Look up the type from the registry to find the application
Local $FileName = $CmdLineRaw
Local $LnkFileLocate = (@DesktopDir & "\" & $LinkFileName & ".lnk"); Here is the working part - Generate the Desktop shortcut from the derived file name
Local $WorkingDirectory = ""
Local $Icon = RegRead("HKEY_CLASSES_ROOT\" & $Type & "\DefaultIcon", ""); Derive the file type icon from the registered application
Local $IconNumber = 1
Local $Description = "" ; I decided to leav this blank
Local $State = @SW_SHOWNORMAL ;Can also be @SW_MAXIMUM or @SW_SHOWMINNOACTIVE or even @SW_HIDE
If Not FileExists($LinkFileName) Then ;Check there isn't already as shortcut
FileCreateShortcut($FileName, $LnkFileLocate, $WorkingDirectory, "", $Description, $Icon, "", $IconNumber, $State); Generate the shortcut
EndIf
EndIf
EndFunc ;==>CreateLink
CreateLink() ; Execute the Function
Thanks for sharing. I can't say I've ever actually done this - leaving aside the fact that I don't use the desktop to store things much, if I were to do so I'd be more likely to use mklink instead of the context menu (I use the command line *way* more than I use any Metro app, and nearly as much as I use the desktop with a mouse) - but it's good to have solutions, and it'll probably help somebody. I just tried creating such a shortcut and I agree the added name stuff is annoying.
Thanks mate
Well, I tend to post things more so for the discovery. To me it was more fascinating working out the code to use to solve the issue rather than the issue it's self. Like when you think about it, the research and time that went into developing the code to generate the shortcuts to save time probably took longer than what it would take to correct a million shortcuts....but that's beyond the point. IMHO we as people should change how we do things if we learn that there is a better way. It takes sharing your discoveries with others before the true benefits are realised.
There is a long-known small software that allows you to do just what you wanted and more, with a simple and user-friendly GUI.
You can find it on google looking for "vista shortcut overlay manager" aka fxvisor.
It allows you to replace or remove the arrow on the shortcut icons and to remove the "- Shortcut" extension, permanently (you can uninstall the program after you've done".
It was originally designed for Windows Vista, but works just great even on 7 and 8/8.1. Just download it accordingly to your 32 bit or 64 bit Windows version (32 bit version doesn't work on Windows-x64 and vice-versa).
Uncle Scrooge said:
There is a long-known small software that allows you to do just what you wanted and more, with a simple and user-friendly GUI.
You can find it on google looking for "vista shortcut overlay manager" aka fxvisor.
It allows you to replace or remove the arrow on the shortcut icons and to remove the "- Shortcut" extension, permanently (you can uninstall the program after you've done".
It was originally designed for Windows Vista, but works just great even on 7 and 8/8.1. Just download it accordingly to your 32 bit or 64 bit Windows version (32 bit version doesn't work on Windows-x64 and vice-versa).
Click to expand...
Click to collapse
This only does what the registry edit above does. It still does not replace the file extension attached on the end. And one may as well edit for one as they would do for all. Back to square 1. Thanks for the pointer though I did already know about these guys and have used their app before, some other forum member might find this valuable.
I don't understand.
The "Vista Shortcut Manager" program worked for me, on my Windows 8.1 32 bit.
It DOES remove the "- Shortcut" extension when I create desktop shortcuts.
Uncle Scrooge said:
I don't understand.
The "Vista Shortcut Manager" program worked for me, on my Windows 8.1 32 bit.
It DOES remove the "- Shortcut" extension when I create desktop shortcuts.
Click to expand...
Click to collapse
Aggggghhhhhh :silly: DW
What I meant was...
What about the file extension?
notpad.exe normally goes to -> notepad.exe - Shortcut
With "Vista Shortcut Manager" (the same registry edit mentioned by another member)
notepad.exe goes to -> notepad.exe
I still then need to double long click or right click shortcut properties and remove .exe from the end.
What I want then is this
notepad.exe goes to -> notepad
"Vista Shortcut Manager" doesn't remove the .exe off the end of the shortcut it created, it only removes "- Shortcut" from the end. In other words, if one has to go to the shortcut created, right click and edit the shortcut and remove ".exe" or (insert any file extension here) then what is the point?
If I have to edit the shortcut to do that, then I may as well edit the shortcut to remove ".exe" AND "- Shortcut" at the same time! The idea behind this was to create shortcuts that require no additional 'touch ups' no edits or changing in anyway.
If you're happy to have the file extension left on the end of the file you created a shortcut from then that's fine; this is probably not aimed at you.
But yes thank you for pointing out that helpful app for other people that want the functionality without needing to know why/how etc.....which kind of goes against what XDA is all about. XDA is about developers sharing code, ideas, mods to various devices and computers that we can test, trial, give feedback, improve or just plain use in everyday life.
Again....this isn't specifically about the shortcut nor the desklink applet that creates them, this is more about the code that I posted, and how it 'could' potentially assist other developers who are doing something of their own that might be using say hmm get file extension of some file....say a smali file (which is denoted by a 4 character length as opposed to the more traditional 3 character length like apk) and allowing developers to "recycle" a single function that works for all file extensions rather than write a block of code for each instance. They may do this using AutoIT, or they may look at my code and see how this can be translated (with ease) to work with other languages such as C# and so forth.
Anyway I hope this makes more sense to you now?
Solution unavailable
The link to your solution on Dropbox returns 404 unavailable.

Categories

Resources