Skip to content

Commit 263cdd1

Browse files
committed
Added Install.ps1 to auto-install Visual Studio Item Templates when [T4SQL.Base] NuGet package is installed in a project.
1 parent 95969fb commit 263cdd1

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
param($installPath, $toolsPath, $package, $project)
2+
3+
Get-ChildItem Registry::HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\ |
4+
Where-Object {$_.PSChildName -match "^\d{2,}\.\d+$"} |
5+
Get-ItemProperty -Name "UserItemTemplatesLocation" |
6+
ForEach-Object {
7+
Copy-Item ([System.IO.Path]::Combine($installPath, "Visual Studio\Templates\ItemTemplates\*")) $_.UserItemTemplatesLocation -Recurse
8+
}
9+
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
http://t4sql.codeplex.com/
1+
Installation Notes:
22

3-
To install the Template of Templates:
4-
Visual Studio Item Templates of T4SQL Templates - for SQL Server and Oracle:
3+
[T4SQL Template] - Template of Templates (for SQL Server and Oracle)
4+
should have been installed in your Visual Studio Custom Item Templates.
5+
Please make sure the [T4SQL Template] is in the Add New Item dialog box, Installed Templates, under Visual C# Items.
56

6-
Please,
7+
In case the automatic installation fail due to insufficient permissions or other issue,
8+
you may need to manually install it by following instructions:
79

810
Copy the file T4SQLTemplate.CSharp.zip
9-
from the project directory Package\T4SQL.Base.x.x.x.x\Visual Studio\Templates\ItemTemplates\
11+
from the project NuGet package directory (packages\T4SQL.Base.x.x.x.x\Visual Studio\Templates\ItemTemplates\)
1012
to your Visual Studio Item Templates Directory
1113
(Find Visual Studio [Tools] menu, [Options] dialog box, under [Projects and Solutions]\[General], in [user item templates location])
1214

1315

1416
See Also:
1517
http://msdn.microsoft.com/en-us/library/y3kkate1.aspx (How to: Locate and Organize Project and Item Templates)
1618
http://msdn.microsoft.com/en-us/library/e1x5ayd4.aspx (How to: Share Templates Across a Development Team)
19+
http://t4sql.codeplex.com/ (T4SQL Template Library)

T4SQLTemplateLibrary/T4SQL.Base/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.0.1")]
36+
[assembly: AssemblyFileVersion("1.0.0.1")]

T4SQLTemplateLibrary/T4SQL.Base/T4SQL.Base.nuspec

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
<tags>T4SQL Template Base Interface</tags>
1616
</metadata>
1717
<files>
18-
<file src="..\VSTemplates\T4SQLTemplate.CSharp.zip" target="Visual Studio\Templates\ItemTemplates\T4SQLTemplate.CSharp.zip" />
19-
<file src="NuGet\Readme.txt" target="Readme.txt" />
18+
<file src="..\VSTemplates\*.CSharp.zip" target="Visual Studio\Templates\ItemTemplates\Visual C#" />
19+
<file src="NuGet\Install.ps1" target="tools" />
20+
<file src="NuGet\Readme.txt" target="" />
2021
</files>
2122
</package>

T4SQLTemplateLibrary/T4SQLTemplateLibrary.sln

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ EndProject
5454
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{304335BC-9CD9-4D9C-B87B-CE9FBBACAFFA}"
5555
ProjectSection(SolutionItems) = preProject
5656
T4SQL.Base\NuGet\Download NuGet Command-Line.htm = T4SQL.Base\NuGet\Download NuGet Command-Line.htm
57+
T4SQL.Base\NuGet\Install.ps1 = T4SQL.Base\NuGet\Install.ps1
5758
T4SQL.Base\NuGet\pack.bat = T4SQL.Base\NuGet\pack.bat
5859
T4SQL.Base\NuGet\Readme.txt = T4SQL.Base\NuGet\Readme.txt
5960
EndProjectSection

0 commit comments

Comments
 (0)