Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > How to add DirectX 9 as prerequisite to GenerateBootstrapper msbuild task?
 

How to add DirectX 9 as prerequisite to GenerateBootstrapper msbuild task?

How do Iadd DirectX 9 as prerequisite to the GenerateBootstrapper msbuild task?

All those tutorials on ClickOnce mention it is possible, but none show how.

Wout

Wout  Monday, October 01, 2007 2:28 PM

Yes Sir,

I've tried posting the solution a while back, but back then the forum wouldn't let me (buggy piece of cr@p!).

The solution has nothing to do with ClickOnce, you just have to instruct the bootstrapper what the prerequisite packages are.The bootstrapper is the setup.exe that can be used to bootstrap anything (ClickOnce, or msi).You must create a socalled 'bootstrapper package' in this folder: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages. I created a folder there: Microsoft.DirectX.9c. The folder contains the following files/folders:

file product.xml, file directx_aug2007_redist.exe, folder en. Folder en contains a file package.xml. I'll post the contents of these files below:

product.xml:

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="Microsoft.DirectX.9c" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<PackageFiles CopyAllPackageFiles="false">
<!-- HomeSite is a reference to a string defined in the package.xml file -->
<PackageFile Name="directx_aug2007_redist.exe" HomeSite="DirextXRedistributableUrl" PublicKey="3082010A0282010100CD819638AE5CA2F2C1DFDED0AB958DD63C9D1F8BC35D862E5DF0B172F5ABAC886AB5DAB1227B0BC8C8A54B915E2213E9F9F5239DB5F46E76AEEFEEA43CC7C4C0595C3FABB3733326A662816179A162F46E8895D06EDDC79FD2A451117661BA708A65A1961689A75D81D04466E5DB569E40CAFCDC76242E443000E5D67D7B9511D5581DA3E84F0BC988DCA2D653996CCA63CA996A9A925E4C4D11E82FD35B5B5E5F52A3732DA5BB84450D8C191576CB08DA9AA67015E84DEC69FD5DB26B8FED295137388BC6464915945098B0F468A4D7DE097167749E778C1D856B97EAE75F45CCE0E6710DD16300937B31988E0BB413BDB3D0EEF1DF21EEA96061EE37433DC30203010001" />
</PackageFiles>
<InstallChecks>
<RegistryCheck Property="DirectXVersion" Key="HKLM\SOFTWARE\Microsoft\DirectX" Value="Version" />
</InstallChecks>
<Commands Reboot="Defer">
<Command PackageFile="directx_aug2007_redist.exe">
<InstallConditions>
<BypassIf Property="DirectXVersion" Compare="VersionGreaterThanOrEqualTo" Value="4.09.00.0904" />
<BypassIf Property="DirectXVersion" Compare="VersionGreaterThanOrEqualTo" Value="4.09.0000.0904" />
</InstallConditions>
<ExitCodes>
<DefaultExitCode Result="Success" String="Anunexpected" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
</Commands>
</Product>

Package.xml:

<?xml version="1.0" encoding="utf-8"?>
<Package Name="DisplayName" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<Strings>
<String Name="Culture">en</String>
<String Name="DisplayName">Microsoft DirectX 9c</String>
<String Name="Anunexpected">An unexpected exit code was returned from the installer. The installation failed.</String>
<String Name="DirextXRedistributableUrl">http://download.microsoft.com/download/7/c/6/7c657ecc-f1d3-4cf2-8ff3-de9100d98a5d/directx_aug2007_redist.exe</String>
</Strings>
</Package>


I don't remember exactly how I got that PublicKey in the product.xml file unfortunately..., I did use the Bootstrapper Manifest Generator (BMG) at some point, so you might give that a try.

Your bootstrapper build file will look something like this:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Add any additional dependencies here -->
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.2.0">
<ProductName>Microsoft .NET Framework 2.0</ProductName>
</BootstrapperFile>
<!-- This requires the socalled package to be present in: -->
<!-- C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\Microsoft.DirectX.9c -->
<!-- These are present in the svn archive in the Deploy directory. -->
<BootstrapperFile Include="Microsoft.DirectX.9c">
<ProductName>DirectX 9c</ProductName>
</BootstrapperFile>
</ItemGroup>

<Target Name="BuildBootstrapper">
<GenerateBootstrapper
ApplicationFile="rundeploy.cmd"
ApplicationName="MySuperApp"
BootstrapperItems="@(BootstrapperFile)"
/>
</Target>

</Project>

