-
Notifications
You must be signed in to change notification settings - Fork 21
/
builddokan.ps1
61 lines (53 loc) · 1.16 KB
/
builddokan.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Script that builds dokan
#
# Version: 20180322
Param (
[string]$Configuration = ${Env:Configuration},
[string]$Platform = ${Env:Platform},
[switch]$UseLegacyVersion = $false
)
If (-not ${Configuration})
{
$Configuration = "Release"
}
If (-not ${Platform})
{
$Platform = "Win32"
}
If (${Env:AppVeyor} -eq "True")
{
$MSBuild = "MSBuild.exe"
}
ElseIf (${Env:VisualStudioVersion} -eq "15.0")
{
$MSBuild = "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MSBuild.exe"
}
ElseIf (${Env:VisualStudioVersion} -eq "9.0")
{
$MSBuild = "C:\\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe"
}
Else
{
$MSBuild = "C:\\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
}
$MSBuildOptions = "/verbosity:quiet /target:Build /property:Configuration=${Configuration},Platform=${Platform}"
If ($UseLegacyVersion)
{
$DokanPath = "../dokan"
$ProjectFile = "msvscpp\dokan.sln"
}
Else
{
$DokanPath = "../dokany"
$ProjectFile = "dokan\dokan.vcxproj"
}
Push-Location ${DokanPath}
Try
{
Write-Host "${MSBuild} ${MSBuildOptions} ${ProjectFile}"
Invoke-Expression -Command "& '${MSBuild}' ${MSBuildOptions} ${ProjectFile}"
}
Finally
{
Pop-Location
}