Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,772,940 Members 46,812 Now Online
XDA Developers Android and Mobile Development Forum

Problems changing theme programmatically

Tip us?
 
Jesse99
Old
#1  
Jesse99's Avatar
Member - OP
Thanks Meter 0
Posts: 84
Join Date: Sep 2008
Default Problems changing theme programmatically

I'm trying to change the theme on multiple devices programmatically. I'm using server scripts to do this.
I'm currently testing with a HTC Universal (WM 5), a HTC Elf (WM 6) and a HTC Diamond (WM 6.1). All still have the original Rom at this moment.
I made a custom theme that I will call "MyTheme.tsk". I'm aware that we're dealing with different screen resolution devices, but the script detects this first and sends the right resolution theme to each device (confirmed to work correctly).

This is what I'm doing (got it from examples on MSDN):
- Send MyTheme.tsk to mobile device
- Delete reg value: HKCU\Software\Microsoft\Today\UseStartImage
- Exec: \Windows\wceload.exe /safe /noui /nouninstall /delete 0 \Windows\MyTheme.tsk
- Set reg value: HKCU\Software\Microsoft\Today\Skin MyTheme.tsk


Every event is being logged and none gives any errors. However, the theme is not applied on any of the devices at all. The only thing that happens, is that the theme is highlighted if I go manually to Settings - Today.

As an alternative, I tried replacing the Exec event by the following:
- Exec: \Windows\CusTSK.exe \Windows\MyTheme.tsk

This results in a successful theme change on the WM 5 device. However the WM 6 & 6.1 devices change all color settings successfully, but don't apply the background included with the theme.
I tried to add an event to force a refresh of the Today screen, but that didn't change anything. The stwater and tdywater files in the Windows folder simply aren't replaced by the right files.
I know I can simply make a script to change those files manually, but I rather find out why this isn't working the way it should. According to sources I found, it should work using "wceload.exe" which didn't do anything in my case.

The theme itself is not the problem, I tried using the same script to set the device from a custom theme back to the default WM theme, with the same results. Also, manually applying my theme works just fine on all devices.

All 3 devices have been hard resetted to set them to factory defaults, without any changed settings or installed applications except the application that receives the settings from the server.

Anyone has an idea why this isn't working?

A little note: MSDN says I have to delete the UseStartImage reg value. However doing this doesn't seem to make any difference, because it is set back automatically unless I manually enter to remove it in the tsk file settings.
 
Jesse99
Old
#2  
Jesse99's Avatar
Member - OP
Thanks Meter 0
Posts: 84
Join Date: Sep 2008
Finally found a solution. Although it's a bit weird.

Apparently it only works with CusTSK when the background files are GIF files. They can be any format (JPG, PNG, BMP) but have to be renamed to GIF for it to work.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes