OpenNetCF cab confusion

T

Tim Johnson

I did a very simple test to try to understand the cab file building process.
I have a test PocketPC app that just uses the OpenNETCF SoundPlayer to play
the alarm1.wav file when a button is clicked. If I do "Build Cab File" I
notice that the .INF file it creates refers to a "vsd_config.txt.ARMV4" file
which contains references to the OpenNetCF cab file and dlls, as well as the
..net CF cab files and dlls.

All the The cab files being referenced are on C:\Program Files\Microsoft
Visual Studio .NET 2003\CompactFrameworkSDK\v1.0.5000\Windows
CE\wce300\ARMV4.

If I do deploy this "TestCab" app from VS, all the dlls get downloaded and
the app works. But if I don't do that, but instead only copy the CAB file
to the device and open it, I get this message:

"TestCab requires the installation of OpenNETCF.SDF.ppc3.ARMV4.CAB for it to
run properly. Install the Cab file before running this application".

In fact, even if I first copy that cab file down and run it, then re-run my
cab, I get exactly the same message.

However if I ignore those messages and then run my app, it works - it plays
the wav file.

Odder still, if I go into /Windows and delete all the "OpenNetCF*" dlls, my
app still works. Kinda mystifying.

I guess I thought creating a CAB file of my app would generate everything
I'd need to deploy it, ie it would include the cab files it's dependent on.
Is there any way to create a single CAB file that contains everything my app
needs to be deployed?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
C

Chris Tacke, eMVP

The CAB roller in Studio leaves a lot to be desired. It will not add
dependencies for you. The best thing to do is tell it to make your CAB,
then go in and hand-modify the generated INF file and from that point on
always manually generate the CABs.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
T

Tim Johnson

I'm good with that - but do I hand-include the OpenNetCF cab file, or the
various dlls that make it up? In other words, can a cab contain a cab and
run it during install?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
P

Peter Foot [MVP]

You can nest a cab file (without writing a custom setup dll to handle the
installation), you'd be better off just putting all the dlls within your cab
(or just those that you use) to your application folder. You can
alternatively deploy all the dlls plus the .gac file to allow them to be
moved to the gac on first run, then they will be available to all
applications on the device.

Peter
 
T

Tim Johnson

Would that also apply to the .Net dlls referenced in the
netcf.all.wce4.armv4.cab in the vsd_config.txt.ARMV4 file (see below), as
well as SqlCe? I had another thread here about how to deploy .Net as cabs
and the consensus was you can't, you have to run an MSI file on a desktop
while the PDA is cradled to it. But couldn't I include the .Net dlls by
hand too?

I'm dealing with a situation where the PDA goes totally dead in the field
and I'd like to have an SD card to install everything from - .Net CF,
OpenNet, SqlCe, etc plus my app. Possible?

Contents of vsd_config.txt.ARMV4:
MyApp
0,netcf.all.wce4.armv4.cab,Mscoree.dll,1,0,2268,00,,,,,,6
0,netcf.all.wce4.armv4.cab,Mscoree1_0.dll,1,0,2268,00,,,,,,6
0,netcf.all.wce4.armv4.cab,Cgacutil.exe,1,0,2268,00,,,,,,6
0,netcf.all.wce4.armv4.cab,Netcfagl1_0.dll,1,0,2268,00,,,,,,6
0,netcf.all.wce4.armv4.cab,Calendar_1_0.nlp,,,,,,,,,,
0,netcf.all.wce4.armv4.cab,Charinfo_1_0.nlp,,,,,,,,,,
0,netcf.all.wce4.armv4.cab,Culture1_1_0.nlp,,,,,,,,,,
0,netcf.all.wce4.armv4.cab,Culture2_1_0.nlp,,,,,,,,,,
0,netcf.all.wce4.armv4.cab,Region_1_0.nlp,,,,,,,,,,
0,netcf.all.wce4.armv4.cab,Mscorlib.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.drawing.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.web.services.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.windows.forms.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.windows.forms.datagrid.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.xml.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.net.irda.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,System.data.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,Microsoft.visualbasic.dll,1,0,2268,00,7,0,5000,0,969db8053d3322ac,1
0,netcf.all.wce4.armv4.cab,Microsoft.windowsce.forms.dll,1,0,2268,00,1,0,5000,0,969db8053d3322ac,1
1,sqlce.wce4.armv4.cab,\windows\SQLCE 2.0\Ssceca20.dll,2,0,4415,0,,,,,,6
1,sqlce.wce4.armv4.cab,\windows\SQLCE 2.0\Ssce20.dll,2,0,4415,0,,,,,,6
1,sqlce.wce4.armv4.cab,System.data.common.dll,1,0,2268,0,1,0,5000,0,969db8053d3322ac,1
1,sqlce.wce4.armv4.cab,System.data.sqlserverce.dll,1,0,2268,0,1,0,5000,0,969db8053d3322ac,1
1,sqlce.wce4.armv4.cab,Sscemw20.dll,2,0,4415,0,,,,,,6
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Windows.Forms.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Drawing.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Data.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Net.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Xml.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Notification.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.VisualBasic.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Phone.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1
9,OpenNETCF.SDF.ppc3.ARMV4.CAB,OpenNETCF.Web.Services2.dll,1,2,443,0,1,2,3346,0,30c767b29d52d6e6,1


