WinCE Deployment

A

Adam

I am trying to deploy wince with SQLCE, SQL, and Compact framework in 1
installation package using .Net installation projects etc (per MS rec.).
After much frustration I have the whole lot getting (nearly) working for the
correct device.

My question is, in the .Net project where you specify the custom actions and
the class that runs the application manager, should you run the app manager
4 times with 4 different classes, or 4 times within the one class, or once
somehow, pointing to the 4 ini files ?

It worked correctly for 2 cabs, but when i introduced the 4 it only installs
the framework, and misses installing the rest (timing I guess).

I have read the MS article, but it only goes into 1 cab file deployment
which is the app you are running.

cheers

adam
 
E

Ercan Turkarslan [MSFT]

Hi Adam,

You need to call CeAppMgr with different INI file for each component.

The below code is from "Developing and Deploying Pocket PC Setup
Applications" article in MSDN. I modified it to install .NET CF before the
application.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/h
tml/netcfdeployment.asp

You should keep in mind that you should start CeAppMgr process with
WaitForExit method. This will ensure that .NET CF is installed before you
application starts installing. Otherwise your application installation will
cancel .NET CF installation.

=======================================================
Private Sub Installer_AfterInstall(ByVal sender As Object, _
ByVal e As System.Configuration.Install.InstallEventArgs) _
Handles MyBase.AfterInstall

' get fullpath to .ini file
Dim arg As String = Path.Combine(Path.GetDirectoryName( _
System.Reflection.Assembly.GetExecutingAssembly().Location), _
"Setup.ini")

' run WinCE App Manager to install .cab file on device
=MODIFIED============================================
RunAppManager(Path.Combine(arg, "NETCFSetup.ini"))
RunAppManager(Path.Combine(arg, "MyApp.ini"))
=======================================================
End Sub

Private Sub Installer_AfterUninstall(ByVal sender As Object, _
ByVal e As System.Configuration.Install.InstallEventArgs) _
Handles MyBase.AfterUninstall
' run app manager in uninstall mode (without any arguments)
RunAppManager(Nothing)
End Sub

Private Sub RunAppManager(ByVal arg As String)
' get path to the app manager
Const RegPath As String = "Software\Microsoft\Windows\" & _
"CurrentVersion\App Paths\CEAppMgr.exe"

Dim key As RegistryKey = Registry.LocalMachine.OpenSubKey(RegPath)
Dim appManager As String = CStr(key.GetValue(""))

If Not (appManager Is Nothing) Then
If arg Is Nothing Then
Process.Start(String.Format("""{0}""", appManager))
Else
' launch the app
=MODIFIED============================================
Process.Start( _
String.Format("""{0}""", appManager), _
String.Format("""{0}""", arg)).WaitForExit()
=======================================================
End If
Else
' could not locate app manager
MessageBox.Show("Could not find app manager")
End If
End Sub

Thanks

Ercan Turkarslan [MSFT]
Microsoft Mobile Devices Developer Support

(e-mail address removed)


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top