View Single Post
  #579 (permalink)  
Old 04-27-2010, 05:38 AM
computhug's Avatar
computhug
N00b
Offline
Location: NorCal
 
Join Date: Aug 2008
Posts: 31
Reputation: 65
computhug is becoming a great contributor
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Cool Re: [Kitchen] WVGA Touch Pro 2 Collaboration

Quote:
Originally Posted by smiznith View Post
here is the code i use:

Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\OEM]
"ROMVersion"="XXXX"
[HKEY_LOCAL_MACHINE\SOFTWARE\OEM]
"ROMDate"="4/23/10"
It goes in the oemversion RGU file...
I used to forget to update that .rgu half the time, and it got agravating when I was troubleshooting or needed to roll back and I couldn't figure out which .erv file I had used for that build. I slapped a batch file together that does it automatically each time I build a ROM, with zero extra steps.

AutoVersion.bat writes out a .provxml file, which sets ROMVersion to whatever's in the kitchen's ROM Ver field and ROMDate to the current system date. I added a line to the begining of kitchen_build_rom.bat that calls AutoVersion.bat, right after the variables are set. It basicly sneaks in, creates the .provxml, drops it in the dump folder and returns control to kitchen_rom_build.bat. I needed a .dsm for my provxml to work, of course, so I added it to the one in the OEMVersion package.

After reading several posts asking about the version/date fields, I thought some folks might find this useful. I cleaned it up and added comments to make it presentable, and put in some error handling: if AutoVersion can't create the provxml for whatever reason, it'll write a warning out to build_log.txt and set ERRORLEVEL=0 before exiting. This allows kitchen_build_rom.bat to continue building the ROM.

I also rewrote my 'date conversion' construct to make sure it can handle the most common short-date formats (in case someone outside the US tries it out). It handles '/', '-' and '.' as seperators, the with later two being converted to '/' in the provxml. If the short-date format includes 'day of date' (i.e. Tue 4/27/2010) the batch file just chops it out.

The attached zip file contains:
- AutoVersion.bat
- My modified copy of kitchen_build_rom.bat
- My OEMVERSION package folder - the updated .dsm, the .rgu and a copy of the provxml (I wasn't sure if it would work if the file isn't there when PlatformRebuilder creates the dump folder).

I zipped it up with the proper folder structure, similar to the way Welrope does a SYS, so all you need to do is extract it to the root folder of your kitchen. I **HIGHLY** recommend backing up first - this worked on my system, but who knows.

Oh, and Command Line Extentions must be enabled in the O/S or some of the statements I used won't execute properly. They're enabled by default in Windows 2000 SP4 and above, so it should be fine. (if you've disabled them you'll know how to re-enable - and if you don't know what I'm talking about then you haven't disabled 'em).

This is my first 'original' contribution to the community, so let me know what you think (including whether or not it's useful!). And please feel free to disect, modify and improve.

EDIT: Oops, I lied. It's a .rar file, not a .zip.
Attached Files
File Type: rar Computhug's_EVK_AutoVersion_MOD.rar (4.6 KB, 20 views) Click for barcode!
__________________
HOW I GOT HERE
Palm m130 > Palm i705 > Palm Tungsten T > Dell Axim x30 > ETEN M600+ > [HTC event horizon] > Wizard > Tytn > Mogul> Touch Pro > TP2 > EVO 4G
Reply With Quote
This post has been thanked 3 times.