keyongtech


  keyongtech > pocketpc.* > pocketpc.developer > 10/2005

 #1  
10-13-05, 03:28 PM
Michael Gledhill
The subject says it all really.
In VS2005 (I'm reluctantly using RC1), does anyone know what's happened
to the infinitely useful "Build CAB file" option ?

In VS2003, you used to be able to have your Smart Device project, maybe
add in a few images, directories and so on, and it'd package it all up into a
single .cab file for you.

Has this essential feature been removed from VS2005 ?


Mike
 #2  
10-13-05, 04:09 PM
Michael Gledhill
Utterly incredible.

MS has *removed* the "Build CAB file" option from VS2005, and you
now have to manually create all of the paths and settings yourself.
http://msdn2.microsoft.com/en-us/library/zcebx8f8.aspx

Let's take an example. Your Smart Device project already has an
"images" directory in it, and you've carefully told VS2005 which files
are Content (to be copied to the device), which are embedded resources,
and so on.

Pah, VS2005 doesn't care.
You now have to create a "Setup and Deployment" project - one
per Smart Device project, tell it the directory names to create (you
already know this !), and tell it which files to put in those directories
and the subdirectories (you already know this aswell !!)

Somebody.. please... help me out here.
What possibly reason is there behind asking your users to enter
the same information all over again, and open up the possibility of
creating errors ?
For example, if I add an extra image to my "images" directory,
now I *have* to remember to add this to my "Setup and
Deployment" project.
With VS2003, it would already pick up this new file, realise it was
of type Content, and include it in the .cab automatically.

One giant leap for MS, one huge step backwards for
developers..


Mike
(Currently averaging 15-20 new swear words per hour.)


"Michael Gledhill" wrote:
[..]
 #3  
10-13-05, 04:38 PM
Michael Gledhill
It gets worse.

So, you waste your time in VS2005.
You create your "Setup and Deployment" project. You carefully add
each file from your SmartDevice project, making sure you don't miss
anything, and that each file is going to be installed into the correct
directory on your device.

And you Build the project.

VS2005 creates an .inf file, containing a huge amount of redundancy
in it - the [SourceDiskNames] will happily repeat the source directory
numerous times. So if you've specified you've got three images in a
"images" subdirectory, your .inf file is likely to have three source
directories, all pointing at the same directory on your PC. Finding
problems in this .inf file has just entered a whole new level.

But after all that, it builds the .cab, you give yourself a pat on the
back. You make sure it's got an OSVersionMin value of 3.0 and a
maximum of 5.99.. you drag it to your Wm2003 SE2 device,
install it and -

"The file "xxxxxx.cab" is not a valid Windows CE Setup file."


Aaaaaaaaaaaaaaaaaggggggggggghhhhhhhhhhh !!!!

I surrender.
Seriously, I do.

It's time to "upgrade" back to VS2003.


Michael
(Now upto 25-30 swear words per hour, and increasing..)
 #4  
10-13-05, 05:27 PM
Michael Gledhill
Okay, final posting of the day, I promise.

Well, that error: "The file "xxxxxx.cab" is not a valid Windows
CE Setup file." was a result of me not manually changing the
following line in the VS2005 created .inf file:
BuildMax=0xA0000000


So, to save you guys hours of wasted time, here's how to create
a .cab which'll work on your WM2003 devices and above.

(Deep breath.)

1. Waste an hour of your time creating a "Setup and Deployment"
project in VS2005, and let it know all of the dependant projects,
where to put whichever files you simply want to copy to the device
during installation.
2. Once VS2005 has built the .cab has built, delete it. Yup, really.
3. Open up the .inf file, and replace the BuildMax line with this
one:
BuildMax=0xA0000000
4. Right, now you need to re-build your .cab file. Go back into
VS2005, and cut'n'paste the last command it ran (shown in the
Output window) to create that .cab. It'll start off something like:

"c:\Program Files\Microsoft Visual Studio 8\smartdevices\
sdk\sdktools\cabwiz.exe" "C:\projects\.... etc"

Simply cut'n'paste that command into your own .bat file, put
the .bat file in your directory with the .inf file, and run it from
there.

You *should* now have a .cab that'll run on your WM2003
devices.


Oh, and next time you Build your "Setup and Deployment"
project, to make sure all of your included project .exe's are
up-to-date... you'll need to do all this again. VS2005 will
have just undone that change you made to the .inf file.

Unless someone else out there knows better...


Mike


"Michael Gledhill" wrote:
[..]
 #5  
10-13-05, 09:58 PM
The PocketTV Team
"Michael Gledhill" <mikeg> wrote in message
news:c832
>
> Okay, final posting of the day, I promise.
>
> Well, that error: "The file "xxxxxx.cab" is not a valid Windows
> CE Setup file." was a result of me not manually changing the
> following line in the VS2005 created .inf file:
> BuildMax=0xA0000000


; BuildMax definition used by Windows Mobile 2003 Second Edition and later:
; 0xA0000000 Application supports square screens.
; 0xC0000000 Application supports screen rotation.
; 0xE0000000 Application supports square screens and screen rotation.

BuildMax=0xE0000000 ; support for square screens and screen rotation

I think BuildMax=0xE0000000 is better?
 #6  
10-14-05, 09:35 AM
Michael Gledhill
> I think BuildMax=0xE0000000 is better?

Errrm, but on a WM2003 (not Second Edition) device which doesn't
support screen rotation, this setting makes the .cab uninstallable on
the device.

The infuriating thing is that VS2005 doesn't let you specify which
OS type you're compiling for.

So everytime I build my .cab in VS2005, I have to discard the one
VS2005 has just produced, go into the .inf file and change that setting
back to

> BuildMax=0xA0000000


...and rebuild the .cab manually.

I'll say it again : what were MS thinking when they got rid of
the simple "Build\Build new Cab" menu item ?

Having to manually create a .cab file project, and tell it about
all of your project's extra files/images that you want included in
the .cab file and where to put them.. when VS2005 already has
this knowledge in the SmartDevice project itself is a complete
waste of our time.


Mike


"The PocketTV Team" wrote:
[..]
 #7  
10-14-05, 12:57 PM
Michael Gledhill
A day later...
Okay (deep breath).

So, in my "Cab Deployment\Release" directory, I've now made myself
a nice .bat file to :

- delete the unuseable .cab file that VS2005 created
- run a command-line search'n'replace utility to replace the BuildMax
string as previous described, and ALSO to replace a string concerning
Shortcuts.
Do a similar search'n'replace on the Shortcuts section. VS2005
creates a [Shortcuts] section like this:

[Shortcuts]
"MikesProject",0,"MikesProject.exe","%CE11%"

Errr, no. The result of this is that no Shortcuts get added to the
Programs screen. Once again, I need to manually replace this to
get rid of the speechmarks:

[Shortcuts]
"MikesProject",0,"MikesProject.exe",%CE11%

And now it'll work fine, and put a shortcut to my program in
the Programs screen. (Sigh.)

- run cabwiz to create the new cab file.



Full of bugs, a huge waste of time, and cabwiz can no longer
COMPRESS the files that go into the .cab file (with WM2003 devices).

Is there anyone in the VS2005 who'd like to comment on this section
of the program's terrible functionality ?


Mike
 #8  
10-14-05, 01:30 PM
Chris Scott
I haven't tried for VS2005 but with the old eVC compilers I created build
scripts in batch files that would build all my dll's and executables, copy
them into the appropriate folders for creating the CAB files and then kick
off a process that builds the cab files.

It took a couple of hours to setup but then a complete application rebuild
took about 5 minutes to build Pocket PC, Pocket PC 2002, 2003 and 2003 SE
versions and have CAB and setup files all set to go.

I feel your pain but you may as well just do this part yourself. I don't
think I'd trust Microsoft to get my final build properly automated anyway.
 #9  
10-14-05, 02:46 PM
Michael Gledhill
Hi Chris,

> I haven't tried for VS2005 but with the old eVC compilers I created build
> scripts in batch files that would build all my dll's and executables


Yes, I do the same when I use eVC.

However, with Visual Studio 2003, Microsoft introduced a great
"Build CAB File" menu option to do all the hard work for you. All
of your extra files that you'd want included in the project (such
as external images files, .xml files to be copied, etc) would be
automatically included in the cab, and the .cab would install them
to the directories you'd specified.

