• Advertisement
Sign in to follow this  

[.net] [MDX] Managed bindings bundling and Limited User accounts

This topic is 4048 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've almost finished a game which I'm planning on putting up for public release on my website, and I have a bit of a dilemma about the managed runtimes. MS recommends you install the MDX bindings / or the correct version of DX9.0c behind the scenes while the game is installing. This would be fine on a machine where there are full admin access privelages, however, on a limited user account, installing the game isn't possible without admin privelages. (please correct me if I'm wrong) Currently, I've been bundling the MDX bindings with the test releases of the game, since several of the testers weren't keen on downloading the latest version of DX. Without bundling the MDX bindings several testers were unable to play the game, and this has been working real well. However, the dilemma is that (AFAIK) I can't legally redistribute the bindings with my app, yet distributing the bindings with the app has been the problem-free solution so far. Before I bundled the bindings, testers would say things like "but I've already got dx9.0c" when the game didn't work for them - sending them a copy with the bindings in the app directory solved this problem. Other issues which came up was not having the exact version of D3DX which the app requires. -- Any ideas on how I should work around this? Bundling the managed bindings with the app is working nicely, but I'm not sure that's the ideal long term solution. Getting the users to run an installer which requires elevated privelages (to install the exact prerequisites) is not a path I want to go down. [Edited by - laucian on January 26, 2007 1:10:53 AM]

Share this post


Link to post
Share on other sites
Advertisement
As you say, distributing the runtime dll's outside of the installer violates the EULA so packaging the installers (or the web install for DirectX) is really the only option open even if it does require administrator rights to install.

From a network administrator's point of view, if somebody doesn't have admin rights to the machine they are on (ie. a work machine), should they really be installing games at all?

Sorry I can't be of more help and I know full well how hard it can be to get people to install the .NET framework and latest DirectX runtimes just to play stuff I make with Managed DirectX [headshake]

All the best,
ViLiO

Share this post


Link to post
Share on other sites
Thanks ViLiO,

It's mainly for people I don't know personally. I'm suprised nobody has any suggestions.

MS's says: install the runtimes invisibly without the user being prompted...

Here's the situation I really, really want to avoid.. a security minded user installs the game under his limited user account... a prompt comes up: "this program needs admin rights to install"... the user is thinking "ummm this is weird. I don't trust this" and closes the installer. From my perspective, it just doesn't make sense for a game to need admin rights to be installed, and from a casual user perspective, "what is 'DirectX' and '.NET' anyway"?

