Skip to content

Commit 66d0778

Browse files
committed
Load help page on installation
1 parent a2bbad1 commit 66d0778

File tree

3 files changed

+54
-3
lines changed

3 files changed

+54
-3
lines changed

Mvc.JQuery.Datatables.Core/Core.JQuery.Datatables.nuspec

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<copyright>Copyright 2011</copyright>
1313
<tags>jquery datatables iqueryable razor</tags>
1414
</metadata>
15-
<!--files>
16-
<file src="RegisterDataTablesModelBinder.cs.pp" target="Content" />
17-
</files-->
15+
<files>
16+
<file src="tools\install.ps1" target="Tools" />
17+
<file src="tools\uninstall.ps1" target="Tools" />
18+
</files>
1819
</package>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#This file is based on file from Glimpse project, under Apache licence (https://github.com/Glimpse/Glimpse/blob/efa39506576048084250622a2fc2150f8880cbe2/license.txt)
2+
param($installPath, $toolsPath, $package, $project)
3+
4+
$from = $null
5+
6+
$tempDir = $env:TEMP
7+
$log = [System.IO.Path]::Combine($tempDir,"Mvc.JQuery.DataTables\install.log")
8+
9+
if ([System.IO.File]::Exists($log))
10+
{
11+
$lines = Get-Content $log | where {$_.Contains($project.FileName)} | where {$_.Contains($package.Id)}
12+
13+
if ($lines -ne $null){
14+
15+
if ($lines.GetType().Name -eq 'String'){
16+
$lastline = $lines
17+
} else {
18+
$lastLine = $lines[$lines.Length-1]
19+
}
20+
21+
$props = $lastLine.Split(',')
22+
23+
$versionRemoved = $props[1]
24+
$timeRemoved = $props[2]
25+
$timeRemoved = Get-Date -Date $timeRemoved
26+
$now = Get-Date
27+
28+
$delta = New-TimeSpan $timeRemoved $now
29+
30+
if ($delta.Minutes -lt 5){
31+
$from = $versionRemoved
32+
}
33+
}
34+
}
35+
36+
if ($from -ne $null -and $from -ne $package.Version){
37+
$DTE.ItemOperations.Navigate("http://aspdatatables.azurewebsites.net/?" + $package.Id + "=" + $from + ".." + $package.Version)
38+
}
39+
else{
40+
$DTE.ItemOperations.Navigate("http://aspdatatables.azurewebsites.net/?" + $package.Id + "=" + $package.Version)
41+
}
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+
$tempDir = $env:TEMP
4+
$tempDir = [System.IO.Path]::Combine($tempDir,"Mvc.JQuery.DataTables")
5+
if (![System.IO.Directory]::Exists($tempDir)) {[System.IO.Directory]::CreateDirectory($tempDir)}
6+
$file = [System.IO.Path]::Combine($tempDir, "install.log")
7+
$datetime = Get-Date
8+
9+
$package.Id + "," + $package.Version + "," + $datetime.ToString() + "," + $project.FileName | out-file $file -append

0 commit comments

Comments
 (0)