--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
P

Peter Foot [MVP]

One way to do this is to write a simple eVC++ autorun.exe and use it to call
createprocess with wceload.exe for each of the cab files, if you use the
/noaskdest and /noui switches it will be automatic without prompting the
user. If you are going down the autorun route you might as well install the
opennetcf cab in this way too e.g. in this order:-
..NETCF
Sql CE
OpenNETCF
Your App

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org
 
T

Tim Johnson

Thanks, I think that's where I'm heading now. A few questions:

1. ".NETCF" does it consist of just one or both of these files I found
floating around my desktop:
netcf.core.ppc3.ARMV4.cab
netcf.all.wce4.ARMV4.cab

Limited experiments give inconsistent results on different PDAs so I'm just
using them both to make sure.

2. Is wceload guaranteed to be on the system? What would happen if I just
did CreateProcess of the cab files themselves?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
T

Tim Johnson

How does one make a directory or file on an SD card read-only? I'd like to
put the cab files there but they get consumed on execution.

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
T

Tim Johnson

Almost there!

I now have these DLLs being copied to /Windows in my CAB file:

OpenNETCF.dll
OpenNETCF.Drawing.dll
OpenNETCF.Windows.Forms.dll

When I run my app, which uses the SoundPlayer class, from /Windows/Start
Menu, it complains that it can't load OpenNETCF.Windows.Forms.SoundPlayer

If I run the big OpenNET cab, it all works. What am I missing?
--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
P

Peter Foot [MVP]

1. These are different versions of the runtime - core.ppc3 is for
PPC2000/2002 devices based on Win CE 3.0, all.wce4 is suitable for PPC2003
devices.

2. wceload is required on any system to process cab files, while you can use
ShellExecute on a cab file if you call wceload with the cabfile as an
argument you can also set other command line arguments

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net |
http://www.opennetcf.org
 
P

Peter Foot [MVP]

You have two choices - copy the specific dlls to your app folder, or install
them to the GAC. Unlike native dlls a managed dll in the windows folder is
not visible to your application (unless your exe resides in \windows\ which
is unlikely). In fact to allow for another installation to install the SDF I
would recommend placing these dlls in your app folder, otherwise it may
cause problems further down the line.

Peter
 
T

Tim Johnson

Amazing - to set read-only/hidden on the mobile, I need a desktop and
ActiveSync. I hope this is still just "on the way" towards the mobile
future! :)

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
T

Tim Johnson

Understood.

If I did want them global, how do I install to the GAC within my .INF for a
manual cab build?

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
T

Tim Johnson

Also, does anyone know how to suppress the annoying "may not work on this
operating system" message that comes up on Windows SE? I see this for .Net
and SqlCE cabs, as well as my own cab files.

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 
T

Tim Johnson

Thanks for the GAC link.

The "may not work" message is something else I think, only applying to
Windows SE. I vaguely remember reading about how there's some flag you can
set somewhere (in the OS? in the CAB? in my project?) to fool SE into
thinking it's the "correct" version of the operating system. I get this
message from my own cab which is compiled under VS for PPC03 SDK, as well as
SqlCe for wce4.

--

Tim Johnson
High Point Software, Inc.
www.high-point.com
(503) 312-8625
 

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