[Help] With a mortscript in Startup and deletion - Windows Mobile

I have a mortscript called 2bootEndKeyTheme.mscr and a app.dat moves this shortcut.lnk to startup.
This is the script:
Code:
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "boot_comm_vibrate.brn", "\Windows\boot_comm_vibrate.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "data.brn", "\Windows\data.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "reset.brn", "\Windows\reset.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "shutdown.brn", "\Windows\shutdown.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "sense.brn", "\Windows\sense.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "bootloader.brn", "\Windows\bootloader.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "vibrate.brn", "\Windows\vibrate.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "comm.brn", "\Windows\comm.brn" )
#Delete("\Windows\StartUp\2bootEndKeyTheme.lnk")
The problem is with the last line I guess? If I remove the # so it's active then after second boot I have nothing left in my Windows\Startup folder. Everything is deleted.
How can I delete only this file and not everything else in my startup folder?

bobsbbq said:
I have a mortscript called 2bootEndKeyTheme.mscr and a app.dat moves this shortcut.lnk to startup.
This is the script:
Code:
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "boot_comm_vibrate.brn", "\Windows\boot_comm_vibrate.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "data.brn", "\Windows\data.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "reset.brn", "\Windows\reset.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "shutdown.brn", "\Windows\shutdown.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "sense.brn", "\Windows\sense.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "bootloader.brn", "\Windows\bootloader.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "vibrate.brn", "\Windows\vibrate.brn" )
UnzipFile( "\Windows\Touch_Of_Glass.zip" , "comm.brn", "\Windows\comm.brn" )
#Delete("\Windows\StartUp\2bootEndKeyTheme.lnk")
The problem is with the last line I guess? If I remove the # so it's active then after second boot I have nothing left in my Windows\Startup folder. Everything is deleted.
How can I delete only this file and not everything else in my startup folder?
Click to expand...
Click to collapse
hai bob may be this one
Delete( "\windows\Startup\2bootEndkeyTheme.lnk" )
in my kitchen i use this
Delete( "\windows\Démarrage\PKG.lnk" )
Delete( "\windows\Démarrage\poutlook.lnk" )
i think there is a gap between the bracket and ".......

shafizal said:
hai bob may be this one
Delete( "\windows\Startup\2bootEndkeyTheme.lnk" )
in my kitchen i use this
Delete( "\windows\Démarrage\PKG.lnk" )
Delete( "\windows\Démarrage\poutlook.lnk" )
i think there is a gap between the bracket and ".......
Click to expand...
Click to collapse
I tried this but it still deletes everything in the startup folder. Thanks for the help

Well I found a dirty work around but would like to know if there is a more proper way.
I renamed the files to z2bootEndKeyTheme.lnk and they worked.
But when I tried using your Example above for PKG it deleted everthing below it.
So it seems that it deletes anything after the Delete entry. Before it was appearing first in the list so it deleted everything. Now it is last so only it is deleted.
Please if I'm using the mortscript wrong or if someone knows of another way please let me know.

Try this one:
Code:
If (FileExists("\Windows\Start Menu\2bootEndKeyTheme.lnk"))
Delete("\Windows\Start Menu\2bootEndKeyTheme.lnk")
EndIf
For reference http://www.sto-helit.de/forum/viewtopic.php?f=12&t=5509

bobsbbq said:
I have a mortscript called 2bootEndKeyTheme.mscr and a app.dat moves this shortcut.lnk to startup.
The problem is with the last line I guess? If I remove the # so it's active then after second boot I have nothing left in my Windows\Startup folder. Everything is deleted.
How can I delete only this file and not everything else in my startup folder?
Click to expand...
Click to collapse
Try this:
Code:
Delete(SystemPath("Startup")\"2bootEndKeyTheme.lnk")

bobsbbq said:
I have a mortscript called 2bootEndKeyTheme.mscr and a app.dat moves this shortcut.lnk to startup.
Click to expand...
Click to collapse
There is something I didn't understand...
Do you move the file 2bootEndKeyTheme.mscr to StartUp
or create a shortcut 2bootEndKeyTheme.lnk there?
Anyway, you could try adding this line before deleting:
Code:
SetFileAttribute( "\Windows\StartUp\2bootEndKeyTheme.lnk", "system", FALSE )
Regards!

kokotas said:
There is something I didn't understand...
Do you move the file 2bootEndKeyTheme.mscr to StartUp
or create a shortcut 2bootEndKeyTheme.lnk there?
Anyway, you could try adding this line before deleting:
Code:
SetFileAttribute( "\Windows\StartUp\2bootEndKeyTheme.lnk", "system", FALSE )
Regards!
Click to expand...
Click to collapse
There is just a shortcut in startup.
Thanks for the extra examples I will try them out soon.
I have tried all of the above things, and if I delete a entry in startup everything after that entry it is deleted also.
I don't know why?

