forked from fsprojects/Paket
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
156 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,3 +179,4 @@ release.cmd | |
localpackages/ | ||
paket-files | ||
*.orig | ||
paket.exe |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{CE3F8B87-1ABD-462E-A35B-CDCEC695898B}</ProjectGuid> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Paket.Bootstrapper</RootNamespace> | ||
<AssemblyName>paket.bootstrapper</AssemblyName> | ||
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<PlatformTarget>AnyCPU</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Net; | ||
|
||
|
||
namespace Paket.Bootstrapper | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
try | ||
{ | ||
var folder = ""; | ||
if (args.Length > 1) | ||
folder = args[0]; | ||
|
||
var target = Path.Combine(folder, "paket.exe"); | ||
var localVersion = ""; | ||
if (File.Exists(target)) | ||
{ | ||
FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(target); | ||
localVersion = fvi.FileVersion; | ||
} | ||
|
||
using (WebClient client = new WebClient()) | ||
{ | ||
client.Headers.Add("user-agent", "Paket.Bootstrapper"); | ||
var releasesUrl = "https://api.github.com/repos/fsprojects/Paket/releases"; | ||
var data = client.DownloadString(releasesUrl); | ||
var start = data.IndexOf("tag_name") + 11; | ||
var end = data.IndexOf("\"", start); | ||
var latestVersion = data.Substring(start, end - start); | ||
|
||
if (!localVersion.StartsWith(latestVersion)) | ||
{ | ||
var url = String.Format("https://github.com/fsprojects/Paket/releases/download/{0}/paket.exe", latestVersion); | ||
|
||
Console.WriteLine("Starting download from {0}", url); | ||
|
||
var request = (HttpWebRequest)HttpWebRequest.Create(url); | ||
request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate; | ||
using (HttpWebResponse httpResponse = (HttpWebResponse)request.GetResponse()) | ||
{ | ||
using (Stream httpResponseStream = httpResponse.GetResponseStream()) | ||
{ | ||
const int bufferSize = 4096; | ||
byte[] buffer = new byte[bufferSize]; | ||
int bytesRead = 0; | ||
|
||
using (FileStream fileStream = File.Create(target)) | ||
{ | ||
while ((bytesRead = httpResponseStream.Read(buffer, 0, bufferSize)) != 0) | ||
{ | ||
fileStream.Write(buffer, 0, bytesRead); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
Console.WriteLine("Paket.exe {0} is up to date.", localVersion); | ||
} | ||
} | ||
} | ||
catch (Exception exn) | ||
{ | ||
Environment.ExitCode = 1; | ||
Console.ForegroundColor = ConsoleColor.Red; | ||
Console.WriteLine(exn.Message); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// <auto-generated/> | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")] | ||
[assembly: AssemblyProductAttribute("Paket")] | ||
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub files.")] | ||
[assembly: AssemblyVersionAttribute("0.2.5")] | ||
[assembly: AssemblyFileVersionAttribute("0.2.5")] | ||
namespace System { | ||
internal static class AssemblyVersionInformation { | ||
internal const string Version = "0.2.5"; | ||
} | ||
} |