.NET equivalent of install.ps1, uninstall.ps1 and init.ps1

Feb 18, 2011 at 4:40 PM

I think we should consider adding support for a .NET equivalent of the above PowerShells scripts. Although PowerShell is great and Oisin's upcoming PS helper library will help a lot, the truth is not all developers are comfortable writing PS scripts (or at least they don't want to learn it to create a package.) So to reduce the "barrier to entry" for package authors, it'd be great to allow them to write .NET code for post-installation actions.

It could be as simple as a class in a specially-named assembly within the package, and the methods in it are decorated with [InstallAction], [UninstallAction], [InitAction] attributes respectively.

Thoughts?

Feb 18, 2011 at 4:51 PM
with DI provided by the VSMEF container! :)

way to go

/kzu

--
Daniel Cazzulino | Developer Lead | MS MVP | Clarius Consulting | +1 425.329.3471


On Fri, Feb 18, 2011 at 14:40, dotnetjunky <notifications@codeplex.com> wrote:

From: dotnetjunky

I think we should consider adding support for a .NET equivalent of the above PowerShells scripts. Although PowerShell is great and Oisin's upcoming PS helper library will help a lot, the truth is not all developers are comfortable writing PS scripts (or at least they don't want to learn it to create a package.) So to reduce the "barrier to entry" for package authors, it'd be great to allow them to write .NET code for post-installation actions.

It could be as simple as a class in a specially-named assembly within the package, and the methods in it are decorated with [InstallAction], [UninstallAction], [InitAction] attributes respectively.

Thoughts?

Read the full discussion online.

To add a post to this discussion, reply to this email (nuget@discussions.codeplex.com)

To start a new discussion for this project, email nuget@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com


Developer
Feb 18, 2011 at 4:54 PM

We started out that way (longgg time ago), but never ended up doing it. It's a good idea though.

Feb 18, 2011 at 6:35 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Feb 21, 2011 at 6:13 PM

Interesting. I guess if you went that way, the current powershell scripts would supported by some kind of C# proxy hosting a Runspace on top of this abstraction.

Feb 21, 2011 at 7:59 PM

I think we're going to keep it simple. The powershell scripts will continue to work as is. We'll just add a managed code layer to execute some assembly equivalent to the scripts.