Thursday, 31 January 2008

Cab Installation Debugging Issues


Having problems with CAB files installing on devices; remember a detailed XML log of the installation process can be found on the device under:


\Application Data\Volatile\setup.log


Unfortunately this doesn't include information about available memory and file system usage on the device at the time of installation but it can be useful for debugging purposes especially for registration of DLLs and read only files failing to be copied over.


Thursday, 24 January 2008

Using custom DShow filters without registering DLLs

If you are creating a media application or utility that requires a DMO or DShow filter but instead of having clunky separate dlls that may need code signing and/or registring with DShow, did you know that you can embed the filter within your main application.

For example for a source filter you can specify a new class and base it on the DShow components you require:

class MySourceFilter : public CSourceStream
{
public:
MySourceFilter( HRESULT* phr, LPCWSTR pName);
virtual ~MySourceFilter(void);

..
..
}

When you create your filtergraph you can use AddFilter to add an instance of your class:


// Create and add new source filter
m_source = new MySourceFilter(NULL, &hr);
hr = m_pGraph->AddFilter((IBaseFilter*)m_source, L"Source");


Simple as that!

You don't need to support the registration or have registry files to allow DShow to find your filter as you've explictly added it yourself.

Thursday, 10 January 2008

Configuring MSI installers for Vista

When creating an MSI installable project (could be for your new Windows Mobile / Windows CE CAB project), you may encounter a problem with security on Vista, the error :

"The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2869."

To get around this I use the following in a PostBuildEvent on my PC installer project in visual studio 2005:

cscript.exe "$(ProjectDir)..\..\scripts\CustomAction_NoImpersonate.js" "$(BuiltOuputPath)"cscript.exe "$(ProjectDir)..\..\scripts\WiRunSQL.vbs" "$(BuiltOuputPath)" "INSERT INTO `Error` (`Error`, `Message`) VALUES (1001, 'Error [1]: [2]')"

You will need

- cscript.exe (provided in Windows XP)
- CustomAction_NoImpersonate.js (see Aaron Stebner's site for more information )
- WiRunSQL.vbs (Windows Installer Software Development Kit SDK)

Thursday, 3 January 2008

Making an MSI to install PPC/SP Cab files


Want to install your mobile application from your PC with your PDA connected via active sync but not sure how to do it?

Visual Studio 2005 includes all the tools to be able to create an installable CAB file for your PocketPC device but making the link between a PC MSI file and this CAB file isn't obvious.

It can be done by creating a PC installer that first installs your .CAB file on the PC, then afterwards launches small VB/C# app which invokes the Windos CE App Manager. This pushs the CAB file down onto the device either now or on next connection.

The basics of this and the VB/C# launcher can be found on MSDN:


Note this is for VS2003 which didn't include as rich a set of project types, check out http://www.devx.com/wireless/Article/31198/1954?pf=true which is written for VS2005, very handy!

Note for Vista you will need to alter the security properties of the MSI file as it will not have the correct permissions to launch the Windows CE App Manager (or Vista Mobile Device Center as its known). This is a command line operation, i'll detail this in a later post!

Enjoy!

Wednesday, 19 December 2007

Determining Broadcom vs Microsoft Bluetooth Stack on PPC

I was always under the impression that Smartphone used the Microsoft bluetooth stack and PocketPC used the Broadcom stack, but this isn't true!

OEMs for PocketPC can use any stack, so some PPC devices still use the Microsoft stack.

To determine this at runtime try loading the broadcom dll:


HINSTANCE hInst = LoadLibrary(L"btsdkce50.dll");

If this fails then try the microsoft bluetooth APIs...!

Sunday, 9 December 2007

TrakAx Video Mixing Application Is Released!

I've been lucky to be involved in the development of the new Highandes TrakAx video mixing application for Windows Smartphones and PocketPC devices.

This has got to be one of the most powerful mobile video editing applications, taking phone content such as music, pictures, videos you can mix them together with effects to create a video to MMS, Email or save to your device to show your friends!

Heres a quick mix I made on my S710 (E650) 200Mhz phone from a recent skiing trip:

All mixed from the hotel bar afterwards!


A must for all Windows mobile phone owners!


See http://www.trakax.com/ for more information including a 7 day free trial!

Thursday, 13 September 2007

SDHC support in Windows CE 5.0

With SD cards getting bigger and bigger many people don't realise that there is a different standard when you get up above 2GB's. This normally means 4GB and above.
A 4GB+ card is part of the SDHC (Secure Digital High Capacity, SD 2.0) Standard.
SDHC uses the FAT32 file system which supports a higher data density than FAT16. It uses the same form factor as SD, but the SD 2.0 standard in SDHC uses a different memory addressing method (sector addressing vs byte addressing). SDHC cards only work in SDHC compatible devices, but standard SD cards work in both SD and SDHC devices. The SDHC trademark is licensed to ensure compatibility.

To support this there is an update for CE 5.0, which can be found here http://support.microsoft.com/kb/933809. This enables deployment of SD 2.0 specification functionality which can theoretically take you up to 32GB. SD 2.0 functionality is available out-of-the-box in Windows CE 6.0.