Sign in to follow this  
brwarner

Distributing MDX apps

Recommended Posts

I am semi-new to MDX programming and have come to a point were I want to distribute a copy of the application. I used C# Express to make an install file and tried to install it on my computer and when it tries to run the application it says "Count not find Media file, ensure DirectX SDK is properlly installed" yet I can run it fine in debug in C# and I have the October 2005 release of DirectX SDK. CAn someone tell me what to do I am new at making setup files [Edited by - brwarner on December 3, 2005 2:37:54 PM]

Share this post


Link to post
Share on other sites
Hmm - try using the publish wizard ( if you didnt already ) and make sure you have the RUNTIME of the DirectX 9.0c not just the SDK

Share this post


Link to post
Share on other sites
I already had DirectX 9.0c Runtime and DirectX SDK October 2005 yet it still wont start. I had used the publish feature in C# the first time. I dont understand why it runs in C# when I debug but not on the computer.

Share this post


Link to post
Share on other sites
The problem is likely that you're using parts of the D3D utilities wrapper library, which looks for files in a folder called "Media" (for example for using with the UI). Do a search across your application AND the distributed framework for the name "Media", and then make sure that the parts you need out of the SDK folder can be found by your application (typically, copied into a Media folder in your applications' install folder).

To see exactly where the problem is coming from, attach the debugger to your process when your application is showing that dialog box, and then Break All, and see where the stack trace is coming from.

Share this post


Link to post
Share on other sites
You could try finding that error message (or better yet, the catches for the MediaNotFoundException) in the sampleframework utility classes using 'find in files'. Once you have the locations, you can add some code to show a message box with the file and line number where the exception was caught or thrown.

It's no elegant solution, but it should work. Now that I read through the sample framework code, you might also want to remove the throw; statements from the catch blocks for the MediaNotFoundException... no reason to crash your app when some media isn't found... Come on Microsoft, that's sooo Win98 ;)

The best solution is probably to roll in some decent logging, which is nearly always a good idea. On codeproject.com you'll find various good solutions, though this one here really stands out... gotta try that too some time as a replacement for my ugly global text file :)

Share this post


Link to post
Share on other sites
Thanks for the help, I found the error. After tracing it with replacing MediaNotFoundExceptions with my own I found that the computer could not find the .fx file Sample Browser makes when u create an empty project. Since it didnt seem to do anything I removed it and the program worked. Thank you all.

Share this post


Link to post
Share on other sites
I have written a small article for Coding4Fun that describes how to create an application template that uses the Sample Framework as the base application. Included in the Article is a way to include media files into the final build, with this when you use the automatic publish inside the Express editions these will all be included.

Coding4Fun - Creating an Application Template

Share this post


Link to post
Share on other sites
Looks like an interesting article, gotta read it more thoroughly tomorrow. I can't wait till we get VS2005, looks very flashy and powerfull indeed.

How do you become a writer for Coding4Fun anyway? Sounds like an interesting thing to have on your resume :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this