metasploitable3/scripts/installs/setup_glassfish.bat
Adric Net 5130f491d1 glassfish install: Enable overwriting in 7Zip
This has proved very helpful when troubleshooting builds. Without it the second time this script runs it hangs waiting for input to 7zip like this:
```
   default: Running: scripts/installs/install_boxstarter.bat as c:\tmp\vagrant-shell.bat
==> default: C:\Windows\system32>mkdir C:\glassfish 
==> default: 
==> default: A subdirectory or file C:\glassfish already exists.
==> default: 
==> default: C:\Windows\system32>powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip', 'C:\Windows\Temp\glassfish4.zip')"  0<NUL 
==> default: C:\Windows\system32>cmd /c ""C:\Program Files\7-Zip\7z.exe" x "C:\Windows\Temp\glassfish4.zip" -oC:\glassfish" 
==> default: 
==> default: 7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
==> default: 
==> default: Scanning the drive for archives:
==> default: 1 file, 102178360 bytes (98 MiB)
==> default: 
==> default: Extracting archive: C:\Windows\Temp\glassfish4.zip
==> default: --
==> default: Path = C:\Windows\Temp\glassfish4.zip
==> default: Type = zip
==> default: Physical Size = 102178360
==> default: 
==> default: 
==> default: Would you like to replace the existing file:
==> default:   Path:     C:\glassfish\glassfish4\bin\asadmin
==> default:   Size:     2274 bytes (3 KiB)
==> default:   Modified: 2013-05-14 22:08:54
==> default: with the file from archive:
==> default:   Path:     glassfish4\bin\asadmin
==> default:   Size:     2274 bytes (3 KiB)
==> default:   Modified: 2013-05-14 22:08:54
==> default: ? (Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit? 
```
2016-12-30 09:57:58 -05:00

12 lines
812 B
Batchfile

mkdir C:\glassfish
powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.java.net/glassfish/4.0/release/glassfish-4.0.zip', 'C:\Windows\Temp\glassfish4.zip')" <NUL
cmd /c ""C:\Program Files\7-Zip\7z.exe" -y x "C:\Windows\Temp\glassfish4.zip" -oC:\glassfish"
copy /Y "C:\vagrant\resources\glassfish\admin-keyfile" "C:\glassfish\glassfish4\glassfish\domains\domain1\config\admin-keyfile"
copy /Y "C:\vagrant\resources\glassfish\domain.xml" "C:\glassfish\glassfish4\glassfish\domains\domain1\config\domain.xml"
cmd.exe /c "C:\glassfish\glassfish4\bin\asadmin.bat create-service domain1"
net start domain1
powershell -Command "Start-Sleep -s 5"
net stop domain1
icacls "C:\glassfish" /grant "NT Authority\LOCAL SERVICE:(OI)(CI)F" /T
sc config domain1 obj= "NT Authority\LOCAL SERVICE"