Win32 Version Information

  • Thread starter Thread starter Ryan
  • Start date Start date
R

Ryan

Hi All,

I need a little help with getting Win32 version information into my
Pocket PC application. I've had a good look around and found a a good
example on Neil Cowburn's blog [1]. The code he lists in his blog
doesn't work for applications built with Visual Studio 2005 until I
noticed some addition information in one of the comments. It suggests
adding the follow to the project file:

<Target Name="Build">
<CallTarget Targets="PreBuildEvent">
</CallTarget>
<CallTarget Targets="ResolveAssemblyReferences">
</CallTarget>
<CallTarget Targets="CoreResGen">
</CallTarget>
<CallTarget Targets="CoreCompile">
</CallTarget>
<CallTarget Targets="_CopyFilesMarkedCopyLocal">
</CallTarget>
<CallTarget Targets="CopyFilesToOutputDirectory">
</CallTarget>
</Target>

When I do this I get the version number but loose all the compiled in
resources i.e. picture box images set a design time, xml files included
as resources etc. Can anybody point me in the direction of a solution
that will allow me to keep my resources and the version number? I don't
know enough about the build process to workout which bit is doing what.

The application is deployed by a desktop application to a memory card
and we want to make sure its the latest version with out continually
downloading code as some clients are on dial up connections.

Many thanks
Ryan

[1]
http://blog.opennetcf.org/ncowburn/...rsionToYourNETCompactFrameworkAssemblies.aspx
 
Following up on my own post I've worked out a solution using another
blog posting and a bit of hacking.

I used the VC++ part of visual studio 2005 to generate a rc file with
the required version information. I called this Win32Version.rc. I the
copied the files resource1.h and Win32Version.rc into my project folder.
I then created a pre-build event on my C# project like this:

"$(DevEnvDir)..\..\SDK\v2.0\bin\rc.exe" /i
"$(DevEnvDir)..\..\VC\atlmfc\include" /i
"$(DevEnvDir)..\..\VC\PlatformSDK\Include" /r "$(ProjectDir)Win32Version.rc"

Then I modified the project file and added

<Win32Resource>Win32Version.res</Win32Resource>

to the first <PropertyGroup> section.

Hit build and got all the version information and embedded resources in
my application. The hiccup is the application icon doesn't display on
the desktop PC but it does on the PDA so I'm not really fussed about that.

I hope this helps somebody else out.
Ryan


[1]
http://blogs.msdn.com/cheller/archi...est-in-an-assembly-let-me-count-the-ways.aspx
 
Back
Top