Saturday, June 16, 2007

Get the file that has been clicked after file association in Visual C# Smart Device Application

Yet another problem: if the file association works, how do you know, in a mobile environment, to get the file that has been clicked.

File Association using Visual Studio 2005 Smart Device Cab Project Part 2

I've found the answer to the file association problem


None of my files are signed, and the association still works (when I click a file in the File Explorer, the app is launched).

I have not found a way to export my registry keys from the deployment project (it may be possible using the ccregedt.exe in the CE Remote Tool, but it would just show the installed reg keys).

So, I opened the cab that cabwiz generates and extracted the _setup.xml file. Inside (at the bottom), you'll find the registry sections:

Thanks to vpborza


Sunday, June 10, 2007

File Association using Visual Studio 2005 Smart Device Cab Project

I am trying to make an installer for a SVG viewer for Pocket PCs running Windows Mobile using C# and Windows Mobile 6 SDK.
The installer works, but I am trying to make a file association. When I click on a SVG file the application should start and show that file. I've used registry keys like so:

HKEY_CLASSES_ROOT
|
+ .xxx (Default Value) xxxfile
|
+ xxxfile
|
+ DefaultIcon (Default Value) %InstallDir%\MyApp.exe, 0
|
+ Shell
|
+ Open
|
+ Command (Default value) ""%InstallDir%\MyApp.exe"" ""%%1""

but when I open a SVG file I get this error:
" The file 'filename' cannot be opened. Either it is not signed with a trusted certificate, or one of its components cannot be found. If the problem persists, try reinstalling or restoring the file"

If I open the application directly, it works, and the files are shown, so they are not corrupted.

If anyone has an ideea about what could be wrong, please leave a comment or email me.