Code Snippet
void CustomInstaller_BeforeInstall(object sender, InstallEventArgs e)
{
// Find the location where the application will be installed
string installPath = GetAppInstallDirectory();
// Create the target directory
Directory.CreateDirectory(installPath);
// Copy your application files to the directory
foreach (string installFile in Directory.GetFiles(TEMP_PATH))
{
File.Copy(installFile, Path.Combine(installPath,
Path.GetFileName(installFile)), true);
}
// Get the path to ceappmgr.exe
RegistryKey keyAppMgr =
Registry.LocalMachine.OpenSubKey(CEAPPMGR_PATH);
string appMgrPath = (string)keyAppMgr.GetValue(null);
keyAppMgr.Close();
// Run CeAppMgr.exe to install the .net framework if needed onto the device
System.Diagnostics.Process.Start(appMgrPath,
"\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE_FRAMEWORK_SETUP) + "\"");
// Run CeAppMgr.exe to install the files for nelson to the device
System.Diagnostics.Process.Start(appMgrPath,
"\"" + Path.Combine(installPath, CEAPPMGR_INI_FILE_NELSON_SETUP) + "\"");
}