Log in

View Full Version : Creating a Start Menu Shortcut on Install with Windows Mobile 5 for Smartphones


CCProg
03-17-2006, 12:23 AM
I am trying to create an app for a WM5 smartphone. I have the app created, I've added a Smart Device Cab project, a Windows Class Library with a Custom Installer class and a Setup Project to my solution. Following a combination of the steps outlined here (http://www.codeproject.com/netcf/PackagingAndDeployingPPC.asp?df=100&forumid=38007&exp=0) and here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfdepl.asp). I have attempted to get my application on the emulator. The code compiles, the .msi file installs the application (and .NETCF2.0 when necessary) and everything seems great...until I look at the emulator and try to find the application.

I can see the application if I go to the remove programs option on the emulator, but there is not Start Menu shortcut. So I kept looking and found this info (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnppcgen/html/sp_2003_app_deploy_demyst.asp). OK, so now I know I have to edit my .inf file. So, I added a line item under the "[Shortcuts]" in the .inf as explained in the link. Then, since I knew the .cab wasn't updated with this information I ran the cabwiz.exe as described here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcepb40/html/cxconcabwizardsyntax.asp). So, now armed with my new .inf and corresponding new .cab I rebuilt the setup project and tried installing with the .msi file again. SAME RESULT.

If anyone can explain to me how to add a shortcut to the start menu of a smartphone using Visual Studio 2005 and .NET CF 2.0 and the built in Windows Mobile 5.0 Smartphone emulator I would really appreciate it.

Thanks - Lee[/url]

SnozBerries
04-04-2006, 06:08 AM
<<edit: oops, failed to realize that your post was half a month old, oh well. it'll probably help someone eventually>>

About a year ago I created a installer for a smartphone app just as practice, to get an idea of whats involved. I haven't looked at it since until now (I saved the files off to a DVD).

First off, I think you should be using cabwizsp.exe instead of cabwiz.exe. cabwizsp.exe is the smartphone version. I don't know how they differ, but appearently they do.

Secondly I created my INF file by hand. I'm not sure what VS 2005 can do for you, but here is my INF file. It basically installs an exe, and a bmp. Writes some regkeys, and creates a shortcut.

ARM_INSTALLER.INF
[Version]
Signature = "$Windows NT$"
Provider = "MyNameHere"
CESignature = "$Windows CE$"

[CEStrings]
AppName = "My First Installed App"
InstallDir = %CE1%\%AppName% ; Program Files\my app name

[SourceDisksNames]
1 = , "Files",,.\ARMRel\

[SourceDisksFiles]
MyFirstInstalledApp.exe = 1
somegraphic.bmp = 1

[DefaultInstall]
CopyFiles = CopyToInstallDir
AddReg = RegData
CEShortcuts = Shortcuts

[DestinationDirs]
CopyToInstallDir = 0, %InstallDir%
Shortcuts = 0, %CE11% ;\Windows\Start Menu\Programs\

;File copy list.
[CopyToInstallDir]
"MyFirstInstalledApp.exe", MyFirstInstalledApp.exe
"somegraphic.bmp", somegraphic.bmp


;Registry keys
[RegData]
HKCU,Software\%AppName%,MajorVersion,0x00010001,1
HKCU,Software\%AppName%,MinorVersion,0x00010001,0
HKCU,Software\%AppName%,AppPath,0x00000000,%InstallDir%

;Shortcut created
[Shortcuts]
%AppName%,0,MyFirstInstalledApp.exe

Once I get my SP app finished up, I'll be writing an installer again. So if you are still stuck then, I will probably know more then than I do now. :)