Skip to content

Commit d16ed7a

Browse files
committed
adding chocolatey
1 parent 1a5fee1 commit d16ed7a

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

chocolatey/chocolatey.nuspec

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
3+
<metadata>
4+
<id>chocolatey</id>
5+
<title>Chocolatey</title>
6+
<version>0.5.0.0</version>
7+
<authors>Rob Reynolds</authors>
8+
<owners>Rob Reynolds</owners>
9+
<summary>Chocolatey is for machine level packages, like application nuggets.</summary>
10+
<description>Chocolatey is for machine level packages, like application nuggets.
11+
You would create a package and install it to C:\NuGet\lib\yourpackagename and also a bat file in
12+
C:\NuGet\bin to point to your executable. Once the batch file is there, your executable will run from the command line.</description>
13+
<projectUrl>https://github.com/ferventcoder/nugetpackages</projectUrl>
14+
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
15+
<requireLicenseAcceptance>false</requireLicenseAcceptance>
16+
<tags>maven machine repository nuget</tags>
17+
</metadata>
18+
</package>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
WarmuP
2+
==========
3+
WarmuP has been installed to C:\NuGet\lib\warmup. The path to C:\Nuget\bin has been added to your PATH environment variable.
4+
Uninstalling will only remove the local reference to this repository.
5+
6+
Next Steps
7+
==========
8+
Please edit the configuration located at C:\NuGet\lib\warmup.
9+
10+
Usage
11+
==========
12+
You should now be able to execute warmup nameOfSubDirectory replacementName.
13+
14+
Please see http://devlicious.com/blogs/rob_reynolds/archive/2010/02/01/warmup-getting-started.aspx & http://codebetter.com/drusellers/2009/09/26/warmup for more information.

chocolatey/tools/install.ps1

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
param($installPath, $toolsPath, $package, $project)
2+
3+
#========================
4+
#Chocolatey - NuGet local machine repo
5+
#========================
6+
#chocolatey
7+
8+
#set up variables to add
9+
$statementTerminator = ";"
10+
$nugetPath = "C:\NuGet"
11+
$nugetExePath = [System.IO.Path]::Combine($nuGetPath, "bin")
12+
$nugetLibPath = [System.IO.Path]::Combine($nuGetPath, "lib")
13+
14+
$nugetYourPkgPath = [System.IO.Path]::Combine($nugetLibPath,"yourPackageName")
15+
Write-Host We are setting up the Chocolatey repository for NuGet packages that should be at the machine level
16+
Write-Host The repository is set up at $nugetPath.
17+
Write-Host The packages themselves go to $nugetLibPath '(i.e.' $nugetYourPkgPath ').'
18+
Write-Host A batch file for the command line goes to $nugetExePath and points to an executable in $nugetYourPkgPath.
19+
20+
#create the base structure if it doesn't exist
21+
if (![System.IO.Directory]::Exists($nugetExePath)) {[System.IO.Directory]::CreateDirectory($nugetExePath)}
22+
if (![System.IO.Directory]::Exists($nugetLibPath)) {[System.IO.Directory]::CreateDirectory($nugetLibPath)}
23+
24+
#get the PATH variable
25+
$envPath = $env:PATH
26+
27+
#if you do not find C:\NuGet\bin, add it
28+
if ($envPath.ToLower().Contains($nugetExePath.ToLower()))
29+
{
30+
#does the path end in ';'?
31+
$hasStatementTerminator= $envPath.EndsWith($statementTerminator)
32+
# if the last digit is not ;, then we are adding it
33+
If (!$hasStatementTerminator) {$nugetExePath = $statementTerminator + $nugetExePath}
34+
#now we update the path
35+
$envPath = $envPath + $nugetExePath + $statementTerminator
36+
[Environment]::SetEnvironmentVariable( "Path", $envPath, [System.EnvironmentVariableTarget]::Machine )
37+
}
38+
#========================
39+
40+
write-host Removing this package...
41+
#uninstall-package $package.Name -ProjectName $project.Name
42+
uninstall-package chocolatey -ProjectName $project.Name

0 commit comments

Comments
 (0)