-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathchoose.ps1
More file actions
executable file
·48 lines (43 loc) · 1.2 KB
/
choose.ps1
File metadata and controls
executable file
·48 lines (43 loc) · 1.2 KB
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
# set-executionpolicy remotesigned
param (
# [Parameter(Mandatory=$true)]
[string]$option
)
$libSymbols = "BOOST", "CEFDIR", "QTDIR", "OPENCV", "OPENSSL", "PTHD_LIB86", "JAVA_HOME", "ZLIB", "libPNG", " SDL2"
if ($option -eq "clean")
{
foreach ($lib in $libSymbols) {
[Environment]::SetEnvironmentVariable($lib, $null, "User")
Write-Output "$option '$lib' OK"
}
}
elseif ($option)
{
Write-Output "Not support '$option' option"
}
else
{
Add-Type -AssemblyName System.Windows.Forms
$browser = New-Object System.Windows.Forms.FolderBrowserDialog
$browser.Description = 'Select a folder to set Environment'
$browser.RootFolder = [Environment+SpecialFolder]::Desktop
$browser.ShowNewFolderButton = $false
$form = New-Object Windows.Forms.Form
$onFormClosingScript = {
# param($sender, $e)
Write-Output "closing window..."
}
$form.add_FormClosing($onFormClosingScript)
foreach ($lib in $libSymbols) {
echo "select '$lib' folder Path"
$result = $browser.ShowDialog()
if ($result -eq [Windows.Forms.DialogResult]::OK) {
$folderPath = $browser.SelectedPath
setx $lib $folderPath
echo "set '$lib = $folderPath' OK"
} else {
echo "NOT set '$lib' library Path"
break
}
}
}