[Edited by - laucian on January 25, 2007 7:39:02 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by laucian
Thanks ViLiO,

It's mainly for people I don't know personally. I'm suprised nobody has any suggestions.

MS's says: install the runtimes invisibly without the user being prompted...

Here's the situation I really, really want to avoid.. a security minded user installs the game under his limited user account... a prompt comes up: "this program needs admin rights to install"... the user is thinking "ummm this is weird. I don't trust this" and closes the installer. From my perspective, it just doesn't make sense for a game to need admin rights to be installed, and from a casual user perspective, "what is 'DirectX' and '.NET' anyway"?
You're right. From a technical perspective, DirectX and .NET are system components and therefore it makes sense to require administrative privileges, but it's bad from a user perspective. As ViLiO pointed out, with the EULA as it is you don't really have an alternative.

I'm not sure your example with a security-minded user is compelling. If they're worried about malware, a non-admin program could wreak almost as much havoc as an admin-requiring program. They already have to trust you to some degree to install and run your game under a limited account.

Also, if your game comes with an installer, users will most likely be required to elevate anyway to install your game on Vista, since it comes with heuristics that require elevation for installation apps.

Personally I'd work out your MDX runtime issues and convince your testers to install the latest DX. What are their reasons for avoiding it?

Share this post


Link to post
Share on other sites
Hey, I should have probably made it clear that what I want to bundle is really just the managed bindings for DX9.0c - the real issue I had was where some testers would have a version of DX9.0c installed, but not the managed bindings (which were only installed by default in later version of DX9.0c)

Quote:
Original post by mutex
You're right. From a technical perspective, DirectX and .NET are system components and therefore it makes sense to require administrative privileges, but it's bad from a user perspective. As ViLiO pointed out, with the EULA as it is you don't really have an alternative.


Yep. But the managed directx bindings (which is the only thing I would like to be able to bundle in the same directory as the app - they all have DX9.0 (albeit the one before the managed bindings were installed by default + getting them to install .NET 2.0 is no worries) the bindings aren't system components - they're thin wrappers around native DX. For the testers, I've been including these wrappers, and all has been good.

Quote:

I'm not sure your example with a security-minded user is compelling.


I'm just thinking about what I'd do in that situation. There have been indie games in the past which I wanted to play, but when they needed an installer, as opposed to just unzipping and playing, I got worried about what files the installer would modify - would it bork my system by accident? (I'm not really referring to virus/intentional problems when I pointed out the security minded user.

---

After doing some more research, I think the solution may be to write my own renderer backend in C/C++, and embed mono into a startup executable, instead of MS's .NET.

Share this post


Link to post
Share on other sites
If users are that security-oriented, you might as well give them some responsibility of their own and ask that they install the latest DirectX runtimes themselves. The MDX libraries (all of them, including the D3DX ones on which they depend) should be installed by the normal DirectX runtime since December 2005 iirc. You could point them to the DirectX runtime web installer to make this installation very painless, the latest version is typically the top download on the DirectX MSDN homepage.

Here's an excellent code snippet (props to RipTorn) for detecting if the assembly is available and popping up the web installer if it isn't:

[source lang=C#]
// Somewhere in your Main() method, before the .dlls get loaded (that is, used)
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);


// Gets called when an assembly fails to load normally
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{
HandleAssemblyLoadFail(args.Name);
return null;
}


// Handles the missing MDX assemblies
static void HandleAssemblyLoadFail(string assembly)
{
//loading an assembly failed..
if (assembly.Contains("Microsoft.DirectX"))
{
if (System.Windows.Forms.MessageBox.Show(
"This application requires Microsoft DirectX 9.0c to be installed on your computer." +
Environment.NewLine +
"Do you want to download the directX web installer?",
"DirectX Error",
System.Windows.Forms.MessageBoxButtons.YesNo,
System.Windows.Forms.MessageBoxIcon.Exclamation) ==
System.Windows.Forms.DialogResult.Yes)
{
System.Diagnostics.Process.Start(
"http://www.microsoft.com/downloads/details.aspx?FamilyId=2DA43D38-DB71-4C1B-BC6A-9B6652CD92A3&displaylang=en"
).WaitForExit();
}
}

// You'll probably want to prompt the user to close/restart the
// app here whatever the outcome, to avoid further problems
}





As for the legalities, thin wrappers or not, the MDX libraries consitute DX runtime components and as such just may not be distributed by including the DLL's with your project. I know it stinks and it annoyed me too for a while, but using the DX (web) installer like this is quite elegant IMO. Better than commercial games which will just include the redistributable installer and run that, I think.

Share this post


Link to post
Share on other sites
Quote:
Original post by laucian
After doing some more research, I think the solution may be to write my own renderer backend in C/C++, and embed mono into a startup executable, instead of MS's .NET.
That sounds like an extreme solution to a component redistribution problem. Anyhow, some searching yielded Microsoft Component Installer for Windows which supports installing DX 9.0c, and DX 9.0c for Managed Code. Perhaps that'll help?

Share this post


Link to post
Share on other sites
thanks remigus, that's a real nice piece of code, and a nice way around my problem. I've never run the web installer, does it just update what needs to be updated, rather than downloading the full thing?

and thanks mutex, perhaps I could do a hybrid setup.

I read a few minutes ago on http://www.bunnz.com/wiki/index.php/Install_managed_DirectX that in the DX9 with redistribtable, there is a msi package with the redistributable managed bindings.

So, maybe if the user doesn't have the managed bindings, I'll use the code sample to run the web installer if they're online (this will also cover the case where they don't have DX9 at all), and give the option to just install the bundled msi redist via mutex's method if they're not online.

But for the users who already have the prerequsites, they can just unzip and play.

Thanks again. :)

Edit: It seems somebody has already done something similar to what I'm thinking of doing: http://www.gamedev.net/community/forums/topic.asp?topic_id=332308

[Edited by - laucian on January 26, 2007 3:05:06 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by laucian
But for the users who already have the prerequsites, they can just unzip and play.
Excellent :) I really like it when an app has both an installer and a plain .zip. My non-technical family can use the installer, while I can just unzip.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement