locked
Restart console after add-in installation complete RRS feed

  • Question

  • Hi, is it possible to safely restart\shutdown the console\rdp session via an add-in command?
    (similar to the last stage of removing\installing an add-in)


    Thanks.
    Saturday, March 13, 2010 12:14 PM

Answers

  • If you use a service installer then you can build that into your MSI and have it run as part of the installation.  Also you can use servicecontroller to start/stop processes.  I don't see why you have to hook into when the console starts or stops, but I guess you could use reflection to hook into the show message.

    Copied from MSDN (http://msdn.microsoft.com/en-us/library/sd8zc8ha(VS.80).aspx)
    You need to add a custom action to your setup project. Right click on setup project, select View Custom Actions. Right click on the Custom Actions node and select Add Custom Action. In the Select Item in Project dialog double click on Application Folder then select 'Primary Output from...' and select OK. The Install, Commit, Rollback and Uninstall nodes should contain 'Primary Output from...'



    --
    • Marked as answer by madlan Sunday, March 14, 2010 11:41 AM
    Sunday, March 14, 2010 2:09 AM

All replies

  • The console itself should take care of this for you. When a user installs or uninstalls an add-in the console will shut down after the installation/uninstallation.
    I'm not on the WHS team, I just post a lot. :)
    Saturday, March 13, 2010 1:21 PM
    Moderator
  • Hi Ken,
    Is it possible to execute code when when console stops\starts? Say for starting a service etc?
    Saturday, March 13, 2010 2:15 PM
  • If you use a service installer then you can build that into your MSI and have it run as part of the installation.  Also you can use servicecontroller to start/stop processes.  I don't see why you have to hook into when the console starts or stops, but I guess you could use reflection to hook into the show message.

    Copied from MSDN (http://msdn.microsoft.com/en-us/library/sd8zc8ha(VS.80).aspx)
    You need to add a custom action to your setup project. Right click on setup project, select View Custom Actions. Right click on the Custom Actions node and select Add Custom Action. In the Select Item in Project dialog double click on Application Folder then select 'Primary Output from...' and select OK. The Install, Commit, Rollback and Uninstall nodes should contain 'Primary Output from...'



    --
    • Marked as answer by madlan Sunday, March 14, 2010 11:41 AM
    Sunday, March 14, 2010 2:09 AM
  • Your add-in is initialized when the console starts, and terminated when it stops, so yes. But I wouldn't think you would want to; part of the point of moving code to a service is to let it run whether the console is running or not.
    I'm not on the WHS team, I just post a lot. :)
    Sunday, March 14, 2010 3:56 AM
    Moderator