yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Development and Hacking General] meltwater:
Update:

Added example shortcuts (which may be the easiest way to use the tool).

See the shortcut section of the manual on post #1.

Let me know how it goes, I am thinking I may need to add a soft-reset to the end of the process to ensure Sense is re-started correctly (for now a manual reset is probably recommended).

Note: The files required for the tab in question must be in place first and SenseUtil must be installed to Program Files on the device.

Hopefully this will create a usable solution for adding and removing tabs without all the fuss!
[Windows Mobile Development and Hacking General] Captain_Throwback:
I hadn't noticed this request before - I cabbed this up a while ago for my own personal use (I believe it's the latest version - but I'll check to be sure). Hmmm, i know I have it on one of my devices . . . I've been so busy playing with my new EVO that I haven't even thought about WinMo for several days :D. I should have the CAB posted within 15 minutes.

EDIT: I feel like we're having this conversation in two threads, lol
[Windows Mobile Development and Hacking General] TMartin:
I'm glad to hear you made the switch to a real device!! and to a better service provider too!!! :p
[Windows Mobile Development and Hacking General] Captain_Throwback:
As promised . . . (this is untested, but I have confirmed it installs)
[Windows Mobile Development and Hacking General] meltwater:
Ok, put a new version on with the reset option, but most users probably won't need it hopefully.

17 Jan 2010 (SenseUtil_5973.zip)

------------------

Added shortcuts.

Added option to reset device following command-line modification of tab control file (with prompt so user can wait to see if sense restarts without reset).

Added documentation screens.

------------------

Added the cab to the 1st post.

Thank you for the cabs, I really hope that we have a reasonable solution to the long running problem of installing and uninstalling tabs.
[Windows Mobile Development and Hacking General] coolsac32:
i keep getting an error:

nullreference exception

at

senseutil.sensecontrol.isenserunning...

could you tell me why this is happening.
[Windows Mobile Development and Hacking General] meltwater:
Ok the related code is below:

const string CSTR_RegistryKey_HKLMTodaySetting = @"Software\Microsoft\Today\Items\HTC Sense";
const string CSTR_RegistryName_TodayHTCSense = "Enabled";

public static bool isSenseRunning()
{
bool running = false;

RegistryKey key = Registry.LocalMachine.OpenSubKey
(CSTR_RegistryKey_HKLMTodaySetting, true);

//Check the registry value for the today plugin
if ((int)key.GetValue(CSTR_RegistryName_TodayHTCSense, 0) == 1)
{
running = true;
}

key.Close();
return running;
}

I would guess the null exception would come from either the registry key:

HKLM\Software\Microsoft\Today\Items\HTC Sense

Not being present on your device

OR:

HKLM\Software\Microsoft\Today\Items\HTC Sense\Enabled

Not being present. Although I think it would return 0 if not present, rather than null.

Granted that I should check these are present or not null before I use them (I do in other cases) but I can't see why they would be missing on your device if you have sense running.

Can you check if the registry location above is present and also if the enabled key is there? I'll update the code to avoid the exception, but wouldn't expect these keys to be missing. [CODE UPDATED]

Thank you for reporting the error so clearly, easy to pin point the problem. :D

UPDATE:

