If your app uses the OpenNETCF library, you need to add the following
steps to the tutorial:
1. Add OpenNETCF cabs for your Windows CE 3.0 platforms. Right-click
on the Setup Project, View->File System. Right-click on "Application
Folder" and choose Add->File. Browse to C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows CE\, add
"netcf.core.ppc3...cab" and "netcf.core.wce4...cab" for each
architecture. These are in the subdirectories of wce300 and wce400.
You should find 9 cab files.
2. Add .ini file for the PocketPC setup. Browse to your solution
directory outside of Visual Studio. Create a new text file called
"OpenNETCF.ini" and its contents should be as follows (needs no
modification):
[CEAppManager]
Version = 1.0
Component = OpenNETCF
[OpenNETCF]
Description = OpenNETCF Smart Device Framework
CabFiles = OpenNETCF.SDF.PPC3.ARM.CAB,OpenNETCF.SDF.PPC3.ARMV4.CAB,
OpenNETCF.SDF.PPC3.x86.CAB,OpenNETCF.SDF.WCE4.ARMV4.CAB,
OpenNETCF.SDF.WCE4.MIPSII.CAB,OpenNETCF.SDF.WCE4.MIPSIV.CAB,
OpenNETCF.SDF.WCE4.SH3.CAB,OpenNETCF.SDF.WCE4.SH4.CAB,
OpenNETCF.SDF.WCE4.X86.CAB
Once the file has been created, go back to Visual Studio, right-click
on "Application Folder" and choose Add->File. Browse to the Solution
directory, Click on OpenNETCF.ini and click "Open."
3. Now we need to let the installer know about these files. What we
need to do is to slightly change the Installer_AfterInstall event
handler of the Class1 in the Class Library. Replace it with the
following:
private void Installer_AfterInstall(object sender,
System.Configuration.Install.InstallEventArgs e)
{
// get full path to .ini file
string arg1 = Path.Combine(
Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location),
"Setup.ini");
string arg2 = Path.Combine(
Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location),
"Runtime.ini");
string arg3 = Path.Combine(
Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location),
"OpenNETCF.ini");
string arg = arg1 + "\" \"" + arg2 + "\" \"" + arg3;
// get path to the app manager
const string RegPath = @"Software\Microsoft\Windows\" +
@"CurrentVersion\App Paths\CEAppMgr.exe";
RegistryKey key =
Registry.LocalMachine.OpenSubKey(RegPath);
string appManager = key.GetValue("") as string;
if (appManager != null)
{
// launch the app
Process.Start(
string.Format("\"{0}\"", appManager),
(arg == null) ? "" : string.Format("\"{0}\"", arg));
}
else
{
// could not locate app manager
MessageBox.Show("Could not launch the WinCE
Application Manager.");
}
}
Good luck,
Antao