locked
Failure running VSIXInstaller in a LocalSystem service RRS feed

  • Question

  • I've written a windows service that we're going to use for installing updates to various tools we need for our development environment (SCCM doesn't quite suit our purpose).

    One of the tools the service needs to install is a VS 2010 extension. So to install the extension, the service is running VSIXInstaller in quiet mode (ie "VSIXInstaller /q OurPackage.vsix"). The VSIX, as suggested by Aaron Marten here , has AllUsers set to true.

    Given that the Windows Service will be installing various things, and I want it to install initially without user involvement, I want it to run as LocalSystem. The problem is that VSIXInstaller doesn't seem to cope with this. It fails with an 3001 error code.

    I've tried VSIXInstaller with and without the /admin option, and it doesn't seem to make any difference.

    However if I change the service manually to run as me (admittedly an admin on my PC), VSIXInstaller is happy and installs the extension fine.

    I managed to find the VSIXInstaller log in C:\Windows\Temp and it finishes thus:

     System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
       at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
       at Microsoft.VisualStudio.Settings.ExternalSettingsManager.GetScopePaths(String applicationPath, String suffixOrName, Boolean isLogged, Boolean isForIsolatedApplication)
       at Microsoft.VisualStudio.Settings.ExternalSettingsManager.CreateForApplication(String applicationPath)
       at VSIXInstaller.App.GetExtensionManager(SupportedVSSKU sku)
       at VSIXInstaller.App.GetExtensionManagerForApplicableSKU(SupportedVSSKU supportedSKU, IInstallableExtension installableExtension, List`1 applicableSKUs)
       at VSIXInstaller.App.InitializeInstall()
       at VSIXInstaller.App.OnStartup(StartupEventArgs e)

    Any ideas? Just a thought, is it possibly having trouble finding VS 2010 related registry entries for LocalSystem?

    Thanks


    Ian
    Ian
    Wednesday, May 18, 2011 11:52 AM

Answers

  • It looks like this was just an untested scenario.  We have opened a bug on it internally but I doubt there would be any work around short of 'don't run it in the context of LocalSystem'.

    Ryan

    • Marked as answer by Ian of Oz Thursday, May 19, 2011 10:42 AM
    Wednesday, May 18, 2011 11:14 PM

All replies

  • It looks like this was just an untested scenario.  We have opened a bug on it internally but I doubt there would be any work around short of 'don't run it in the context of LocalSystem'.

    Ryan

    • Marked as answer by Ian of Oz Thursday, May 19, 2011 10:42 AM
    Wednesday, May 18, 2011 11:14 PM
  • Well I can't really argue with that. I guess I'll have to go back to packaging my extension in an MSI.

    Not the answer I was hoping for, but an answer all the same, so I'll mark it as such...

    Ian


    Ian
    Thursday, May 19, 2011 10:42 AM
  • In case anyone else runs into the same issue...

    I got around this by packinging my extension in an MSI, then installing it using MSIExec.

    The process of packing the contents of A VSIX into an MSI is pretty ugly, but it seems to work.

    Check out the following two for more info:

    http://blogs.msdn.com/b/visualstudio/archive/2010/06/09/vsix-best-practices.aspx

    http://msdn.microsoft.com/en-us/library/ee332502.aspx


    Ian
    Saturday, May 21, 2011 11:20 AM