0

SCClient.exe can open to a specific Application model package (CCM_Application) through URLs formatted as softwarecenter:SoftwareID={insert CCM_Application Id property here}. I have a windows service in C# that is trying to evaluate if an app model package is available to a user by using the WMI class:

ROOT\CCM\CLIENTSDK\CCM_Application.

If the package is available, I want to launch the application's URL which would then open the scclient for the user with the scclient displaying the info of the app. Since I'm running as system the following doesn't work

Process.Start(softwarecenter:SoftwareID=someRandomAppId)

The process launches but there's no UI because the process is launched under the system context. So I'm in a situation where I have to launch this URL as the user, but simply using the win32Api.dll to impersonate the logged on user and launch the URL as the user won't work since for some reason the URL isn't recognized, even though the URL is recognized when I try using Process.Start(URL) in a console app.

yousseis
  • 31
  • 3
  • Usual way - have the second component of your service that run in interactive user's session to communicate to your core service running as system and launch whatever you want in the user's session... https://stackoverflow.com/questions/267838/how-can-a-windows-service-execute-a-gui-application (Adding the link for future users as you likely already found https://www.bing.com/search?q=c%23+service+interactive+account it in your prior research) – Alexei Levenkov Mar 12 '20 at 23:56
  • Right I was going to try using that method (advapi32.dll), however I notice that in a test console application when I do Process.Start(URL) it works fine, but in my windows service when I do [WindowsApi.CreateProcessAsUser](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessasusera) using the same URL Nothing launches because the URL isn't recognized for some reason. – yousseis Mar 13 '20 at 00:02

0 Answers0