Open dogi opened 8 years ago
Maybe first we have to brainstorm, which software each os needs ...
Can we do something like this?
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew cask install vagrant
brew cask install virtualbox
Just put all the install commands into one script.
yes ;)
I kinda would also check if user is "root" and if not switch to "root"
Why do we need to switch to "root"? If there is permission issue can't we just run the script with sudo?
Here is the script I came up with:
#!/bin/bash
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew tap caskroom/cask
brew cask install vagrant
brew cask install virtualbox
As for Windows, I think we need: 1- git 2- Virtual box 3- Vagrant
@mhalqurashi
+ssh +bonjour
@dogi Why do we need these? I ran my BeLL app without them.
@dogi Also, if we are using Powershell as a scripting language for Windows, we need to install it. This link could help.
4- Powershell
@dogi I have created a PowerShell script which downloads and installs Git for Windows 10 x64. It has not been tested on x86 architecture yet. It will most likely work on Windows 7, 8, and 8.1 since they all have PowerShell pre-installed. Here is the file.
Also, I think I can create a script for Vagrant and Virtual Box.
@mhalqurashi please copy paste the code into this ;)
$LocalTempDir = $env:TEMP; $GitInstaller = "GitInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('https://github.com/git-for-windows/git/releases/download/v2.9.0.windows.1/Git-2.9.0-64-bit.exe', "$LocalTempDir\$GitInstaller"); & "$LocalTempDir\$GitInstaller" /silent /install; $Process2Monitor = "GitInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$GitInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)
@dogi I wrote a batch script for windows to download git, virtualbox, and vagrant.
@echo off
MKDIR Installation
CD Installation
set powershellDir=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe
IF EXIST "%PROGRAMFILES(X86)%" GOTO 64BIT
ELSE GOTO 32BIT
:64BIT
%powershellDir% -Command "Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-64-bit.exe -OutFile Git-2.9.2-32-bit.exe"
goto track
GOTO END
:32BIT
%powershellDir% -Command "Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-32-bit.exe -OutFile Git-2.9.2-32-bit.exe"
goto track
GOTO END
:track
%powershellDir% -Command "Invoke-WebRequest https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5.msi -OutFile vagrant_1.8.5.msi"
%powershellDir% -Command "Invoke-WebRequest http://download.virtualbox.org/virtualbox/5.0.10/VirtualBox-5.0.10-104061-Win.exe -OutFile VirtualBox-5.0.10-104061-Win.exe"
END
It works for my computer but it would be helpful if anyone can test this script. Do you want me add installation into this script? It seems like that belongs to issue #9
@cw-lin Both @dogi and I ran your script it worked! And yes, if you can add installation to this script, that would be great so that I can test it with my uninstall script.
@cw-lin Also, @dogi mentioned that it would be preferable (if possible) to have installation as a one liner as the website brew.sh does so.
@dogi @sthak004 Thanks for testing the script Here's the installation script
start \wait %cd%\vagrant_1.8.5.msi
start \wait %cd%\VirtualBox-5.0.10-104061-Win.exe
start \wait %cd%\Git-2.9.2-64-bit.exe
@cw-lin I ran into a problem when attempting to run your script.
I went and combined your installation script to your download script as such:
and it successfully downloaded the correct installers into a Installation folder however, when it came time to installation component of your script (outlined above), windows gave me this error regarding the wait\ command:
Did it work on your machine? I can try and troubleshoot but I'd rather just ask first in case I'm doing something wrong. Thanks.
@sthak004 Sorry about the typo, \wait should be /wait
start /wait %cd%\vagrant_1.8.5.msi
start /wait %cd%\VirtualBox-5.0.10-104061-Win.exe
start /wait %cd%\Git-2.9.2-64-bit.exe
I typed the script out into comment instead of copy and paste from my code, that's probably why /wait becomes \wait
@cw-lin So I ran your script and it ran successfully! I was able to install everything using your script and uninstall everything with my script. Thanks!
I have some feedback:
Here are the options for installing silently for each of the separate installers
Git Installer:
Virtual Box Installer:
Vagrant Installer:
@sthak004 Haven't tested the silent installation yet but here's the more complete version of script I made together.
@echo off
MKDIR Installation
CD Installation
set powershellDir=%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe
IF EXIST "%PROGRAMFILES(X86)%" GOTO GIT64BIT
ELSE GOTO GIT32BIT
:GIT64BIT
%powershellDir% -Command "Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-64-bit.exe -OutFile Git-2.9.2.exe"
%powershellDir% -Command "Start-Process -FilePath '%cd%\Git-2.9.2.exe' -ArgumentList '/silent', '/install', '/norestart' -Wait"
goto VBANDVAGRANT
GOTO END
:GIT32BIT
%powershellDir% -Command "Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.9.2.windows.1/Git-2.9.2-32-bit.exe -OutFile Git-2.9.2.exe"
%powershellDir% -Command "Start-Process -FilePath '%cd%\Git-2.9.2.exe' -ArgumentList '/silent', '/install', '/norestart' -Wait"
goto VBANDVAGRANT
GOTO END
:VBANDVAGRANT
%powershellDir% -Command "Invoke-WebRequest https://releases.hashicorp.com/vagrant/1.8.5/vagrant_1.8.5.msi -OutFile vagrant_1.8.5.msi"
%powershellDir% -Command "Invoke-WebRequest http://download.virtualbox.org/virtualbox/5.0.10/VirtualBox-5.0.10-104061-Win.exe -OutFile VirtualBox-5.0.10-104061-Win.exe"
msiexec /package vagrant_1.8.5.msi /quiet /norestart
%powershellDir% -Command "Start-Process -FilePath '%cd%\VirtualBox-5.0.10-104061-Win.exe' -ArgumentList '/silent', '/install', '/norestart' -Wait"
goto cleanup
GOTO END
:cleanup
del Git-2.9.2.exe vagrant_1.8.5.msi VirtualBox-5.0.10-104061-Win.exe
cd ..
RMDIR Installation
exit