bobsbbq said:
I have tried all of the above things, and if I delete a entry in startup everything after that entry it is deleted also.
I don't know why?
Click to expand...
Click to collapse
Are you using the latest version (the one I am aware of is 4.3b15)?
Long shot, but do you have Extendir cooked in? Maybe this is an extendir issue...
You could try moving the script and not the shortcut to StartUp and see what happens when you make the script delete itself.
For example:
Code:
SetFileAttribute( "\Windows\StartUp\2bootEndKeyTheme.mscr", "system", FALSE )
Delete("\Windows\StartUp\2bootEndKeyTheme.mscr")
sleep(1000)
UnzipAll("\Windows\Touch_Of_Glass.zip"", "\Windows")
Regards!

kokotas said:
Are you using the latest version (the one I am aware of is 4.3b15)?
Long shot, but do you have Extendir cooked in? Maybe this is an extendir issue...
You could try moving the script and not the shortcut to StartUp and see what happens when you make the script delete itself.
For example:
Code:
SetFileAttribute( "\Windows\StartUp\2bootEndKeyTheme.mscr", "system", FALSE )
Delete("\Windows\StartUp\2bootEndKeyTheme.mscr")
sleep(1000)
UnzipAll("\Windows\Touch_Of_Glass.zip"", "\Windows")
Regards!
Click to expand...
Click to collapse
Well I do have Extendir cooked in. Maybe RoryB could try as I know he also uses it.
I will give this a try as well.

Related

Backup & Restore your Cemail.vol easily

Hi,
first af all I would like to say that i'm not a developer!I just build a little app
to facilitate our every day life.
Then I would like to say that i won't be responsible on any damage that little app could do.
So I made a little App to backup and restore your cemail.vol (containing your SMS or text messages) easily.
It's based on mortscript app (which is very very great).
Installations Steps:
-Unzip B&R on your Ppc (Internal Memory or Storage card As you want)
-Run "MortScript-4.0-PPC.cab" (install it in internal memory or storage card should work for both)
-And at least run "Back&Restore.mscr"
You'll be prompted if you want to backup or restore
and then you'll be prompted again if you want to restart your device or no.
As the backup or restore work at the starting of the device if you know what you are doing I suggest to reply yes, otherwise nothing will backuped or restored.
For those who are interested in this is the source of this little app:
Code:
errorlevel ("warn")
Choice( "SMS B&R","Restore or Backup","Backup","Restore" )
Case( 1 )
Startup = Regread ("hklm" , "System\Explorer\Shell Folders" , "Startup")
back = "XCopy \cemail.vol , ""\Storage Card"" , 1"
delb = "delete " & "(""" & Startup &"\backup.mscr"")"
delete (Startup &"\restore.mscr")
delete (Startup &"\backup.mscr")
WriteFile( Startup & "\backup.mscr" , back & "^CR^^LF^" & delb ,1 )
Case( 2 )
Startup = Regread ("hklm" , "System\Explorer\Shell Folders" , "Startup")
rest = "XCopy ""\Storage Card\cemail.vol"" , \ , 1"
delr = "delete " & "(""" & Startup &"\restore.mscr"")"
delete (Startup &"\backup.mscr")
delete (Startup &"\restore.mscr")
WriteFile( Startup & "\restore.mscr" , rest & "^CR^^LF^" & delr ,1 )
Case( 0 )
Message( "Cancel" )
Exit
EndChoice
Choice ("Reset", "Do you want to restart de device?","no","yes")
Case( 1 )
Message ("Be careful : Backup or Restore Cemail.vol only work if you soft reset your device")
Case( 2 )
reset
Case( 0)
Message ("Be careful : Backup or Restore Cemail.vol only work if you soft reset your device")
exit
EndChoice
Bye
Herc.
Thanks for this, been wanting to backup cemail.
I've tested it briefly on my HP RX1950, but nothing is created after restart. I've tried with a few different storage cards but no luck. Any ideas?
As you can see file creation refers to Startup(folder) Value in Registry.
So it can be 2 things
1-The startup folder is not in the same place as mine in the registry (but I doubt about that)
2-The Mapi services which use the file cemail.vol start before my script.
So to check that, launch the backup but don't restart the device and go look
into \windows\startup to see if there is a file called Backup.mscr, if yes open it with a notepad and send me the content of the file.
I'll try later to make a log script file to debug these kind of problems
Bye
Herc.
Well the startup folder is in the correct place in the registry, and backup.mscr is in the startup folder.
The contents is as follows;
XCopy \cemail.vol , "\Storage Card" , 1
delete ("\Windows\StartUp\backup.mscr")
Ok,
So could you:
-Tell me what device do you own and which rom your are using.
-In the registry in [HKLM/init] could you give me your launch values.
(ex: Launch10 Shell32.exe, Launch20 Service.exe etc...)
Bye
Herc.
hercule18 said:
Ok,
So could you:
-Tell me what device do you own and which rom your are using.
-In the registry in [HKLM/init] could you give me your launch values.
(ex: Launch10 Shell32.exe, Launch20 Service.exe etc...)
Bye
Herc.
Click to expand...
Click to collapse
The device is a HP Ipaq RX1950, rom is the standard HP rom version 1.01 (english).
Launch values:
Launch10 shell.exe, Launch20 device.exe, Launch21 coldinit.exe, Launch30 gwes.exe, Launch35 wifioff.exe, Launch50 shell32.exe, Launch60 services.exe, Launch61 ciphase2.exe, Launch70 connmgr.exe, Launch80 srvtrust.exe
Thanks
i was looking for some way to perform this operations and i have to say that this thing work perfectly on my TyTN (hermes) with mobile 6. For i moment i thought that i could write something in CF, but probably it wouldn't work cause it will need the system fully uploaded.
nice work
I see another way to backup SMS.
There are many programs which do backup SMS, and at any time, and not just during reboot device. For example, smsorganizer (www.zedsoft.net). But this program not work in a mode such as command line.
If there was such program would not be to do a problem backup sms when it is necessary, either under the schedule, or on event. For example, to start the program at incoming sms by means of SKScheme or another.
And then questions with copying cemail.vol will disappear all.
I also used this kind tool to backup cemail.vol by celecmd, but this time.. when I try to backup cemail.vol now, it dosn't work, both this mortscript tool or that celecmd tool. It seems after reset, another system application lock this cemail.vol before backup tool start.
Does anyone have an idea?
I have resolved my problem, maby helpful to you:
1. set "Today", cancel items outlook-related;
2. delete poutlook link in \windows\startup.
I backed up cemail.vol manually through "Mobile Device" in XP, and now I'm trying to figure out how to copy the backed up file back onto the device after a hard reset, but I'm not having much luck. I created "aa.mscr" in my \Windows\Startup directory, but nothing I put in it works:
Code:
Rename ("\goodcemail.vol", "\cemail.vol", 1)
Code:
Rename "\goodcemail.vol", "\cemail.vol", TRUE
Code:
Delete "\cemail.vol"
Rename "\goodcemail.vol","\cemail.vol"
The files are unchanged after I soft reset.
What am I doing wrong?
According to this page:
In WM 5.0 you can not rename, delete and etc. '\cemail.vol'. It is placed in distinct storage.
Click to expand...
Click to collapse
So how does your code do it then?
Ooops. This thread says to place a shortcut in the Startup directory, not the script itself. I'll try again when I have a chance.
endolith said:
Ooops. This thread says to place a shortcut in the Startup directory, not the script itself. I'll try again when I have a chance.
Click to expand...
Click to collapse
Nope. That doesn't do anything either. How do I restore cemail.vol?!
I removed everything from the Today screen and restarted, and the script worked! I think I could actually delete the file manually now, since it's not being used by the Messaging part of the Today screen.
So where do all the settings for Exchange Activesync and POP account info live? I want to be able to back these up and restore them after a reflash. Any Ideas?
OK, tried removing everything from today screen as someone stated, tried deleting the poutlook.lnk from stratup. I am on Raphael(Fuze) running my own cooked ROM. I would ike this to work so I could cook in a script to copy these files back on startup. Could prove very handy as I am flashing a lot of ROMs lately. Any help appreciated.
On a WM5 MotoQ I was having a hell of a time getting a backup of a clean cemail.vol file from a freshly flashed phone. Come to find out I had not unlocked its registry. From CeRegistry editor v0.0.4.4 I chose "unlock registry" from the tools menu then made the following edits
HKEY_LOCAL_MACHINE\Security\Policies\Policies\0000 1001 = 2
Change to 1
HKEY_LOCAL_MACHINE\Security\Policies\Policies\0000 1005 = 16
Change to 40
HKEY_LOCAL_MACHINE\Security\Policies\Policies\0000 1017 = 128
Change to 144
HKEY_LOCAL_MACHINE \Security\Policies\Policies
New Dword value "0000101b" = 1
What does restore do ? is it to delete off the old one and replace a new one ?
if it is , it doesnt help my wm6.1 asus p320 .
how to download this app.
it just displays a small picture when clicking the donwload link.

[APP][18.11.2008] Manila2D patcher -> SSMaPa2D version 0.2.2.1 [abadoned/read]

[size=+2]SSMaPa2D no more continued[/size]
Take the SSMaPa version. its customized also for manila2d.
http://forum.xda-developers.com/showthread.php?p=2400995
---------------------------------------------------------------------------------------
[size=+0][18/11/2008] SSMaPa2D (Alpha) 0.2.2.1 (18/11/2008)[/size]
Hi guys,
simple Manila2D patcher -> SSMaPa2D version 0.2.2.1
this version is only for Manila2D devices! For Manila3D use this link:
http://forum.xda-developers.com/showthread.php?p=2400995
please test it and let me know if there are bugs…
Patch options:
.) Replace Calender
.) Replace Mail
.) Replace Opera
.) Replace Camera
.) Time Click Man2d
.) Bluetooth Settings
Note: extended Init not possible at the moment. If someone facing UnauthorizedAccessException tell here.
How does it work ?
1.) Copy SSMaPa2D.exe to pda and start it.
2.) Press "Init"
3.) Under settings – click on description line what you want to change
4.) Then change the program what you want in fields below + click on "patch" + "save"
5.) Under deploy – click "Deploy".
After that you can exit the program.
If your files are signed, you're asked if you want to unsign them.
Please note, I didn't find a way to remove the signatures in a 'correct' way. I do an exe-based-deactivating. This is ok, as long as you don't want to resign them. If you want to resign them with your own certificate chose no and do it by hand.
Also I didn't have a manila2d testdevice... So it was a little bit difficult to test the application, but I had a motivator and beta tester
Thank you camel (camro)!
Please donate for me! I'm a apprentice and use a lot of my free time for working on the computer, to be able to create such tools.
[size=+2]Thank you [/size]
Received Donations:
none for SSMaPa2D
Cu sven
Version 0.2.2.1 (18/11/2008)
- First release
--> Excuse the Versionnumber. It's because of the paralell-developement from SSMaPa and SSMaPa2D
-- reserved --
I must be doing something wrong; I don't have anything showing up under the description line.
fredcatsmommy said:
I must be doing something wrong; I don't have anything showing up under the description line.
Click to expand...
Click to collapse
strange.
if others have same problem, post here and mail me your manila2d.exe...
thank you
I like the idea of this, but I am having a problem. When I select a description to edit and then select the ..., although all folders is selected, not all of them are showing up. I am missing Program Files, Windows, etc. Looking forward to a fix for this.
this is a "file explorer" related problem.
ex:
1.) please check the link file of creating of a "new appointment" on thumbal folder in start menu with a file browser (ex: total commander resco explorer)
2.) copy the string from there then to m2d patcher . the same on paramter - i (have tested it) and it works
@sven - maybe you can post a screen shot of the gui on first posting.
camro said:
this is a "file explorer" related problem.
ex:
1.) please check the link file of creating of a "new appointment" on thumbal folder in start menu with a file browser (ex: total commander resco explorer)
2.) copy the string from there then to m2d patcher . the same on paramter - i (have tested it) and it works
@sven - maybe you can post a screen shot of the gui on first posting.
Click to expand...
Click to collapse
I realize I can create the path manually or copying it from a link, but I would much rather be able to browse to the file I want and have the app create the path . I use Resco File Explorer, so getting the full path is no issue. Thanks.
It seems I can only assign the software in the storage card. Is there any way for me to assign the software in the main memory ?
chihliouma said:
It seems I can only assign the software in the storage card. Is there any way for me to assign the software in the main memory ?
Click to expand...
Click to collapse
you can copy the software the every location and you can start the software from every location.
if you need this very often - create a link to the exe and move it to your start menu folder - thats it
@browing with the file explorer extension.
i know that there is somewhere an extra plugin for browsing easier to folder directions.... maybe somebody can do a search under xda...
camro said:
@browing with the file explorer extension.
i know that there is somewhere an extra plugin for browsing easier to folder directions.... maybe somebody can do a search under xda...
Click to expand...
Click to collapse
Use FileDialogChanger / gsgetfile.dll for a better filedialog
http://www.geocities.co.jp/SiliconValley-Cupertino/2039/
take the english and not the japanese version
How to point to Day view, Task .. shortcut of ThumbCal ?!
I just copy all path (view the Task.lnk, Dayview.lnk ... by Resco Explorer) but it say error !
shpy said:
How to point to Day view, Task .. shortcut of ThumbCal ?!
I just copy all path (view the Task.lnk, Dayview.lnk ... by Resco Explorer) but it say error !
Click to expand...
Click to collapse
don't copy the whole path.
enter only the exepath, then do the arguments in argument box.
for example:
exe: \Interner Speicher\Programme\ThumbApps\ThumbCal\ThumbCal.exe
argument: -i
working dir: \Interner Speicher\Programme\ThumbApps\ThumbCal\
cu
sven
svenso said:
don't copy the whole path.
enter only the exepath, then do the arguments in argument box.
for example:
exe: \Interner Speicher\Programme\ThumbApps\ThumbCal\ThumbCal.exe
argument: -i
working dir: \Interner Speicher\Programme\ThumbApps\ThumbCal\
cu
sven
Click to expand...
Click to collapse
Please, can you make Task, Day view of Thumbcal work ?! I done exactly what you wrote above but it's not work. (changed the path, and i can make Thumbcal work.)
svenso said:
Use FileDialogChanger / gsgetfile.dll for a better filedialog
http://www.geocities.co.jp/SiliconValley-Cupertino/2039/
take the english and not the japanese version
Click to expand...
Click to collapse
Ok, I guess I can make you easier here. Download the attachment and unzip and copy inside 2 files (you should choose "show all files" option when using the file explorer) into \windows.
After that, go to Settings/System tab, then you should see "File dailog Changer". Enter the software, and choose the "Exchange Standard File Dialog, click "add". Now it should trigger the shield feature of file browser for SSMAPA2D now.
Now you can assign the software as you want by using SSMAPA2D.
Nothing showing up under "Settings" tab
Hi,
INIT seems to work but the settings tab is empty and I cannot add or change anything.
Any ideas?
What am I doing wrong?
Regard,
John
jhuppertz said:
Hi,
INIT seems to work but the settings tab is empty and I cannot add or change anything.
Any ideas?
What am I doing wrong?
Regard,
John
Click to expand...
Click to collapse
do you have a cooked rom?
svenso said:
do you have a cooked rom?
Click to expand...
Click to collapse
Yep, this one http://forum.xda-developers.com/showthread.php?t=416636
jhuppertz said:
Yep, this one http://forum.xda-developers.com/showthread.php?t=416636
Click to expand...
Click to collapse
I don't know exactly why, but cooked rooms can cause problems..
I don't have the time to flash all posssible roms and check if ssmapa works..
sorry
This is the path of task.lnk of Thumbcal:
".../thumbcal.exe" task?thumbcal....
So, what and where should i type in :
New program:
Arguments:
Working Dir:
??
shpy said:
This is the path of task.lnk of Thumbcal:
".../thumbcal.exe" task?thumbcal....
So, what and where should i type in :
New program:
Arguments:
Working Dir:
??
Click to expand...
Click to collapse
new program: full path to thumbcal is the simpliest thing...
search for thumbcal.exe. In this format: "/programs/myprogram/myprog.exe"
arguments: task?thumbcal....
working dir: full path to thumbcal is the simpliest thing (but don't add the exename, only "/programs/myprogram/" not "/programs/myprogram/myprog.exe"
cu sven

Initflashfiles.dat.... But now with Mortscript! Script uploaded.

Hi
After going through a post I came across this,
NRGZ28 said:
Hey Noonski.. how about we make a script, or an executable that we can plug in a kitchen batch file right before IMGFS gets created, that can look at at an initflashfiles.dat, analyze it, line by line, then create a zip with all the files its supposed to move then copy an almost blank initflashfiles.dat back in the "dump" directory. We could even do this in mort for windows!
Click to expand...
Click to collapse
I thought, hmmph lemme have a go at this. Well, this is what I came up with. It's very faulty, but it works. It looks at the initflashfiles line by line, creates the folder structure and then copies all the files with their new names into their correct directories.
I kinda needed to focus on my studies more so I dropped this project. However it has been completely rewritten by RoryB:
RoryB said:
I edited the script some more to shorten it.
Code:
MkDir( "Temp\ROM Generation\PlatformRebuilder\root" )
MkDir( "Temp\ROM Generation\PlatformRebuilder\root\windows" )
# Read initflashiles.dat into this script
initflashfile=ReadFile("temp\dump\initflashfiles.dat", 0, "unicode")
# Convert hex characters to ASCII
ForEach xhex, xtext in inikeys ( "Hex2Text.ini", "Convert" )
initflashfile=Replace( initflashfile, "\x" & xhex, xtext )
initflashfile=Replace( initflashfile, "\x" & ToUpper(xhex), xtext )
initflashfile=Replace( initflashfile, "\X" & xhex, xtext )
initflashfile=Replace( initflashfile, "\X" & ToUpper(xhex), xtext )
EndForEach
# Create directories listed in initflashfiles.dat
ForEach zcount in split ( initflashfile, "^NL^", False )
If(( Find( zcount, ":" ) NE 0 ) AND ( Find( zcount, ";" ) EQ 0 ))
If( SubStr( zcount, Find( zcount, ":" ), 5 ) EQ ":-Per" )
mkdir( "Temp\ROM Generation\PlatformRebuilder\root" \ SubStr( zcount, 12, Find( zcount, ":" )-14 ) \ Part( SubStr( zcount, Find( zcount, ":" )+11, ), """)", 1 ) )
ElseIf( SubStr( zcount, Find( zcount, ":" ), 5 ) EQ ":-Dir" )
If( SubStr( zcount, 1, 4 ) EQ "root" )
mkdir( "Temp\ROM Generation\PlatformRebuilder\root" \ Part( SubStr( zcount, 18, 100 ), """)", 1 ) )
Else
mkdir( "Temp\ROM Generation\PlatformRebuilder\root" \ SubStr( zcount, 12, Find( zcount, ":" )-14 ) \ Part( SubStr( zcount, Find( zcount, ":" )+13, 100 ), """)", 1 ) )
EndIf
EndIf
EndIf
EndForEach
# Move files from temp\dump to folder called out in initflashfiles.dat
ForEach ycount in split ( initflashfile, "^NL^", False )
If(( Find( ycount, ":" ) NE 0 ) AND ( Find( ycount, ";" ) EQ 0 ) AND ( Find( ToLower(ycount), "startup" ) EQ 0 ) AND ( SubStr( ycount, Find( ycount, ":" ), 6 ) EQ ":-File" ))
ycount1=Part(Substr(Part(Part(ycount, ":", 2), """,", 2), 10), """", 1)
ycount2=Part(Substr( Part(ycount, ":", 1), 12 ), """", 1)
ycount3=Substr(Part(Part(ycount, ":", 2), """,", 1), 8 )
rename( "Temp\ROM Generation\PlatformRebuilder\temp\dump" \ ycount1, "Temp\ROM Generation\PlatformRebuilder\root" \ ycount2 \ ycount3, TRUE)
EndIf
EndForEach
ZipFiles( "Temp\ROM Generation\PlatformRebuilder\root\*.*", "Temp\ROM Generation\PlatformRebuilder\temp\dump\InitFlash.zip", TRUE )
and the ini file contents had to change to allow a mix of small x or large X in the hex code conversion
Code:
[Convert]
0020=
0021=!
0022=""""
0023=#
0024=$
0025=%
0026=&
0027='
0028=(
0029=)
002A=*
002B=+
002C="="
002D=-
002E=.
002F=/
0030=0
0031=1
0032=2
0033=3
0034=4
0035=5
0036=6
0037=7
0038=8
0039=9
003A=:
003B=;
003C=<
003D==
003E=>
003F=?
[email protected]
0041=A
0042=B
0043=C
0044=D
0045=E
0046=F
0047=G
0048=H
0049=I
004A=J
004B=K
004C=L
004D=M
004E=N
004F=O
0050=P
0051=Q
0052=R
0053=S
0054=T
0055=U
0056=V
0057=W
0058=\
0059=Y
005A=Z
005B=[
005C=
005D=]
005E=^
005F=_
0060=`
0061=a
0062=b
0063=c
0064=d
0065=e
0066=f
0067=g
0068=h
0069=i
006A=j
006B=k
006C=l
006D=m
006E=n
006F=o
0070=p
0071=q
0072=r
0073=s
0074=t
0075=u
0076=v
0077=w
0078=
0079=y
007A=z
007B={
007C=|
007D=}
007E=~
Click to expand...
Click to collapse
RoryB said:
Yes it is automated in OSKitchen_Zero by adding a batch to run on IMGFS.
Code:
@echo off
Copy ".\Output\%ROM_Device%\Hex2Text.ini" ".\Temp\ROM Generation\PlatformRebuilder\Hex2Text.ini"
Copy ".\Output\%ROM_Device%\initflashfiles.mscr" ".\Temp\ROM Generation\PlatformRebuilder\initflashfiles.mscr"
call ".\Temp\ROM Generation\PlatformRebuilder\initflashfiles.mscr"
call ".\Temp\ROM Generation\PlatformRebuilder\temp\dump\config.txt"
The call of the config.txt lets me review it before continuing ROM cooking
Added to the beginning of my ROM customization script
Code:
###############################
# InitFlash.zip
###############################
If( FileExists( "\Windows\InitFlash.zip"))
SetFileAttribute( "\Windows\InitFlash.zip", "readonly", FALSE )
UnZipAll( "\Windows\InitFlash.zip", "" )
EndIf
Click to expand...
Click to collapse
Cheers and happy cooking
How does this work when cooking?
Well I haven't tried cooking a ROM with it yet haha But this is what should happen when it's done. Note this will be an automated process, so you wouldn't know that all of this is happening.
1. Get the ROM building process to pause before imgfsfromdump.exe runs.
2. Place the mortscript into the dump folder and run it.
3. A few folders will be created (with files moved where they are meant to be according to initflashfiles.dat) and added to a zip file.
4. Write a mortscript to unzip it on first boot (run the mortscript via config.txt).
5. Edit the initflashfiles.dat, removing lines where appropriate.
As you can see there's still some work to be done. The benefits, well mortscripts are a lot faster than initflashfiles.dat, and you're ROM will be lighter
Script updated..
I removed the attachment in the first post as I've updated the script a lot and it requires too many steps to run correctly.
I have however managed to build a ROM using it. And I don't know how, or if it's a good or bad thing (Maybe something important is not running? I dunno) but I booted up with 45% RAM usage, whereas I would previously get around the 50's. The only bug at the moment is that the start menu is not working correctly, and I'm not sure why because it IS present, correctly, in the Windows\Start Menu folder.
I'm not sure but I think this might be due to me creating a normal directory for "Start Menu" and not a "PermDir" as seen in initflashfiles.dat.
So any help with the start menu will be much appreciated.
EDIT: The bug with the start menu is that it's only showing "Today" and nothing else, at all.
Interesting...
Make sure you aren't zipping up welcome.lnk-if you do, there won't be any customization. Also, don't zip up autorun.lnk and checkautorun.lnk and any other links that have to go into the startup folder to initiate customization. Without them, the mortscripts won't be able to run, unless you have a line in the initflashfiles.dat that put a link to unziproot.mscr in startup and that doesn't get eaten by the overall zipping process.
Farmer Ted said:
Make sure you aren't zipping up welcome.lnk-if you do, there won't be any customization. Also, don't zip up autorun.lnk and checkautorun.lnk and any other links that have to go into the startup folder to initiate customization. Without them, the mortscripts won't be able to run, unless you have a line in the initflashfiles.dat that put a link to unziproot.mscr in startup and that doesn't get eaten by the overall zipping process.
Click to expand...
Click to collapse
Hi Thanks for the reply.
The zip file is definitely being unzipped because everything is working as it should (so far) except the start menu. When I check the Windows\Start Menu folder with Total Commander it looks perfectly normal to me... However, the start menu I see is totally blank except for "Today", another strange thing about this is: Isn't "Today" usually named "Home" on the start menu? I'm pretty sure it is... And it does not have the normal "Home" icon but rather the older "Today" one..
seeM_ZA said:
Hi Thanks for the reply.
The zip file is definitely being unzipped because everything is working as it should (so far) except the start menu. When I check the Windows\Start Menu folder with Total Commander it looks perfectly normal to me... However, the start menu I see is totally blank except for "Today", another strange thing about this is: Isn't "Today" usually named "Home" on the start menu? I'm pretty sure it is... And it does not have the normal "Home" icon but rather the older "Today" one..
Click to expand...
Click to collapse
make sure your .lnk files dont have hidden attribute, thats the only reason i can think of why you can see them in total commander but not your start menu.
twopumpchump said:
make sure your .lnk files dont have hidden attribute, thats the only reason i can think of why you can see them in total commander but not your start menu.
Click to expand...
Click to collapse
Will check later but I have to go right now. Before I do, could it be because I created the Start Menu directory using the MkDir command in mortscript?
Thanks
seeM_ZA said:
Will check later but I have to go right now. Before I do, could it be because I created the Start Menu directory using the MkDir command in mortscript?
Thanks
Click to expand...
Click to collapse
i dont see what difference it would make how the directory gets there, as long as its named the right way Windows\Start Menu\Programs and the .lnks arent hidden. have you posted a link for your script you are using?
I just checked and none of them are hidden so...
Yes, I did post it but I removed it again. I think I'll repost it at a later stage, I still have quite a bit to do.
Quick question, when does initflashfiles.dat actually "run"? Before or after Customization (RunCC)?
Okay so I went ahead and changed the script so that all directory work is left to initflashfiles.dat. My ROM is still working fine, and the Start Menu is visible in Total Commander, but still no luck with the normal wm start menu.. I really don't know what the problem could be, but I'm trying a few more things.
It runs during first boot, definitely before the welcome screen (otherwise, there wouldn't be a Welcome screen, as welcome.lnk is copied into the startup folder by initflashfiles.dat).
Ah Didn't think of it like that
This guy over here seems to have had this problem before: http://www.smartphonegurus.com/forums/index.php?/topic/4197-all-item-gone-from-start-menu-except-today/
All I can deduce from this is that there are files in the Windows directory missing.. I think, lol.
Post up your zip file so we can see what's in it.
Here it is.. I deleted the "My Documents" folder before uploading because I didn't really think it was necessary, and just to make it a little smaller.
http://www.4shared.com/file/MhBqYtP4/root.html
I fixed that stupid problem, by the way.. Haha
The problem was: initflashfiles.dat wasn't running AT ALL, I don't even know how the zip file was unzipped? My script had a built in function that rewrote the initflashfiles.dat accordingly after the zip was created. I didn't however know that initflashfiles.dat is not just a txt file with the extension *.dat. I just wanna kick myself
yeah i looked at your zip and the problem with start menu is you didnt have Windows\Start Menu\Settings directory

[SOLVED]How to create a shortcut for mortscript

hello to all i have created a mortscript but i did not able to create a shortcut in startmenu with packages maker.....will anyone please help me how to create a shotcut with mortscript because packages maker only show the "exe" files.
thanks to all
1#"\Windows\Connections_OFF.mscr"
Like that. Just put in your script name, put it in a .txt file and change the extension to .lnk.
Total Commander is a great tool for making links.
Since you're using mortscript, you can also use the createshortcut command to make the shortcut, like this:
Code:
CreateShortCut("\Windows\Start Menu\Programs\MortScript\RestoreWeather.lnk","\Windows\RestoreWeather.mscr")
Farmer Ted said:
1#"\Windows\Connections_OFF.mscr"
Like that. Just put in your script name, put it in a .txt file and change the extension to .lnk.
Total Commander is a great tool for making links.
Since you're using mortscript, you can also use the createshortcut command to make the shortcut, like this:
CreateShortCut("\Windows\Start Menu\Programs\MortScript\RestoreWeather.lnk","\Windows\RestoreWeather.mscr")
Click to expand...
Click to collapse
thanks for ur reply when i add like this in my created script it does not create a shortcut
any solution??????
I didn't have the script in code tags, so it had a space in the second 'windows'; maybe that was the problem. It should work fine; my whole start menu (100+ shortcuts) is created that way. You just need to have the correct path to the script you want linked.
are i add these entries ina rgu or in my created script
They go in a mortscript; you also need to put an EXEC command into an add2config.txt file to get the script to run (and mortscript has to be cooked in).
Farmer Ted said:
They go in a mortscript; you also need to put an EXEC command into an add2config.txt file to get the script to run (and mortscript has to be cooked in).
Click to expand...
Click to collapse
Thanks once again ....i put m'y scripts into m'y Windows folder and i havé created a new note.txt and i add m'y entries like u havé marked and i rénamed thé txt to mscr but when i want to test thé script before cooking it gives a error ...i havé mortscript installed ...Will i add some thing Else in m'y script or ...is it possible to upload a sample script for creating shortcut?
Do the cheaters method, and find your file in the windows directory of your device, then select and copy, finally paste as shortcut in storage card. Move shortcut off storage card. Done.
indagroove said:
Do the cheaters method, and find your file in the windows directory of your device, then select and copy, finally paste as shortcut in storage card. Move shortcut off storage card. Done.
Click to expand...
Click to collapse
ok but i want to create a shortcut in my kitchen for cook with
shafizal said:
Thanks once again ....i put m'y scripts into m'y Windows folder and i havé created a new note.txt and i add m'y entries like u havé marked and i rénamed thé txt to mscr but when i want to test thé script before cooking it gives a error ...i havé mortscript installed ...Will i add some thing Else in m'y script or ...is it possible to upload a sample script for creating shortcut?
Click to expand...
Click to collapse
What's the error? I'm guessing there's just some syntax that's off. You should try each script one at a time (comment out all but one at a time with #'s).
Farmer Ted said:
What's the error? I'm guessing there's just some syntax that's off. You should try each script one at a time (comment out all but one at a time with #'s).
Click to expand...
Click to collapse
now its ok bro ur entries worked now and i added into config.text now its creates the shortcuts automatically after flash.....
thank u very much for ur help from begin..

[TOOL 4 CHEFS] kitchen UPDATE ONLY NEW EXT batch file (EVK & OSK compatible)

only new ext-pkg's to a other kitchen (language import support is coming...).
a friend of mine wrote a little bat-file for me and i want to share it with you.
the creator insisted to call it bloody rudimentary but i think it's quite useful.
he wants to stay anonymous...
around two hours of brainwork (i remember the command for this... what was it again?) and notepad.exe to create this from scratch.
you only need to adjust the two paths at the beginning.
the batch searches for same packets (exact name matches) and ignores them.
a txt will pop up showing only the new packages.
you can edit this list (only delete pks but don't change entries).
save and close after you removed the lines you don't want to import.
batch will create a temp workfolder in c: (it will pop up once copying is finished).
at this point you can rename the folders (add *_photon_1.36 at the end for example)
and add missing language sub-folders.
if you are done, press any key at the cmd window and all the edited/renamed package folders will be moved to the ext-folder in the destination kitchen (_NewPackages folder).
example (if you want to update only new ext from 1.36 into 1.11 kitchen):
-kitchen1 (source kitchen) photon 1.36 htc
-kitchen2 (destination kitchen) photon 1.11 vodafone
tested and working with oskitchen1.31beta10 file-/folder-structure.
take this code and save it into a txt file. rename it to *.bat and adjust the paths.
Code:
@echo off
REM ------- EDITABLE SECTION
SET L_SOURCEPATH="[COLOR="Red"]X:\osKitchen Zero v1.31beta10_1.36SOURCE\Sources\Devices\HTC HD Mini\EXT Packages\HTC HD Mini Packages\[/COLOR]"
SET L_TARGETPATH="[COLOR="Red"]X:\osKitchen Zero v1.31beta10_1.11DESTINATION\Sources\Devices\HTC HD Mini\EXT Packages\HTC HD Mini Packages\[/COLOR]"
REM ------ END
SET L_WORKPATH=C:\SCRWORK
MKDIR %L_WORKPATH%
SET SCRFILE=%L_WORKPATH%\packets_source.txt
SET TGTFILE=%L_WORKPATH%\packets_target.txt
SET ACTFILE=%L_WORKPATH%\PKG2COPY.TXT
del %ACTFILE%>nul
CD %L_SOURCEPATH%
DIR /B>%SCRFILE%
CD \
CD %L_TARGETPATH%
DIR /B>%TGTFILE%
CD \
FOR /F "delims=" %%I IN (%SCRFILE%) DO (
REM <--------------------------------------------------------------
REM insert logic here to select packages i.e. package numbers
FINDSTR /C:"%%I" %TGTFILE%>nul&& ECHO Exact name match. || ECHO "%%I">>%ACTFILE%
REM insert some better logic here duh!
REM <--------------------------------------------------------------
)
CLS
ECHO !!!! Remove packages you dont want to copy from list but RETAIN LINE FORMAT !!!!
ECHO !!!! Save and close List to continue!!!!
start /w notepad %L_WORKPATH%\PKG2COPY.TXT
REM hier: Collect packages based on pkg2copy.txt
CD %L_SOURCEPATH%
FOR /F "delims=" %%I IN (%ACTFILE%) DO (
xcopy /E /Y /H /I %%I %L_WORKPATH%\PRECOPY\%%I
)
CLS
ECHO !!!!Edit Folders now!!! Add langs etc.. press any key to continue and copy edited folders to destination (_NewPackages)
REM <--------------------------------------------------------------
REM i.E. delete... rename....
explorer %L_WORKPATH%\PRECOPY\
REM automate it duh!
pause
REM <--------------------------------------------------------------
REM !!! ACTION - Copy from Precopy to Target Folder (Targetpath\_NewPackages)
xcopy /E /H /Y /I %L_WORKPATH%\PRECOPY\*.* %L_TARGETPATH%\_NewPackages\
rmdir /s /q %L_WORKPATH%
explorer %L_TARGETPATH%
CD \
tested now with ervius visual kichen.
works. hope y'all enjoy this batch file...
please leave a "thanks" if you like and use it.
thanks
wow this tool is awesome, its amazing how a simple batch file created by notepad can do so much functionality..
gonna use this right now
thanks..
my opinion:
many xda-chef's would use it if they would know about it's existence..
please help me to keep this thread alive so all chefs can see it better...
tell your favorite chefs to take a look at this thread. thanks.
Wow, the time this is going to save me! (^^,) I haven't used it yet but I'm pretty sure I will. Thanks bro!
enjoy......
I didnt try it yet but sounds like a very life saver tool, got one week sticky for let other chefs to check it.
Thanks for sharing.
@ mods: i will take care of unsticky it @ 04 August.
I'm sorry but I've read the intro 3 times and still don't know what it does.
As i said ,i didnt try it yet but for what i understood it updates packages in your EXT folder,example:
You have a 2.14 Leo Kitchen and you want update only NEW EXT packages from 3.04.
Laurentius26 said:
I'm sorry but I've read the intro 3 times and still don't know what it does.
Click to expand...
Click to collapse
feel free to test it. no harm done.
source and destination folders stay untouched.
only the (not exact name match - packets that aren't already in the destination kitchen) packets you don't delete from the pop-up list will be copied to the destination kitchen ext folder (_NewPackages subfolder).
I will give it a shot when I'm back from holiday mate.
Thanks for sharing with us.
HD2Owner said:
feel free to test it. no harm done.
source and destination folders stay untouched.
only the (not exact name match - packets that aren't already in the destination kitchen) packets you don't delete from the pop-up list will be copied to the destination kitchen ext folder (_NewPackages subfolder).
Click to expand...
Click to collapse
wauw!!! works great man!!! perfect! now the only thing is we need to automate copying lang files from an other folder... hihi
kurniawan77 said:
wauw!!! works great man!!! perfect! now the only thing is we need to automate copying lang files from an other folder... hihi
Click to expand...
Click to collapse
You mean for SYS?
seeM_ZA said:
You mean for SYS?
Click to expand...
Click to collapse
i guess he means lang folders for ext-packages since this tool has nothing to do with sys.
it's possible but it would require a more advanced detection logic.
seeM_ZA said:
You mean for SYS?
Click to expand...
Click to collapse
Nah... not that much work...
Unfortunately, my kitchen is setup in a way that would prevent this from working, but this seems like a great idea.
Thanks for sharing!
HD2Owner said:
my opinion:
many xda-chef's would use it if they would know about it's existence..
please help me to keep this thread alive so all chefs can see it better...
tell your favorite chefs to take a look at this thread. thanks.
Click to expand...
Click to collapse
This is all nice and cool.. but what happened to porting your packages MANUALLY and actually looking at them before you put them in your kitchen ? You can't tell me this is how you cook a ROM... you run this batch file and blindly move over "newer" packages to your kitchen ? Wow... I believe packages need to be looked over and brought it one by one to insure compatibility first.
NRGZ28 said:
This is all nice and cool.. but what happened to porting your packages MANUALLY and actually looking at them before you put them in your kitchen ? You can't tell me this is how you cook a ROM... you run this batch file and blindly move over "newer" packages to your kitchen ? Wow... I believe packages need to be looked over and brought it one by one to insure compatibility first.
Click to expand...
Click to collapse
you are right... that's why the tool moves the new ext folders into a sub-folder (_NewPackages).
cooks still need to add compatible lang sub-folders and maybe adjust some keys in the rgu's.
this batch-file is only around a week old. so it's basically new.
the main reason for it's existence is to remove the manual package comparison wich is very time-consuming (detection of already present packages).
of course cooks need to check the new ext like they would need to do when updating them manually.
in my personal kitchen i adjust the ext folder names as following:
Album_3_2_19203733_0_leo_1.66
Album_3_2_20132625_0_leo_2.13
Album_3_2_20161229_00_leo_3.04
Album_3_2_20171628_00_huashan_0.90
this way i always know where the ext's in my kitchen are coming from.
the batch file detection still works when adjusting the end of the folder names.
for example:
source kitchen-Album_3_2_19203733_0
destination kitchen-Album_3_2_19203733_0_leo_1.66
the album folder will still be ignored even after you changed the folder name of the already imported package to Album_3_2_19203733_0_leo_1.66.
just don't change/rename the blue part (original package name)
HD2Owner said:
you are right... that's why the tool moves the new ext folders into a sub-folder (_NewPackages).
cooks still need to add compatible lang sub-folders and maybe adjust some keys in the rgu's.
this batch-file is only around a week old. so it's basically new.
the main reason for it's existence is to remove the manual package comparison wich is very time-consuming (detection of already present packages).
of course cooks need to check the new ext like they would need to do when updating them manually.
in my personal kitchen i adjust the ext folder names as following:
Album_3_2_19203733_0_leo_1.66
Album_3_2_20132625_0_leo_2.13
Album_3_2_20161229_00_leo_3.04
Album_3_2_20171628_00_huashan_0.90
this way i always know where the ext's in my kitchen are coming from.
the batch file detection still works when adjusting the end of the folder names.
for example:
source kitchen-Album_3_2_19203733_0
destination kitchen-Album_3_2_19203733_0_leo_1.66
the album folder will still be ignored even after you changed the folder name of the already imported package to Album_3_2_19203733_0_leo_1.66.
just don't change/rename the blue part (original package name)
Click to expand...
Click to collapse
That's cool I guess... but it still seems like a lot to do, for such a simple operation as replacing a package with a newer one. I personally use beyond compare. It's a MUST have tool for chefs. It's great once you get to know how to use it.
NRGZ28 said:
That's cool I guess... but it still seems like a lot to do, for such a simple operation as replacing a package with a newer one. I personally use beyond compare. It's a MUST have tool for chefs. It's great once you get to know how to use it.
Click to expand...
Click to collapse
i bought beyondcompare too. it's a must have for chef's if you ask me too..
lot to do?? did you actually try the batch-file???
-adjust the 2 paths in the batch
-remove the lines you dont want to import (from the pop-up txt file - save and close to continue)
-adjust packages (insert lang subfolders and rename packages in the pop up temp folder)
-press any key (dos window) to move adjusted packages from temp folder to sub-folder "_NewPackages" in destination kitchen
for me, this batch is a real time-saver........
and i dont even have to use beyondcompare for this specific task anymore..
btw:
i will try to adjust the batch to show a pop-up of the destination-kitchen too when the temp folder is showing (so you dont have to open it manually to pick lang folders).

Categories

Resources