PowerShell Installer for DSL Tools
This sample shows how to generate a PowerShell script for installing a domain specific language created with DSL Tools. It consists of a T4 text template that will generate a PowerShell installer script.
MSI installers for DSL Tools have lengthy execution times. As an alternative to the MSIs, the PowerShell scripts can be linked together into a larger script that can be run on a more frequent basis because the execution time is much faster. The installer script is useful for enterprise teams that have several DSLs which are frequently updated.
Usage:
The text template download consists of a T4 text template named PowerShellDeployer.tt. Add the template to a DSL Tools setup project and make sure that the Custom Tool property of the file in Visual Studio is set to "TextTemplatingFileGenerator". Update the environment-specific settings at the top of the template file and save the file, which will cause the custom tool to run and generate the PowerShell installer script.
A sample DSL is included as a separate download.
Detailed Steps:1. Create a new DSL Tools project (or open an existing project.)
2. Add a Domain-Specific Language Setup project to the solution.
Your solution should look like this:
3. Add the PowerShellDeployer.tt file to the setup project. Make sure the Custom Tool property of the file is set to "TextTemplatingFileGenerator". Your solution will look like this (the file is highlighted):
4. Four environment-specific settings are required to run the template. You will find them at the top of the PowerShellDeployer.tt file. You must set them before the text template will run without errors. They are:
- Debug setting
- DSL Location
- Visual Studio Templates Location
- Resource Merge Setting
See the comments in the template for a detailed explanation of each setting.
5. Run the text template by saving the file or right clicking on the file in Solution Explorer and selecting "Run Custom Tool". The output of the template will be a file named "PowerShellDeployer.ps1". You can now execute that script in PowerShell to install your DSL.
DisclaimerThe PowerShellDeployer.tt text template is intended as an example. It has been only been tested with the sample project. If you have any problems with the script please create a thread on the Discussions List or submit an issue on the Issue Tracker.