Some notes on software development... RSS 2.0
# Wednesday, 18 February 2009

I had an issue with a compact framework project where I needed to add a shortcut on the desktop that pointed to my application whose location was \Program Files\MyApplication\.
You need to create a .lnk text file and place it on the device's desktop. However, .lnk files are a bit tricky to use with Visual Studio 2008 because it thinks it is an actual shortcut to a file on your actual desktop machine.

Mike Hall has a blog article that further covers Windows CE shortcuts.

Here are my steps on how to overcome the .lnk issue when using a Smart Device CAB project from within Visual Studio 2008.

My application is called MyApplication.exe and it's full path, once installed on Windows CE, is \Program Files\MyApplication\MyApplication.exe
All my application does is show 'Hello World' in a label on the form.
My Windows CE installer project is called MyWindowsCEInstaller.

First I create the application and installer projects and added the project output of MyApplication to the MyWindowsCEInstaller project. Here is what my solution looks like so far:


Next step is to create the shortcut file that will eventually be placed on the device desktop. To do this I created a new text file within the MyApplication project called MyApplication.lnkx
It's 'Build Action' property should be set to None and 'Copy to Output Directory' property set to Do Not Copy.
It is a lot easier to work with the file having the extension as .lnkx so that Windows doesn't think it is an actual shortcut file.

The MyApplication.lnkx file will contain the command line text and the command line character count separated by a hash (#).
So my Windows CE application full path is \Program Files\MyApplication\MyApplication.exe making the character count 48, below is my MyApplication.lnkx file:


Note:- If the path contains a space it must be enclosed in quotes and they get included in the command character count!!!

Next step is to add our MyApplication.lnkx file to the correct folder in the MyWindowsCEInstaller project.

From the root of the Primary Output File System view of the MyWindowsCEInstaller project add the Windows Special Folder.
Under the Windows folder create a new folder called Desktop

Add the MyApplication.lnkx file to the newly created Desktop folder.


Next, select the MyApplication.lnkx file from the MyWindowsCEInstaller project and change the TargetName to be MyApplication.lnk
This will change the extension off the shortcut file on the target device to be .lnk while on the development machine it will stay as .lnkx

The final files should look like this:

image image

Build the solution, copy the CAB file to the device, install it and now there should be desktop shortcut that points to the MyApplication application ;-)

image image

Note that the shortcut will also use the application icon as it's image once this has been set in the application properties, here it is the default image.

Mike Hall Windows CE Shortcuts Blog Article

Wednesday, 18 February 2009 17:31:35 (GMT Standard Time, UTC+00:00)  #    -
CF | CE Devices
# Tuesday, 03 February 2009

Simply set the CSS style attributes of the collapsible panel to be Height = 0px; overflow: hidden;


Tuesday, 03 February 2009 12:48:18 (GMT Standard Time, UTC+00:00)  #    -
# Thursday, 29 January 2009

What the different cursors look like for the CSS Cursor property...



Thursday, 29 January 2009 12:30:57 (GMT Standard Time, UTC+00:00)  #    -
Web Dev
# Wednesday, 21 January 2009

The default HTTP header created by ASP.NET includes a string called X-AspNet-Version. An example....


Ideally you want to give away as little information as possible about your web server to potential hackers. You can easily remove this string by making a change to the web.config file.
Setting the enableVersionHeader attribute to true in the httpRuntime element will remove the string from all the http headers.

<httpRuntime enableVersionHeader="false" />

.NET Slave blog post.

Wednesday, 21 January 2009 09:45:46 (GMT Standard Time, UTC+00:00)  #    -

Sign In
Total Posts: 116
This Year: 0
This Month: 0
This Week: 0
Comments: 36
About the author/Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2019
Hadrian Phillips

All Content © 2019, Hadrian Phillips
DasBlog theme 'Business' created by Christoph De Baene (delarou)