Misc

Update Storage without Removing Content

2min
if you want update your applications, but don't want to wipe out the local storage files, content, registration keys, etc on your microsd card, create a separate folder on the destination drive to receive those files for example use a script like the one below to create a folder where you can unzip the updated files delete the files that you want to replace in their respective folder(s) copy or move the updated files to the correct folder you can use scripts to move multiple files to the sd card folder, as shown in the example below the main zip file that you download can contain other zip files so you could unzip the main file, and then do targeted unzips to replace selected files path$="sd /" 'usb1, ssd2, sd2 createdirectory(path$+"update") 'unzipping here package = createobject("robrightpackage", path$+"autorun zip") package unpack(path$+"update") example to copy everything from an “update” folder to a “myapplication” folder, do the following copyroot("update", "myapplication") sub copyroot(path$ as string, target$ as string) 	mylist = listdir(path$) 	for each item in mylist 	 if instr(1, item, " ") > 0 then 	 print "found a file "; item 	 print "path "; path$ 	 copyfile(path$+"\\"+item, target$+"\\"+item) 	 else 	 print "found folder " ;item 	 createdirectory(target$+"\\"+item) 	 copytree("\\"+item) 	 endif 	next end sub sub copytree(path$ as string) print "copy tree "; path$ 	'e g \pool 	mylistb = listdir("\update"+path$) 	print mylistb for each item in mylistb 	print len(item) 	if instr(1, item, " ") > 0 then copyfile("\update"+path$+"\\"+item, target$+path$) 	if len(item) > 1 then 	 print "copying sha file "; target$+path$+"\\"+item 	 showstatus("copying file "+ target$+path$+"\\"+item) 	 copyfile("\update"+path$+"\\"+item, target$+path$+"\\"+item) 'folders only 1 digit long outside root ? 	else 	 print "found sub folder "; path$+"\\"+item 	 createdirectory(target$+path$+"\\"+item) 	 copytree(path$+"\\"+item) 	endif next