After using the shortcuts to add remove my tabs, I think I may change the insert point to just after the Home tab instead of just before the settings tab. I think that is fair enough since the user is obviously quite interested in the new tab so makes sense it is at the start of the tabs (of course it can be moved as normal, I'm just changing the default position). Personally I'd then use the SenseUtil to order my tabs since no matter what, it'll keep the order, but then I reset sense ALOT!

[CODE UPDATED + Additional Shortcuts]

@Captain_Throwback

What do I need to do to create icons for the shortcuts (i.e to make them appear in the start menu etc?).

Sorry about all the updates, but best get them in while the cabs are still in progress. New RSSTab should be released tomorrow.
[Windows Mobile Development and Hacking General] coolsac32:
thnx very much. i got it working
[Windows Mobile Development and Hacking General] nikkioc:
I have some problems and i need to remove Fb tab but when i click [-] i get an error and nothing changes..any ideas ?
[Windows Mobile Development and Hacking General] meltwater:
1. What is the error?

2. Try using the "SenseUtil FbTab Remove" shortcut (found in SenseUtil\bin\Debug") or now Attached to this post.

That will run the following command:

"\Program Files\SenseUtil\SenseUtil.exe" remove 51B6F88A_manila

Let me know if that solves your problem.
[Windows Mobile Development and Hacking General] nikkioc:
I reinstalled application and it worked ( the [-] ) it removed the fb tab but now i have problem my htc sense dont launch it writes unable to launch htc sense or smth like that .. how to make it run agian any idea :confused:
[Windows Mobile Development and Hacking General] meltwater:
After you remove a tab from the "Tab (Loaded)" list, you will need to:

1. Press "Build" to create a new Tab Control File (select no on prompt since you don't need to view it)

2. Press "Update" in the "Control sense" tab to update your Tab Control File

3. Wait until the program tells you "The tab control file has been replaced...etc".

4. You may need to soft-reset (turn your device off and back on)

The shortcut option, does all these steps for you.

Otherwise, please post your 26948339_manila file from your devices windows folder (zip it and attach) and I will manually check it for you.

Good luck!
[Windows Mobile Development and Hacking General] nikkioc:
Thanks i worked it out i was missing the update button and for that there were no changes :D
[Windows Mobile Development and Hacking General] meltwater:
Will consider putting a warning on there when the user exits if they've made changes but they've not been applied. Thanks for letting me know and asking for help, I can improve things then!

Excellent, glad it worked! Sorry that the FbTab caused you problems, it's just one of those things which either works or it doesn't unfortunately (too much tie in to specific htc files I think).
[Windows Mobile Development and Hacking General] nikkioc:
There is another problem , btw i am with htc hd 2 i didnt upgrade anything i mean rom's and other things .. So this program runs great i remove fb tab from tabs it was bugging start menu screan when i scroll to it :confused: so its gone now but when uninstall the fb tab from applications and the sense cant launch ..its not that big deal now becouse tab is gone but it must stay installed otherwise my sense cant launch :confused: do some 1 have the same problem or maybe i should ask in diffrent thread
[Windows Mobile Development and Hacking General] meltwater:
Well one of the purposes of the Sense Util is to resolve the issues people have with the install/uninstall of the FbTab (as well as other tabs) so don't worry.

I think the uninstall is trying to change your tab control file too (but not doing it right for some reason), so try uninstalling the tab and then correct it using the SenseUtil.

With the reference to the FbTab correctly removed from sense, removing the related files shouldn't have any effect (it should only remove the added files, the tab shouldn't change any other file except the 26948339_manila one, just adds extra ones). With it removed from the Tab Control file, these extra files won't do anything.

When sense loads it uses manilafull.xml which is created on the 1st start by combining 26948339_manila and all the xxxx_pages.xml files from ManilaXml. If manilafull.xml is deleted it then gets re-generated, so this has to be done to avoid any old references to removed/changed files. On top of that, sense can also set some registry items which then re-order the tabs (configuration registry items), so they may also need to be cleared (the items are only generated if they are re-ordered).

One thought, is if the configuration registry items are left by the uninstall they may still refer to the FbTab, that might be why some people have issues perhaps.
[Windows Mobile Development and Hacking General] meltwater:
Ok, I was looking again at the setup options etc and as far as I can tell there are some strange limits on what you can do in cab files:

1. You can't create shortcuts which include command-line parameters as part of the install.

2. You can't pre-create your own shortcuts as files (and assume a fixed location for the exe) and get the install to copy them for you. You can't add ink files to the project.

This leaves two options as far as I can see:

1. Make the application install in a fixed location "windows\senseutil\", then supply a zip file which contains all the pre-created shortcuts which the user can use.

UPDATE: Although, the standard zip program on WM doesn't have proper folder support so the user can't simply extract to the windows\Start Menu\SenseUtil\ dir....how helpful!

2. Make a specific version of the SenseUtil application OR tiny app to call SenseUtil for each tab (or at least for RSSTab and FbTab).

I think I'll do both options, with them included in the Visual Studio solution so people can see how to do this and perhaps improve it.

UPDATE2:

Ok, found if I create the cab outside of visual studio I can copy the shortcuts automatically (using senseUtil fixed to "windows\senseutil\" hopefully ok as it uses 64k including all the resource files). Much better solution!
[Windows Mobile Development and Hacking General] Skrobel:
@meltwater

Using WinCE Cab Manager you can do both: automatically create links to executables in your project and add any kind of files (lnk too) to the project copying them to any location. But yes, I used WinCE CM before I saw Visual Studio for the first time and I couldn't get used to the cab maker in there.
[Windows Mobile Development and Hacking General] meltwater:
The problem is it won't let you create a shortcut like:

"\%Install%\SenseUtil\SenseUtil.exe" add 51B6F88A_manila

Even if you set the add 51B6F88A_manila part in the project file manually it rejects the shortcut.

The solution I've settled on is to fix the install location (windows\SenseUtil\) and then I can treat the pre-defined shortcuts as normal files and place them in the start menu.

Cab is now attached to the 1st post, works ok on my system (size is about 170k, since I've put a HQ icon in for the app).

Please let me know if this works ok for you, then I can do the same and create a new FbTab and RSSTab install.
[Windows Mobile Development and Hacking General] Skrobel:
Ahhh... so you want to create the lnk file depending on the place of installation the user would choose? This is tricky indeed.

On the other hand I think this tool is specialized for modifying manila files so it's understable it can always be installed to \Windows\ on phone memory, not a card, thus the lnk should point always to the same directory and you can use ready created (with parameters).

The only "intelligent" solution I can think of is using mortscript automatically run during installation via setup.dll, but I don't think it's worth the effort.
[Windows Mobile Development and Hacking General] meltwater:
Well the tools can do it, but I think the CabWiz check of the shortcut doesn't allow for parameters. Oh well.

Yep, if users really need 170k of space back, they can uninstall afterward can't they, the tool is only needed if they are messing with the tabs.

As you say, any other solution would be more effort than it's worth, thought about mortscript too but then that would also need to be installed...lol.

One issue I can see with combining the senseUtil install with the tab installs is that when it uninstalled, it'll remove the senseUtil tool so if the user forgot to "Remove" the tab from sense, they'd be stuck.

UPDATE: My latest thought is this regarding tab installs, provide two options:

1. Combo Cab - Contains senseUtil and the Tab files.

a) User installs, then Adds tab via SenseUtil shortcut.

b) User removes tab via and then Uninstalls.

2. Separate Cabs - Standard Cab for SenseUtil and a Cab for the Tab files (placed together in a single zip file).

a) User installs both Cabs, in no particular order and then runs the SenseUtil shortcut to Add the tab.

b) User runs the shortcut to remove the tab and then uninstalls each of the cabs. So even if they uninstall the tab, and kill sense, they can still remove the tab before removing SenseUtil.