(Oh, and again the post editor is totally screwing up code blocks, so I'm not using those)

Wout

Wout  Sunday, January 06, 2008 2:48 PM

Hi Wout,

I'm having the same problem. Found a solution yet ?

puyp  Thursday, November 08, 2007 9:08 PM

Yes Sir,

I've tried posting the solution a while back, but back then the forum wouldn't let me (buggy piece of cr@p!).

The solution has nothing to do with ClickOnce, you just have to instruct the bootstrapper what the prerequisite packages are.The bootstrapper is the setup.exe that can be used to bootstrap anything (ClickOnce, or msi).You must create a socalled 'bootstrapper package' in this folder: C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages. I created a folder there: Microsoft.DirectX.9c. The folder contains the following files/folders:

file product.xml, file directx_aug2007_redist.exe, folder en. Folder en contains a file package.xml. I'll post the contents of these files below:

product.xml:

<?xml version="1.0" encoding="utf-8"?>
<Product ProductCode="Microsoft.DirectX.9c" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<PackageFiles CopyAllPackageFiles="false">
<!-- HomeSite is a reference to a string defined in the package.xml file -->
<PackageFile Name="directx_aug2007_redist.exe" HomeSite="DirextXRedistributableUrl" PublicKey="3082010A0282010100CD819638AE5CA2F2C1DFDED0AB958DD63C9D1F8BC35D862E5DF0B172F5ABAC886AB5DAB1227B0BC8C8A54B915E2213E9F9F5239DB5F46E76AEEFEEA43CC7C4C0595C3FABB3733326A662816179A162F46E8895D06EDDC79FD2A451117661BA708A65A1961689A75D81D04466E5DB569E40CAFCDC76242E443000E5D67D7B9511D5581DA3E84F0BC988DCA2D653996CCA63CA996A9A925E4C4D11E82FD35B5B5E5F52A3732DA5BB84450D8C191576CB08DA9AA67015E84DEC69FD5DB26B8FED295137388BC6464915945098B0F468A4D7DE097167749E778C1D856B97EAE75F45CCE0E6710DD16300937B31988E0BB413BDB3D0EEF1DF21EEA96061EE37433DC30203010001" />
</PackageFiles>
<InstallChecks>
<RegistryCheck Property="DirectXVersion" Key="HKLM\SOFTWARE\Microsoft\DirectX" Value="Version" />
</InstallChecks>
<Commands Reboot="Defer">
<Command PackageFile="directx_aug2007_redist.exe">
<InstallConditions>
<BypassIf Property="DirectXVersion" Compare="VersionGreaterThanOrEqualTo" Value="4.09.00.0904" />
<BypassIf Property="DirectXVersion" Compare="VersionGreaterThanOrEqualTo" Value="4.09.0000.0904" />
</InstallConditions>
<ExitCodes>
<DefaultExitCode Result="Success" String="Anunexpected" FormatMessageFromSystem="true" />
</ExitCodes>
</Command>
</Commands>
</Product>

Package.xml:

<?xml version="1.0" encoding="utf-8"?>
<Package Name="DisplayName" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<Strings>
<String Name="Culture">en</String>
<String Name="DisplayName">Microsoft DirectX 9c</String>
<String Name="Anunexpected">An unexpected exit code was returned from the installer. The installation failed.</String>
<String Name="DirextXRedistributableUrl">http://download.microsoft.com/download/7/c/6/7c657ecc-f1d3-4cf2-8ff3-de9100d98a5d/directx_aug2007_redist.exe</String>
</Strings>
</Package>


I don't remember exactly how I got that PublicKey in the product.xml file unfortunately..., I did use the Bootstrapper Manifest Generator (BMG) at some point, so you might give that a try.

Your bootstrapper build file will look something like this:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- Add any additional dependencies here -->
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.2.0">
<ProductName>Microsoft .NET Framework 2.0</ProductName>
</BootstrapperFile>
<!-- This requires the socalled package to be present in: -->
<!-- C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\Microsoft.DirectX.9c -->
<!-- These are present in the svn archive in the Deploy directory. -->
<BootstrapperFile Include="Microsoft.DirectX.9c">
<ProductName>DirectX 9c</ProductName>
</BootstrapperFile>
</ItemGroup>

<Target Name="BuildBootstrapper">
<GenerateBootstrapper
ApplicationFile="rundeploy.cmd"
ApplicationName="MySuperApp"
BootstrapperItems="@(BootstrapperFile)"
/>
</Target>

</Project>

(Oh, and again the post editor is totally screwing up code blocks, so I'm not using those)

Wout

Wout  Sunday, January 06, 2008 2:48 PM

You can use google to search for other answers

Custom Search

More Threads

• Using [TARGETDIR] in install
• pfx import file password while building
• MSI Setup Problem
• Updating project without changing DB
• Clickonce Error
• How to conditionally Enable/disable the next Button in Setup
• Needs to identify the system uniquely
• Tutorial about deployment project
• FTP Publishing Failing in VS 2008 RTM
• Access database and ClickOnce