Hardreset - delete files ? - Windows Mobile Development and Hacking General

Hi,
I have created a new ROM for my kaiser with some more apps - so far so good.
During the customization I am installing 3 more CAB (with autorun and config.txt), but unfortunately I have not found any command to delete these CABS after installation.
AFAIK config.txt only supports the following commands:
LOCK: Enabled lock the device so no user action is possible
CAB: \Extended_ROM\... install a CAB file use
EXEC: \Extended_ROM\... execute a file
CPY1: \Extended_ROM\sourcefile specify source for copy command
CPY2: \windows\targetfile copies CPY1 file to target
XML: \windows\... execute a provisioning XML file
LOCK: Disabled unlocks the device
RST: Reset execute a reset at the end
CFG: \Storage\Config2.txt include configuration from another file e.g. Config2.txt (same syntax as Config.txt)
HIDE: Enabled hides the autorun screen so that user interaction can take place.
HIDE: Disabled shows the autorun screen after user interaction.
SHOW: \Extended_ROM\...
But this does not give me the chance to delete a file.
Any suggestion ?
Regards
kuzco

create a mortscript to delete the files, call it with EXEC. If EXEC only allows .exe file then use the autorun.exe feature in mortscript to call the script.

Ever tried a search?
Found the solution in 10 secs...

Related

config commands

hi to all
I managed to open the extended rom on my iMate using exteded rom tools
I even added files (*.CAB) in it and added them into the config file to install them automatically each time I make a hard reset.
My problem now is this:
I have a file that I copied into extended rom and I want it to be copied to (let us say) "\windows\" directory. Is there such a copy command in config file that i can add it to the command lines in config file? And if so what is the correct syntax
Thanks
there is.
Search in the forum.
It is smt like
CPY1: on one line indicating source
CPY2: on next line indicating target
Why dont you make a CAB file in which you can do whatever you want?
Nice thing of a CAB file is that the action will be registered (as an installed program!)
do you mean like :
cpy1: \extended_rom\kk.exe
cpy2: \windows\
to move the file kk.exe from the extended rom directory to the windows directory
and how can i read about making cab files and with which program
I have been using Win CE cab manager to make cabs, it's a great program, but the trial will only run 10 times.
http://www.ocpsoftware.com/products.php?nm=cecabmgr
andit is too expensive for me to buy... ($146)
So I have been using it sparingly to save my free goes.
to move the file kk.exe from the extended rom directory to the windows directory will look like this
cpy1: \extended_rom\kk.exe
cpy2: \windows\kk.exe
did not work
hi
i have tried the command cpy1, cpy2 to copy files within extended rom, but the files were not copied, do you have any idea why?
i am sure that i typed the path and the filename correct
thanks

Deny or restrain installation of applications WM5

I want to deny or restrain installation of applications on the fly as an service/process or by making changes in the registry on WM5 devices. Any ideas? The app preferely in C++/C#
CAB files are installed by wceload.exe in the windows directory.
You can overwrite this file with a blank exe, or remove the CAB extension reference to it in registry under HKEY_CLASSES_ROOT.
Deny or restrain inst. of apps
Thanks, yes I've thought about this - but this isn't a very dynamic solution. When a person run a CAB I want to check if app is okay to install from a "List" - then show a popup with a message saying something like "Sorry, you are not allowed to install this application. Please contact your company IT Admin for more info".
Is the .CAB association in HKEY_CLASSES_ROOT linked to wceload - so I could run an app to validate CAB, and if ok execute wceload..?
levenum said:
CAB files are installed by wceload.exe in the windows directory.
You can overwrite this file with a blank exe, or remove the CAB extension reference to it in registry under HKEY_CLASSES_ROOT.
Click to expand...
Click to collapse
Write up a registry entry in HKEY_CLASSES_ROOT to associate .CAB files with your custom file. Then, when the user taps on a CAB file, your program reads it, compares it against its list and, if it's approved, calls WceLoad with the appropriate parameters.
The key would probably look something like this:
HKCR\cabfile\shell\open\command
(default) = "<path to your app>" "%1"
(%1 will be replaced with the path to the CAB file).
Then, if the CAB was approved, call WceLoad with the following parameters:
\windows\wceload.exe "<path to cab file>" /nodelete
Note that some apps, may call wceload.exe directly. I am not sure if Activesync does it, but I know a couple of custom installers that do.
If you really want to secure the device against unothorized software do the following:
Rename wceload.exe to something else like wceload1.exe.
Create you own wceload.exe, but make sure you capture and preserve all command line parameters in case you need to transfer them to the original file for proper installation.
This way you can be sure no one will install anything without your permission.
Olso, keep in mind wceload is used to switch themes as well. (It handles *.tsk files).
Very much..
Thank You all!!

