Go Back   xda-developers > Windows Mobile Development and Hacking > Windows Mobile Apps and Games


Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 9th March 2009, 02:19 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Post [Beta 0.1.4][25-Mar-09] UCMe2 - Selective backup and SDConfig tool for reflashing

Premise is that there are many backup utilities that will backup/restore either dirs or the whole ROM, but not just for a specific apps settings. There are many ways that dev could use to store their settings for a given app, but getting them all to do the same way is "difficult". However, if program A had it's settings in a settings.ini (or whatever name) and that specific file could be backed up and restored later after a hard reset or new ROM installed, it would make the flashing a ROM even easier since UC came out.

My idea is for an app that works sort of like AppToDate, in that it will parse a collection of ini files in a directory to determine what a given progam uses for it's configuation (files or reg keys) and will backup/restore them.

Basically all that someone needs to do is:
- Extract the UMCe2.zip to a folder on their Storage Card
- Register Mortscript (just click on it once, from this point on you can just click on a script and it will run.)
- Place the INI files that define the files or keys of the app that you'd like to backup/restore into the \Storage Card\UCMe2\ini folder. I have posted a small collection of some INI files as examples
- If you'd like startmenu shortcuts, I attached a few dummy.exe files that you can put into the UCMe2 folder so you can make shortcuts.
- Run the UCMe2_Backup and it will read every INI file in the ini folder and store the backup files in \Storage Card\UCMe2\Backup
- Run the UCMe2_Restore and it will read every INI file in the ini folder are restore the backups


I want the app do do a few things:
* to run start to finish unattended... start the program and it just runs, with no questions asked. (for scheduling purposes)
* the config ini for apps need to be simple to read/edit, so user community can post/share them, or be created by the original app devs



Feel free to create your own INI files and post them here for others to share

I have updated the scripts to include the SDConfigCE tool, to create a new SDConfig.txt based on the files that you have placed in the CABS subfolder.

Additionally, I have included XCopyCE support in the created SDConfig.txt file to copy files placed in the Files subfolder to the device.


(added test sdconfigce.zip to attempt to detect devices with internal storage vs. storage card and SHOULD manage other ROM languages)
Attached Images
File Type: jpg UCme2.jpg (37.5 KB, 973 views)
File Type: jpg Screen01.jpg (59.2 KB, 847 views)
File Type: jpg Screen02.jpg (78.7 KB, 638 views)
Attached Files
File Type: zip ini.zip (4.8 KB, 399 views)
File Type: zip UCMe2v0.1.4.zip (303.5 KB, 366 views)
File Type: zip SDConfigCE.zip (791 Bytes, 122 views)
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 6th May 2009 at 05:24 PM..
Reply With Quote
Sponsored Links

  #2  
Old 9th March 2009, 02:37 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

Todo list:
Quote:

add ProcKill and SuggestReboot options to ini file
-optional kill process before backup/restore
-optional suggest reboot after restore if suggested in ini file

add optional Disable parameter to ini file to "turn it off"

add section to backup/restore individual reg values (instead of entire subKey)
-[RegValues]
-Value1= root, subkey, value, data, type

Build in Restore script to run during UC to further automate UC

Provide bulk REG file import, over and above the scripted reg key values provided by INI files


Bug List:
Quote:
Validation key in ini files do not like LONG reg root names, workaround is to change them to HKLM or HKCU as necessary
- change: Validate = HKEY_LOCAL_MACHINE,Software\Apps\Google Maps
- to: Validate = HKLM,Software\Apps\Google Maps
Updates in version 0.1.4:
Quote:
updated bug in restoring of backup files. Now it will create missing directories and actually copy in the files :-0
Updates in version 0.1.3:
Quote:
updated bug in validation logic on the restoring of backup.
Modified Backup script to automatically generate new SDConfig to make that "last minute" backup into a 1 step process.
Updates in version 0.1.2:
Quote:
Created tool to create SDConfig.txt file automatically based on the presence of CAB or XML files in the CABs subfolder
Provided XCopyCE support to do file copy of the contents of the Files subfolder to the device during UC
Updated Menu applet to call the SDConfigCE tool
Updates in version 0.1.1:
Quote:
Replaced dependancy of SKTools with DotFred Taskmanager for reg functions (it is even smaller and faster and freeware)
Changed display of progress in GUI
Added Version numbers in script and GUI
Initial release 0.1.0
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 25th March 2009 at 04:43 PM..
Reply With Quote

  #3  
