Search Unity

Proper way to deploy a Windows Standalone build which requires a command line switch?

Discussion in 'Windows' started by PixelRouterVR, Jul 29, 2016.

  1. PixelRouterVR

    PixelRouterVR

    Joined:
    Jan 6, 2014
    Posts:
    20
    I'm working on a Unity experience which involves a custom C++, DX11 plugin. This plugin requires that the Direct3D device is created to support multi-threaded mode.

    By default Unity creates the D3D device in single threaded mode, for the editor and also in standalone player builds. Thankfully, there is a command line switch "-force-d3d11-no-singlethreaded" which creates the device in multithreaded mode. See https://docs.unity3d.com/Manual/CommandLineArguments.html

    As long as I run the Unity Editor, or a standalone build, with this switch passed in, all is well, but how am I supposed to ship this in a way that will ensure that the experience will be run properly by the end user?

    The idea of requiring the user to launch via a special "shortcut" that has the switch, seems messy. Do I really need to tell my users, "Don't click the main .exe or it will crash right away, you have to click StartMe.cmd, or whatever.

    For Windows Store builds, we are able to add a line to App.xaml.cs :

    appCallbacks.AddCommandLineArg("-force-d3d11-no-singlethreaded")

    However, I can't find anything in the docs about how we might achieve the same thing in a regular Windows build.

    Is there any way to build this switch in to a standalone player?
     
    Last edited: Jul 29, 2016
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,919
    No, sadly there's no way for that switch to be builtin, you can always have a launcher.exe which executes Unity standalone with arguments.