OziExplorerCE: Registration key reset turning off the GPS

Hello,
I installed OziCe in my GPS Invion (wince 4.2 loaded from SD card). It
works fine but, every time I turned on the GPS, OziCE asks to re-enter
the registration code. All the other configuration are correctly
reloaded, togheter with last used map.
No problem exiting and restarting OziCE, when the GPS remains active.
It seems that OziCE saves the registration code in same 'volatile'
memory, not flashed at hard shutdown.
I tried to check the registry, comparing them with remote tools before
and after starting OziCE, but I foung nothing.
Does anyone know a way to solve or workaround the problem?
Thanks, Filippo
Found a solution
Hello,
for who may be intersted, I found a way to workaround the issue writing a MortScript (download the interpreter and instructions from http://www.sto-helit.de/).
This is the script I wrote; obviously you have to change the OziCE username and password and the path to OziExplorerCE.exe.
After insatalled and registered MortScript, copy the script in a .mscr file in the device. Executing the script would start OziCE inserting the registration code (if needed).
Ciao.
#OZI CE start
regName = "MyOZICeUserName"
regKey = "MyOZICeRegistrationCode"
WindowTitle="Inserisci Codice di Registrazione"
EngWindowTitle="Enter Registration Code"
OKWindow="OziExplorer"
ozipath = "\SDMMC DISK\WINCE\programfile\ozi_1.12.3\COMMON\OziExplorerCE.exe"
nLoops = 200
Run(ozipath )
#WaitFor(WindowTitle, 5) #returns timeout error if not found...
i=0
While ((ActiveWindow() ne WindowTitle AND ActiveWindow() ne EngWindowTitle) && i<nLoops)
Sleep(50)
i=i+1
EndWhile
if (WndActive(WindowTitle)=1 OR WndActive(EngWindowTitle)=1)
actWin = ActiveWindow()
SendKeys(actWin, regName)
SendTab(actWin)
SendKeys(actWin, regKey)
SendCR(actWin)
#WaitFor(OKWindow, 5)
i=0
While (ActiveWindow() ne OKWindow && i<nLoops)
Sleep(50)
i=i+1
EndWhile
if (WndActive(OKWindow)=1)
SendOK(OKWindow)
EndIf
EndIf
using mortscript to enter OZICe on a windows CE 4.2 device
Filippo, nice work!
That mortscript you wrote works a treat on my navigation box.
I was unable to work out how to do a cab instal of mortscript. My navigation box won't start .cab files. So I need to run the bin:version of mortscript first for the Device binaries (whatever that means) and then I can run your mortscript. Love watching mortscript typing in my name and code.
OziCe now asks for ECW.dll - where does that file come from and where should it be? in windows? in storage card root? in oziexplorer folder on storage card? in nandflash?
OziExplorerCE: Preventing registration key reset turning off the GPS
Please apologize warming up this thread, but thought I'ld share my solution here.
1. OziExplorer stores user-registration data in file named 'gihobj.dll' in OS's folder \Windows.
2. Hence you backup once this 'gihobj.dll' , then always copy it to \Windows before you start OzExplorer.
I suggest to use a wrapper script as following to start OziExplorer:
Code:
#OziExplorer Launcher
#This script must be located in OziExplorer's installation folder
#or you have to alter the OziExplorer 'ozipth' below!
Local()
ozipth=SystemPath("ScriptPath")
oziexpl="OziExplorerCE.exe"
regdata="gihobj.dll"
winregfile="\Windows\"&regdata
bkupregfile=ozipth\regdata
#check existence of registration data
If(FileExists(winregfile))
#OK, run OziExplorer
Run(ozipth\oziexpl)
ElseIf(FileExists(bkupregdata))
#OK, but in wrong folder, hence copy registration
#data to \Windows, then run OziExplorer
Copy(bkupregdata,winregdata,1)
#wait max. 2 secs
cnt=0
While((NOT FileExists(winregdata))&&(cnt<20))
cnt+=1
Sleep 100
EndWhile
Run(ozipth\oziexpl)
Else
#not OK, hence start OziExplorer with entering user-registration data
RunWait(ozipth\oziexpl)
#backup OziExplorer's registration data
If(FileExists(winregdata))
Copy(winregdata,bkupregdata,1)
EndIf
EndIf
HTH
OziExplorerCE: Preventing registration key reset turning off the GPS
Hello,
I have an old pda with WindowsCE 2002 installed.
Can everyone drive me applying the suggest of jwoegerbauer?
I can't find the file 'gihobj.dll' I think because I don't see the hidden files so:
1. how can I see the hidden files.
2. how can I create the script file? is it a batch file?
many thanks at all,
mimmolo
mimmolo said:
Hello,
2. how can I create the script file? is it a batch file?
mimmolo
Click to expand...
Click to collapse
All you need is MortScript: http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view&menu=29

How to set a pic as wallpaper in CONFIG.TXT?

Anyone know the command please!
Thanks a lot
Code:
LOCK:Enabled lock the device so no user action is possible
CAB: \Extended_ROM\... install a CAB file use
EXEC:\Extended_ROM\... execute a file
CPY1:\Extended_ROM\sourcefile specify source for copy command
CPY2:\windows\targetfile copies CPY1 file to target
XML: \windows\... execute a provisioning XML file
LOCK:Disabled unlocks the device
RST: Reset execute a reset at the end
CFG: \Storage\Config2.txt include configuration from another file e.g. Config2.txt (same syntax as Config.txt)
HIDE:Enabled hides the autorun screen so that user interaction can take place.
HIDE:Disabled shows the autorun screen after user interaction.
SHOW:\Extended_ROM\... shows the image specified as the background to AutoRun. Must be a bmp.
TSK: \Windows\... Makes a theme the default theme. Works on Diamond/Raphael shipped AutoRun only!
zd_lc said:
Anyone know the command please!
Thanks a lot
Code:
LOCK:Enabled lock the device so no user action is possible
CAB: \Extended_ROM\... install a CAB file use
EXEC:\Extended_ROM\... execute a file
CPY1:\Extended_ROM\sourcefile specify source for copy command
CPY2:\windows\targetfile copies CPY1 file to target
XML: \windows\... execute a provisioning XML file
LOCK:Disabled unlocks the device
RST: Reset execute a reset at the end
CFG: \Storage\Config2.txt include configuration from another file e.g. Config2.txt (same syntax as Config.txt)
HIDE:Enabled hides the autorun screen so that user interaction can take place.
HIDE:Disabled shows the autorun screen after user interaction.
SHOW:\Extended_ROM\... shows the image specified as the background to AutoRun. Must be a bmp.
TSK: \Windows\... Makes a theme the default theme. Works on Diamond/Raphael shipped AutoRun only!
Click to expand...
Click to collapse
Why don't you set a wallpaper in a reg file or a rgu file?
(don't know which key and slot, but that would be pretty easy to find)
Really!? can it work?
I change the app.reg file
It dont work at all
why?

config.txt - autorun or RunCC - customization

tighter specifications for config.txt and other customizing files
big sorrow, my huge and complicated customization failed on new rom.
after a dozen reflashing I finally located problem.
IN NEW ROMs, there is "RunCC" app which completely replaces "autorun" (autorun.exe and associates are not present)
- "RunCC" is by default using script files, with the same names as were in ROMs customized by "autorun" (config_operator.txt, config.txt...)
- commands used in script files in "RunCC" are compatible with commands from "autorun", but many are not supported, look below
why we need customization on the first place?
- as our custom roms are already customized of course, we don't need it for the same reason as it was meant to be used,
but as customization is executed right after initialization of a new rom, and before any of other startup apps or today screen plugins that's making it a good tool for running little scripts with user choices, or programs registering scripts, or registry, notification, file changes.
advantages of RunCC:
- more flexible for operators, OEM companies, and parties doing customization
if there is bug in one of script txt files, (or it's missing) customization will continue with next file
every operator has assigned it's config*.txt file, now if one have bug, other would still run
- change priority for executing script files
- can execute config*.txt files from SD cards without custom made sdAutoRun.exe
* well, except the option of running SD configs, there's isn't much advantage in all this for us cooks, as there is only one customizer-the cooker
disadvantages:
- not supporting HIDE: and LOCK: commands - not possible to use with user-input type customizing apps
- can't redirect script files to each other (command CFG
files to be run are defined in special file (with kind of basic C++ commands): RunCC.lua
this could lead to possible conflict with creating file of the same name + troubles if someone like me is trying to use his own config_papo.txt script file, like he was used to. This leads to personal damage in wasted time, electrons and burned out nerve cells
==================================================
scheme as scripts are usually executed by "autorun" customization:
[HKEY_LOCAL_MACHINE\COMM]
"AutoRunCFG"="\\Windows\\<config>.txt"
* not applicable with RunCC
|
v
config_operator.txt
|
v
config_PT.txt
|
v
config_AP.txt
|
v
config_end.txt
|
v
config.txt
last line in every file have to contain "CFG: \windows\<next_cfg_file>.txt
last one should contain:
LOCKisabled
RST: Reset
* disabling lock on end should make next start complete (without need to start by clicking on start)
==================================================
by "RunCC" customization:
RunCC.lua file: defines all possible script (config*.txt) files, and priorities of excuting with parameter:
RunDefault, RunExtra, RunCustomer (I didn't check on the order, I suppose 'RunDefault' is first)
by default, all script files, as you can see them above are defined, if you use any of them, your commands will be executed, if you use file with different name it won't even if you try to redirect by CFG: command (need to edit RunCC.lua)
CFG:, LOCK:, HIDE: is ignored with RunCC
==========================================
commands:
LOCKisabled -- enable user input (it's semicolon followed by big D letter of course. don't put smilie there like it's shown here)
LOCK:Enabled -- disable user input
HIDE:Enabled -- hides windows logo, background process could be seen HIDEisabled -- covers it back
* if only HIDE:Enabled, status will still not show running program name - if you running scripts which calls on app names, you need LOCKisabled too for them to work
* HIDE: pair (maybe LOCK as well) can't be used twice in one txt file (process would stop)
* LOCK & HIDE don't work with the new autorun
CAB: \windows\... --- install CAB
EXEC:\windows\... --- exe file
XML: \windows\... --- provisioning XML file
CFG: \Storage\Config2.txt --- continue with another autorun, txt file. need to be specified on the last line
TSK: \Windows\... --- theme tsk (not working in all versions of "autorun", not with RunCC)
FILEOP:\windows\... --- New format for file operations files (it's possible it only works with RunCC)
CPY1:\windows\source --- copy (source file)
CPY2:\windows\folder\target --- copy (target file)
RST: Reset --- perform reset
SHOW:\windows\... --- shows custom image file during process. Must be BMP
* note that three letter commands have space after semicolon, in new version of autorun it's not needed, but why not rather using it.
* first file (usually config_operator.txt) is unicode, the rest of it is usually ansi, but could be unicode as well.
* common mistake is using parameters - NOT ALLOWED
* spaces - SDAutorun can handle them (I didn't test for "autorun")
if you need parameters, call mortscript's renamed autorun.exe file which would call the same named script where you could put RUN command with program name and parameters
---
SDAutorun:
you can continue, on SD card having your cab files there to be installed after flashing someone's custom ROM, his ROM has to be "comatible". That is done by adding "sdautorun.exe" and command EXEC:\windows\sdautorun.exe in script file.
(search for sdautorun)
==================
My conclusion is, we don't need RunCC and we want back our old good "autorun"
1. disable RunCC ext package
2. download "autorun" attached to this post. it consist of three EXTs. include all three of them
3. in "Autorun" EXT I added reg entry to disable "RunCC" as this is being run in "init" section which is organized with chaotic style by assigning random numbers 1-100 to each app and hoping to not hit the same twice, you need to check with your rom if RunCC has the same as in my case: 58
if you don't remove entry to run "RunCC", nothing wrong would happen, it's just not healthy in general to have shortcuts to nonexistend exes to be run every start.
I am working on the attachment. will add it later today/tomorrow
Interesting info thanks could you please upload some examples as this is all new to me
Many thanks [email protected]
sure, still trying to get more from it. then I'll upload that substitutive autorun I promised before.
examples.. you can find it in your phone, search config*.txt files in windows folder
or for runCC the file: runcc.lua - windows folder or
in OEM - ControlBlock

Categories

Resources