Fast forward to two years later...

With VS2005, the menu item's gone, and even following MS's
own instructions to setup a deployment .cab project, you end up
creating a .cab file which won't run on WM2003 devices, and the
Shortcut you've asked it to create won't ever appear as VS2005
puts a syntax error in the .inf file that it creates.

It's a farce !


Mike


"Chris Scott" wrote:
[..]
 #10  
10-14-05, 04:33 PM
Robert Wachtel
Hi!

Michael Gledhill wrote:
> With VS2005, the menu item's gone, and even following MS's
> own instructions to setup a deployment .cab project,
> you end up creating a .cab file which won't run on WM2003 devices,
> and the Shortcut you've asked it to create won't ever appear
> as VS2005 puts a syntax error in the .inf file that it creates.


http://msdn2.microsoft.com/en-us/library/zcebx8f8.aspx

Following these steps and setting the OSVersionMin to 3.00 VS2005 RC builds
perfect cabs with the right BuildMax setting of 0xA0000000 and shortcuts
which install on WM2003 devices w/o any flaws.

Greetings from Cologne

Robert
 #11  
10-14-05, 04:55 PM
Michael Gledhill
(Stay calm, Mike... Stay calm...)


> Following these steps and setting the OSVersionMin to 3.00 VS2005 RC builds
> perfect cabs with the right BuildMax setting of 0xA0000000 and shortcuts
> which install on WM2003 devices w/o any flaws.