Old 9th March 2009, 06:14 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

How to make your own INI file:

The ini file is a very simple thing to make as it is basically just a text file with a few bracketed headers (sections) and values in them.

The easiest way to do so, is to place a copy of the template on your PC desktop and open it with notepad.

Then use the freeware tool CERegEditor ( http://ceregeditor.mdsoft.pl/ ) to read your device's registry... MOST apps save their customization in:
HKEY_CURRENT_USER\Software\ (App Publisher) \ (App Name)

There are plenty of sample files to use as references. If you need help, I'm certain that someone in this community can help.

PocketBreeze.ini
Quote:
[UCMe2]
appname=PocketBreeze
subdir=PocketBreeze
Validate = HKLM,Software\Apps\SBSH.net PocketBreeze

[regkey]
key1=HKEY_CURRENT_USER\Software\SBSH\PocketBreeze
OwnerSettings.ini
Quote:
[UCMe2]
appname=Owner
subdir=Owner

[regkey]
key1=HKEY_CURRENT_USER\ControlPanel\Owner
Key2=HKEY_LOCAL_MACHINE\Ident
key3=HKEY_CURRENT_USER\Software\Microsoft\Bluetoot h\Settings
GoogleMaps.ini
Quote:
[UCMe2]
appname=GoogleMaps
subdir=GoogleMaps
Validate=HKLM,Software\Apps\Google Maps

[Files]
cache-GLM.dat=\Application Data\GoogleMaps\cache-GLM.dat
index-GLM.dat=\Application Data\GoogleMaps\index-GLM.dat
prefs.dat=\Application Data\GoogleMaps\prefs.dat
prefsext.dat=\Application Data\GoogleMaps\prefsext.dat
prefsext2.dat=\Application Data\GoogleMaps\prefsext2.dat
prefsfriends.dat=\Application Data\GoogleMaps\prefsfriends.dat
prefsfriendsmini.dat=\Application Data\GoogleMaps\prefsfriendsmini.dat
strings-all.zlb=\Application Data\GoogleMaps\strings-all.zlb
Format of ini file is:
[UCMe2]
AppName = Friendly name for future use
subdir = subfolder to store the files
Validate = condition to look for before restoring (either a filepath and name or reg key... Reg key must be formatted like ROOT,KEY)

[regkey]
filename1 = regkey to backup
filename2= other regkey

[Files]
destinationfilename1.ext = source filename with full path
destinationfilename2.ext = source filename with full path


Just create an ini file for each app to backup
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 20th March 2009 at 06:39 PM..
Reply With Quote

  #4  
Old 9th March 2009, 08:00 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

**** Reserved for suggestions or requests
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 13th March 2009 at 01:37 PM..
Reply With Quote

  #5  
Old 10th March 2009, 12:56 AM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

I'm thinking of adding a switch to the ini files as a block to prevent backing up certain apps...

It would be used to "install" an app that only needs file copy like an exe or shortcuts or similar... no sense of copying back those files for backup, as they would never change.

an entry in the ini like:

[UCMe2]
RestoreOnly = 1
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin
Reply With Quote

  #6  
Old 10th March 2009, 12:58 AM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

Would it make a difference to anyone if I CREATED new app shortcuts, or just copied the old ones for backup/restore?
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin
Reply With Quote

  #7  
Old 10th March 2009, 02:40 AM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

Another optional ini setting should be:

[UCMe2]
Validate = <fullpath\file> or Reg key

Which would only restore the backups of the appropriate reg key or path\file exists. No sense restoring data for an app if it isn't yet installed.
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 13th March 2009 at 01:37 PM..
Reply With Quote

  #8  
Old 10th March 2009, 06:16 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

hmmm...

I've added a bit of a GUI to the backup process, just to see something while it runs. I'll get around to doing the same to the restore mode...

UCMe2.mscr
Code:
ScriptDir = SystemPath("ScriptPath")

IniFiles = ScriptDir \ '*.ini'

StatusType(ST_LIST)
StatusInfo("UCMe2 Backup", "Backup process running")

ForEach F in files (IniFiles)
	AppName = IniRead(F,"UCMe2","appname")
	SD = IniRead(F,"UCMe2","subdir")
	RestoreOnly = IniRead(F,"UCMe2","RestoreOnly")

	StatusShow()
	StatusMessage( AppName, ST_LIST, TRUE )
	If (RestoreOnly = False)
		
		MkDir(ScriptDir \ SD)

		ForEach K, V in iniKeys (F,"regkey") 
			RunWait(Scriptdir\"SKTools.exe","#REXP(" & V & ") #FNAME(" & ScriptDir \ SD \ K & ".reg)")
			StatusMessageAppend( "." )
		EndForEach

		ForEach K, SettingsFile in iniKeys (F,"Files")
			copy (SettingsFile, ScriptDir \ SD \ K ,TRUE)
			StatusMessageAppend( "." )
		EndForEach
		StatusMessageAppend( "OK" )
	ElseIF
		StatusMessageAppend( " - Skipped by RestoreOnly value" )
	EndIf
EndForEach

StatusMessage( "Backup Complete" )
WriteStatusHistory( Scriptdir \ "BackupLog.txt" )
StatusMessage( "Window closing in 5 seconds" )
Sleep( 5000 )
StatusType(ST_HIDDEN)
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin
Reply With Quote

  #9  
Old 10th March 2009, 07:16 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

Updated the scripts a bit and made a GUI menu... but that has limited value, beyond my playing with MortScript

here is a template of the current ini entires, but most of them aren't necessary... see the examples I already have in the zip.

Code:
[UCMe2]
appname = (descriptive Name)
subdir = (subfolder name)
RestoreOnly = 0/1   (1 = do not back up this app)
Validate = <fullpath\file> or Regkey HKLM,Software\appname\key  (NOTE the comma in the reg key)


[regkey]
key1="HKEY_CURRENT_USER\Software\AppName\etc"
key2="HKEY_LOCAL_MACHINE\Software\AppName\etc"


[Files]
backupFilename.ext=Fullpath to sourcefilename.ext
anotherbackupFilename.ext=Fullpath to sourcefilename.ext
andanotherFilename.ext=Fullpath to sourcefilename.ext
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin

Last edited by Radimus; 11th March 2009 at 07:09 PM..
Reply With Quote

  #10  
Old 10th March 2009, 07:40 PM
Radimus Radimus is offline
Senior Member
 
Join Date: Dec 2006
Location: Tampa
Posts: 469
Default

rilphone2.ini

Quote:
[UCMe2]
appname=Rilphone2
subdir=Rilphone2

[regkey]
key1=HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RIL

[Files]
rilphone2.dll=\WINDOWS\rilphone2.dll
__________________
AT&T Fuze
Radio: RAPH_Radio_1.12.25.19
Rom: [WWE]At0mAng_V52_03-23-2009


Quote:
"The real reason that we can't have the Ten Commandments in a courthouse: You cannot post 'Thou shalt not steal,' 'Thou shalt not commit adultery,' and 'Thou shalt not lie' in a building full of lawyers, judges, and politicians. It creates a hostile work environment." -- George Carlin
Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:16 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.