Sunday, May 06, 2007

XNA, clickonce and MSBuild

The last few months I have been working with XNA off and on. To be honest, mostly working on subversion and clickonce. I don't have a lot to show right now, but that is the nice thing about clickonce is that when I do get more of the game done then it will be automaticly updated.

I am hosting the site from my home computer right now through, so if the site may be down if my computer is off. Secondly, the bootstrap should install all the necessary prerequisites, but if it doesn't then the links are listed below. Here is my current progress. BTW, the images are SUPER large right now, so it might take awhile to download. I am currently working on reducing the size of the images and creating a Xbox 360 version.

XNA Prerequisites for the PC

.NET Framework 2.0
Microsoft XNA Framework Refresh

For those wonder how I got Clickonce to deploy the converted textures and not the source textures, I had to use a little MSBuild hack in the .csproj file. After poking around in MSBuildBinPath and looking through the Microsoft.Common.targets file I realized that some of the Publish functionality can be overriden by overriding MSBuild targets. All I needed to do was add the files to be published in the MSBuild script. Specificly, I needed to override the _DeploymentComputeClickOnceManifestInfo target and add files from my Content directory in my build output. Here is the code to do this:

<!--Override _DeploymentComputeClickOnceManifestInfo Manifest so I can add content files that I need-->

<!-- Grab just the serialization assemblies for a referenced assembly. There may also be a symbols file in ReferenceRelatedPaths -->
<CreateItem Include="@(_ReferenceSerializationAssemblyPaths)" Condition="'%(Extension)' == '.dll'">
<Output TaskParameter="Include" ItemName="_SGenDllsRelatedToCurrentDll0" />
<CreateItem Include="@(_SGenDllsRelatedToCurrentDll0->'%(FullPath)')">
<Output TaskParameter="Include" ItemName="_SGenDllsRelatedToCurrentDll" />

<!-- Flag primary dependencies-certain warnings emitted during application manifest generation apply only to them. -->
<CreateItem Include="@(ReferencePath)" AdditionalMetadata="IsPrimary=true" >
<Output TaskParameter="Include" ItemName="_DeploymentReferencePaths"/>

<!-- Create list of items for manifest generation -->

<Output TaskParameter="OutputAssemblies" ItemName="_DeploymentManifestDependencies"/>
<Output TaskParameter="OutputFiles" ItemName="_DeploymentManifestFiles"/>


<!--here is where I add the extra content-->
<CreateItem Include="$(OutDir)Content\**\*">
<Output ItemName="ExtraFiles" TaskParameter="Include" />

<CreateItem Include="@(ExtraFiles)" AdditionalMetadata="TargetPath=Content\%(RecursiveDir)%(Filename)%(Extension);IsDataFile=false;DependencyType=Install;">
<Output ItemName="_DeploymentManifestFiles" TaskParameter="Include" />
<!--END - here is where I add the extra content-->

<CreateProperty Value="ClickOnce">
<Output TaskParameter="Value" PropertyName="_DeploymentManifestType"/>

<!-- Obtain manifest version from ApplicationVersion and ApplicationRevision properties -->
<FormatVersion Version="$(ApplicationVersion)" Revision="$(ApplicationRevision)">
<Output TaskParameter="OutputVersion" PropertyName="_DeploymentManifestVersion"/>

<FormatUrl InputUrl="$(_DeploymentUrl)">
<Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedDeploymentUrl"/>

<FormatUrl InputUrl="$(SupportUrl)">
<Output TaskParameter="OutputUrl" PropertyName="_DeploymentFormattedSupportUrl"/>


No comments: