-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathInstall.ps1
More file actions
22 lines (20 loc) · 988 Bytes
/
Install.ps1
File metadata and controls
22 lines (20 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
echo "first we need the java directory"
Add-Type -AssemblyName System.Windows.Forms
$JavaJdk = New-Object System.Windows.Forms.FolderBrowserDialog -Property @{
SelectedPath = '\Program Files (x86)'
ShowNewFolderButton = $false
Description = "Please locate the '\java\jdk8_*' Directory "
}
[void]$JavaJdk.ShowDialog()
$mingW = New-Object System.Windows.Forms.FolderBrowserDialog -Property @{
SelectedPath = '\Program Files (x86)'
ShowNewFolderButton =$false
Description = "Please Select the '\mingw' Directory"
}
[void]$mingW.ShowDialog()
$jdkbin = ";"+$JavaJdk.SelectedPath+"\bin"
$jreBinS = ";"+$JavaJdk.SelectedPath+"\jre\bin\server"
$jreBinP = ";"+$JavaJdk.SelectedPath+"\jre\bin\plugin2"
$mingwBin = ";"+$mingW.SelectedPath+"\bin"
$addedPaths = $jdkbin+$jreBinS+$jreBinP+$mingwBin
[Environment]::SetEnvironmentVariable("Path",$env.Path+$addedPaths,[System.EnvironmentVariableTarget]::Machine)