Promit's Ventspace

February 19, 2010

ClickOnce Support in SlimDX

Filed under: SlimDX — Promit @ 7:29 pm

Man, it’s been a long time since I wrote about SlimDX. We’ve released the February 2010 version today, so go ahead and grab that if you’re so inclined. This version is mostly bug fixes, for both us and Microsoft. DirectX 11 should be much more usable, although we’re still working towards stronger D2D and DWrite implementations. In the meantime, I wanted to discuss a feature that was included too late for documentation to catch up: ClickOnce support.

ClickOnce has actually been on the to-do list for a very long time, but it ended up quite far down the priority list thanks to a lack of user demand. For the February 2010 release we’ve gone ahead and included it. The installer will set it up for VS 2008 and VS 2010; we’ve dropped 2005 support across the board so no ClickOnce there. There are a few quirks to setting it up properly though, so I just want to explain what you need to do in order to make sure it works properly.

First of all, make sure you’ve got a reference to the GAC version of SlimDX in your project (via the .NET tab in Add References). Also check the properties of the SlimDX reference; the default is Copy Local = True and that should be set to False.

Once you’ve done that, go into your project’s properties and select the Publish tab. This is where you set up all of the ClickOnce options and actually produce a distribution. If you press Application Files, you should see SlimDX.dll listed as Prerequisite (Auto). If it’s something else, you’ve got the previous step wrong.

Next, hit the Prerequisites… button. Somewhere in the listbox, you’ll see “SlimDX Runtime (February 2010)”. Check the box and press OK.

That’s it. Pretty easy, huh? Now when you publish, the SlimDX runtime will be included with your application and run automatically as part of the ClickOnce installation.

1 Comment »

  1. Don’t known if it’s the good place to ask question. I’m using the SlimDX Runtime Prerequisites in my deploiement project and the package always run even if it is already installed.
    In MSI install log, I’ve found this :

    Running checks for package ‘SlimDX Runtime (June 2010)’, phase BuildList
    Running MsiProductCheck with ProductCode ‘354D00E0-C7C9-4bc1-BC12-08C4977AA827’
    MsiQueryProductState returned ‘-2’
    Setting value ‘-2 {int}’ for property ‘IsInstalled’
    The following properties have been set for package ‘SlimDX Runtime (June 2010)’:
    Property: [IsInstalled] = -2 {int}
    Running checks for command ‘SlimDXJun2010_VS10\SlimDX Runtime Net20 (June 2010).msi’
    Result of running operator ‘ValueGreaterThan’ on property ‘IsInstalled’ and value ‘0’: false
    Result of running operator ‘ValueNotEqualTo’ on property ‘AdminUser’ and value ‘True’: false
    Result of running operator ‘ValueExists’ on property ‘Version9x’: false
    Result of running operator ‘VersionLessThan’ on property ‘VersionNT’ and value ‘5.1.2’: false
    Result of checks for command ‘SlimDXJun2010_VS10\SlimDX Runtime Net20 (June 2010).msi’ is ‘Install’
    ‘SlimDX Runtime (June 2010)’ RunCheck result: Install Needed

    The return state of MsiQueryProductState (-2) must match INSTALLSTATE_INVALIDARG. So I think there is a problem here.

    I’ve tried to call MsiQueryProductState(“{354D00E0-C7C9-4bc1-BC12-08C4977AA827}”) from a console application and It returns INSTALLSTATE_DEFAULT.

    It must be a problem with Windows Intaller, not a SlimDX one, but have you encountered this problem ?

    Thanks.

    Comment by Maxence DELANNOY — February 14, 2011 @ 10:03 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: