1

There's a registry setting we need to make during installation if (and only if) the user has multiple GPUs. I'm not 100% sure that this setting will take effect (for all users) without a restart, so doing it as part of install (vs. in the app startup) seems ideal.

Setting a registry key in Wix is straightforward, but I was expecting to have to write C++ code to detect the number of GPUs. My original thought was to create a Custom Action DLL for Wix, but further reading suggests that's hard to get right, and something to be avoided if possible.

So, I'm back to looking for some means to determine whether the user has more than one GPU using what's available in a wxs file. Does anyone know how this might be possible without writing a custom action?

Scott Smith
  • 3,900
  • 2
  • 31
  • 63
  • 1
    Can you not do this detection in the application itself? Auto-detect on launch how many GPUs there are? This number could even change over time? – Stein Åsmul Sep 17 '20 at 16:30
  • Yes indeed. However, it may require a restart of Windows to take effect. The initial user experience would be: (1) install, (2) restart, (3) launch app, (4) change setting and restart again, (5) launch app again, ... I was hoping to avoid that. – Scott Smith Sep 18 '20 at 13:30
  • I was once thinking to call an EXE at the end of an installation with a switch to initialize its settings in HKCU and in the user profile. Something like `MyApp.exe -initialize`. I gave it up due to impersonation issues when running silently. The main rationale was to avoid separate source for custom actions - so I could debug its operation with normal procedures and [avoid custom action code](https://stackoverflow.com/a/46179779/129130). Remember that if you run elevated, the application might not find user profiles but system profiles. Here be some dragons. – Stein Åsmul Sep 18 '20 at 15:09
  • How likely is it and how impactful would it be if the number of GPUs changed after installation? – Christopher Painter Sep 21 '20 at 21:17
  • @ChristopherPainter - yeah, that's a possibility, I suppose. I was thinking it was a very unlikely scenario, but with all of the AI stuff going on, maybe it's not that unlikely... – Scott Smith Sep 23 '20 at 02:13
  • @ScottSmith that's something to consider when designing the solution. Maybe it's something that belongs in the installer and/or the application. – Christopher Painter Sep 23 '20 at 17:15

0 Answers0