UPDATE: Done for RSSTab, cabs posted for testing!
[Windows Mobile Development and Hacking General] McFlyH:
Hi!

Cannot add tab - wrote "Unable to update file"
[Windows Mobile Development and Hacking General] meltwater:
I take it you are adding a tab using the start menu shortcut?

Can you see if there is a backup file created in the windows\SenseUtil\ directory (will be a file named 26948339_maniladdmmyyhhmmss tt.xml).

Also check for TabControl_manila.xml please.

Also re-try, with sense disabled perhaps (remove from your today plugin settings OR stop manila from SenseUtil).

If you still have problems then post your 26948339_manila file from \windows\ and let me know what tab you are trying to install/uninstall.

I can then edit and post it back.

Thanks.
[Windows Mobile Development and Hacking General] McFlyH:
Yes i try adding a tab using the start menu shortcut.add RSSTab and delete Stock. But i can`t see file 26948339_maniladdmmyyhhmmss tt.xml

TabControl_manila.xml exist

Problem not solved

26948339_manila posted
[Windows Mobile Development and Hacking General] meltwater:
26948339_manila_original - your original file

26948339_manila_addRSS - added RSSTab at the end

26948339_manila_replaceSTOCKwithRSS - replaced the stock tab with RSSTab.

Hopefully the file will do the trick. Just use SenseUtil to "Reset Sense" (Del ManilaFull.xml).

Good luck.
[Windows Mobile Development and Hacking General] meltwater:
For reference, suxelexus has detailed the manual method which works around the automatic method problem.

Looks like I need to change how SenseUtil does the replacement of the tab control file.

I'll try a different method in the senseUtil to copy over the file, at the moment I move the new file across without deleting the original (thought it was safer that way, the move command should replace any existing file). But I can make the backup, then delete the original and check it has been deleted, then move across the new file. Hopefully that would fix it.

Will update SenseUtil when I've had time to do so and test it enough (build number will be greater than 6328 - the current version).
[Windows Mobile Development and Hacking General] McFlyH:
Thanks !

26948339_manila_replaceSTOCKwithRSS - replaced the stock tab with RSSTab.

it is working !
[Windows Mobile Development and Hacking General] meltwater:
Excellent! Glad to hear it is working, thanks for reporting back.

I've made the changes to SenseUtil in my dev build, but yet to test so will release when I've checked it. Busy working on the next update for RSSTab at the moment though.
[Windows Mobile Development and Hacking General] fabygoyena:
Lo probé....tenia el mismo problema....FUNCIONA TAMBIEN CON FACEBOOK TAB....gracias!!!!!
[Windows Mobile Development and Hacking General] meltwater:
Glad it is working! :D
[Windows Mobile Development and Hacking General] coolsac32:
here are some cabs for some more tabs that i made

http://sacdev.codeplex.com/releases/view/61023
[Windows Mobile Development and Hacking General] catscase:
Hi,

I am completly a noob and my english is not very good sorry ...

I got the same problem as another :

Unable to update

I want to add FB and RSS using senseutil.

I have a HD2.

how doing ?

thanks
[Windows Mobile Development and Hacking General] catscase:
Hi again, i have find something, i have delete memaid and now the update works, i see the fb tab on sense, but when i go on it, it pint on screen

no update from your friends and sense freeze on this screen.

I still use my phone using start buttons, but when i go back to sense, black screen ...
[Windows Mobile Development and Hacking General] meltwater:
Excellent, should be very useful to be able to add them if required.

Good work.

Try to reset sense again and restart your phone, sometimes sense can be difficult to start correctly and takes a few goes. Otherwise, you may need the patched version (see FbTab thread for this), or it may not work (sorry I don't have a HD2 to test with).
[Windows Mobile Development and Hacking General] meltwater:
Good news!

I've just re-flashed my phone and I now get the "Unable to update file" message.

This means I can keep changing the SenseUtil program until the problem is fixed. :D

Will update as soon as I've done it.

UPDATE:

Done it!

For those who are interested, the problem was because the Tab control file has never been changed it was a ROM file. As you may know, you can not delete ROM files, so the MOVE operation I was using would fail. By using COPY instead the file is replaced (in fact the ROM file remains in the ROM, but the flash copy over-rides it) and hopefully sense is updated!
[Windows Mobile Development and Hacking General] Heechee:
Hi,

I have problems with SU,

installed FBTab, and when I try to add it I get this error in attach (pic 1 & 2)

also when I try to reset manila using SU, or any other action I get errors in attach (pic 3 & 4)

any help?
[Windows Mobile Development and Hacking General] meltwater:
Thanks for reporting it!

I'll look into it and see if I can work out what the issue is and fix it.

UPDATE:

Are you able to look at your registry?

If so then I think the most likely problem is that the following entry does not exist...(although that would suggest sense not being on your system...).

HKLM\Software\Microsoft\Today\Items\HTC Sense\Enabled

That would explain pic 2 & 3. As for pic 4, not too sure on that yet (perhaps a compact framework version not matching? Coded using Compact Framework 3.5).
[Windows Mobile Development and Hacking General] Heechee:
.net ok, tried to install again 3.5 but not possible

registry key is there

but when I try to reset manila, or anything to do to change it get errors:

Edit:

sense is started, and it seems like SU is not getting that info, screen is always the same, with sense enabled or disabled in today settings

2nd Edit:

It seems like 26948339_manila is locked in ROM, can't do anything to it...

tried to rename, clear read-only, delete, edit... nothing happens...

(could that be the reason of problem)

3rd Edit:

I've managed to install utopykzebulon's call register and it changed the 26948339_manila and it appeared in sense???
[Windows Mobile Development and Hacking General] meltwater:
- The buttons will only update after they are pressed or on start up of SenseUtil so the status is not updated dynamically (i.e. I don't poll the status etc).

- It should be able to handle when 26948339_manila is a ROM file (previously I tried to MOVE it, but latest should handle it). Basically when it is in the ROM it is fixed in place, but when you write a file of the same name into the flash the system uses that instead (thereby masking the original in ROM).

I suspect that the problem is in the StopManila function, since they all use that function (or similar ones) for controlling sense.

public static void StopManila()
{
RegistryKey key = Registry.LocalMachine.OpenSubKey
(CSTR_RegistryKey_HKLMTodaySetting, true);

key.SetValue(CSTR_RegistryName_TodayHTCSense, 0);
key.Close();

System.Threading.Thread.Sleep(2000);

PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, (IntPtr)0xF2, (IntPtr)0);
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, (IntPtr)0xF2, (IntPtr)0);
// This is required or manila is enabled before it's fully disabled,
// so doesn't restart
System.Threading.Thread.Sleep(2000);
}

It could be that the PostMessage stuff is causing a problem, since it's non-standard .net.

I can create a version which has some extra debug messages so that we can identify the point at which it fails. Not able to do that right now though.
[Windows Mobile Development and Hacking General] Heechee:
ok when you have the time... I'll be there
[Windows Mobile Development and Hacking General] meltwater:
Ok managed to finish off what I was doing, so had time to quickly update the code for a test:

public static void StopManila()
{
MessageBox.Show("StopManila: STARTED");
RegistryKey key = Registry.LocalMachine.OpenSubKey
(CSTR_RegistryKey_HKLMTodaySetting, true);

MessageBox.Show("StopManila: KEY OPEN");
key.SetValue(CSTR_RegistryName_TodayHTCSense, 0);
key.Close();
MessageBox.Show("StopManila: KEY CLOSED");

System.Threading.Thread.Sleep(2000);
MessageBox.Show("StopManila: SLEEP OK");

PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, (IntPtr)0xF2, (IntPtr)0);
MessageBox.Show("StopManila: POST MESSAGE 1 OK");
PostMessage((IntPtr)HWND_BROADCAST, WM_WININICHANGE, (IntPtr)0xF2, (IntPtr)0);
MessageBox.Show("StopManila: POST MESSAGE 2 OK");
// This is required or manila is enabled before it's fully disabled,
// so doesn't restart
System.Threading.Thread.Sleep(2000);
MessageBox.Show("StopManila: SLEEP OK");
MessageBox.Show("StopManila: END");
}

Just replace the SenseUtil.exe with the one in the zip file. I've only added debug messages for start and stop for now. Perhaps try directly from the GUI and if possible using the shortcuts (i.e. commandline).

Thanks for trying it out.
[Windows Mobile Development and Hacking General] Heechee:
Tried:

no luck :(

Tried also command line (created shortcut with renew parameter), but can't see the result message, but it seems like nothing happened :(
[Windows Mobile Development and Hacking General] meltwater:
I expected it to fail, just needed to see where...the answer is, when it writes to the registry key... Since it is a null exception this would suggest the key was not opened for some reason...

Anyway, here's an update, hopefully will give some more info.

UPDATE1: Don't worry too much about the commandline option, I suggested it in case it wasn't getting past the GUI button click, but it's definitely something wrong with that registry item.

UPDATE2: Just wondering, perhaps its the security setting which enables/disables write access to the registry, on most custom roms this is enabled by default. Can't remember the details of it though.
[Windows Mobile Development and Hacking General] Heechee:
Here it is:

UPDATE:

checked the registry and here is the key and it's value

15 & 16

UPDATE 2:

Tried also unistall & re-install but no change....
[Windows Mobile Development and Hacking General] meltwater:
No problem. It has confirmed that it is not opening the registry key correctly. I release now that the last screenshot which confused me, was the remainder of the error.

I'll do a new build which protects against that (although it might not switch sense on and off correctly - you may need to do that manually via the today page). I'll put a warning if that occurs, that sense might need to be stopped manually.

Not sure what the reason is though, hopefully someone can confirm if it is a security setting or something which stops the registry being written (at least by this method).

Thank you for your testing, it is always very useful to get issues resolved. Should have it updated for tomorrow.
[Windows Mobile Development and Hacking General] Heechee:
Thank you, for the effort and time you put in this project :)

this was the least I could do
[Windows Mobile Development and Hacking General] meltwater:
Ok, updated version, this should inform the user that they should manually switch sense off and on if the software is unable to access the registry key for some reason (I'm guessing it is a security policy of some kind).

Let me know how it goes and I will update the current release with the changes.

Cheers.