Nope.
Not true at all.

My two Deployment projects both already have OSVersionMin set
to 3.0.

Both projects build beautiful .cab files which won't run on WM2003
non-SE devices.

Both projects build .inf files with an error in the [Shortcuts] section
which need to be modified for the Shortcut to appear in the Programs
screen.

Yesterday, I did read - and carefully follow - the instructions in that
link you sent me. But it simply doesn't work correctly.


Mike




"Robert Wachtel" wrote:
[..]
 #12  
10-14-05, 05:04 PM
Robert Wachtel
Hi!

Michael Gledhill wrote:
>
> (Stay calm, Mike... Stay calm...)


Didn't want to offend you ;-)

> My two Deployment projects both already have OSVersionMin set
> to 3.0.


Hmmm, and despite of this the BuildMax setting is incorrect?

> Both projects build beautiful .cab files which won't run on WM2003
> non-SE devices.


Here it works...

> Both projects build .inf files with an error in the [Shortcuts] section
> which need to be modified for the Shortcut to appear in the Programs
> screen.


Ok, my fault, I didn't test the shortcuts on non-SE devices (it works on SE
devices though) and I won't do it before tuesday - enough worked this week
;-)

> Yesterday, I did read - and carefully follow - the instructions in that
> link you sent me. But it simply doesn't work correctly.


Hmm, so let's wait for the final VS2k5 (or SP1 <veg>).

Greetings from Cologne

Robert
 #13  
10-15-05, 01:43 AM
The PocketTV Team
> cabwiz can no longer
> COMPRESS the files that go into the .cab file (with WM2003 devices).


you have to pass the /compress option, and it will compress the CAB.
 #14  
10-15-05, 01:49 AM
The PocketTV Team
"Michael Gledhill" <mikeg> wrote in message
news:f316
>
>> I think BuildMax=0xE0000000 is better?

>
> Errrm, but on a WM2003 (not Second Edition) device which doesn't
> support screen rotation, this setting makes the .cab uninstallable on
> the device.


But when you use:

BuildMax=0xA0000000

will it install on 2003SE devices?

I think BuildMax=0xE0000000 should install on WM2003 (not Second Edition)
device which doesn't support screen rotation, because all it means is that
the application SUPPORTS screen rotation, not that it REQUIRES the device to
have it.

likewise, 0xA0000000 means Application supports square screens, does not
mean that it requires the device to have a square screen.

So I think BuildMax=0xE0000000 should be used when you make a CAB that works
on all 2003 and 2003SE devices (i.e. app support square screen and
rotation).
 #15  
10-15-05, 01:50 AM
The PocketTV Team
> My two Deployment projects both already have OSVersionMin set
> to 3.0.
>
> Both projects build beautiful .cab files which won't run on WM2003
> non-SE devices.


remember that 2000, 2002 (and maybe non-SE?) do not accept CAB files that
have the [Platform] section!

Similar Threads
VS2005, Include "TAPI3.H" and get a compiler error "Cannot open include file: 'ddraw.h'"

On Visual Studio 2008, I can include TAPI3.h and use the TAPI COM object with no real difficulties, other than learning curve. On Visual Studio 2005, the same code produces...

VS2005 - "Always show Error List if build finishes with errors" not working

Hi there, I have a fresh install of Visual Studio 2005 and I'm trying to get my setting up the way I like it. Under tools -> options -> Projects and Solutions there's a...

VS2005 equivalent of the "Supported Runtimes" build setting from VS2003?

In VS2003 you can specify whether your project will support 1.1 or 1.0. This does not mean *targetting* 1.1 or 1.0, it simply specifies compatability. But I can't find a...

build error "duplicate reference", biztalk2006, VS2005

Hi, I'm having problems with a test biztalk 2006 project in VS 2005. I'm trying to use the call rules shape from a simple orchestration, to call a BRE policy which accepts a...

<form target="UseIt" action="https://www.abc.com/cgi-bin/routines" method="post">

I have the following code: <form target="UseIt" action="https://www.abc.com/cgi-bin/routines" method="post"> <input type="hidden" name="day" value="tues"> <input...


All times are GMT. The time now is 05:59 AM. | Privacy Policy