Skip to content

Commit

Permalink
[TEMPLATE-UPDATE] postinstall.sh grabs 7zip instead of daemon utils
Browse files Browse the repository at this point in the history
  • Loading branch information
hh committed Jan 3, 2012
1 parent b1bc841 commit 0bac328
Showing 1 changed file with 28 additions and 41 deletions.
69 changes: 28 additions & 41 deletions templates/windows-2008-amd64/postinstall.sh
Expand Up @@ -17,45 +17,30 @@ wget http://apt-cyg.googlecode.com/svn/trunk/apt-cyg
chmod +x apt-cyg
mv apt-cyg /usr/local/bin/

# Download Daemontools Lite
# This needs some fixing as the url seems to change every X time ...
#wget http://www.daemon-tools.cc/eng/downloads/dtproAdv
#cat http://www.daemon-tools.cc/eng/downloads/dtLite|grep <div download ...>
URL=$(curl -L http://www.daemon-tools.cc/eng/downloads/dtLite|grep http|grep exe|cut -d '"' -f 4)
curl -L $URL -o daemontools.exe

#curl -L http://disc-tools.com/request?p=70e5b112a42060a5439c5edec8e4f8c3/DTLite4402-0131.exe -o daemontools.exe
chmod +x daemontools.exe

# Silent install Daemontools
# http://www.daemon-help.com/en/installation_notes_lite/installation_lite.html
# Silent install - http://forum.daemon-tools.cc/f24/dt-4-08-a-15030/
./daemontools.exe /S
# 7zip will allow us to extract a file from an ISO
wget http://downloads.sourceforge.net/sevenzip/7z920-x64.msi
msiexec /qb /i 7z920-x64.msi

# Download Virtualbox Additions
VBOX_VERSION="4.0.8"
VBOX_VERSION="4.1.8" #"4.0.8"
wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso

# Mount iso file
# http://www.daemon-help.com/en/windows_integration_lite/command_line_parameters.html
# /cygdrive/c/Program Files (x86)/DAEMON Tools Pro
cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
./DTLite.exe -mount 0,"c:\cygwin\home\vagrant\VBoxGuestAdditions_4.0.8.iso"
# Extract the installer from the ISO (WHY WHY WHY isn't this available not bundled inside an ISO)
7z.exe x VBoxGuestAdditions_$VBOX_VERSION.iso VBoxWindowsAdditions-amd64.exe

# Mark Oracle as a trusted installer
#http://blogs.msdn.com/b/steverac/archive/2009/07/09/adding-certificates-to-the-local-certificates-store-and-setting-local-policy-using-a-command-line-system-center-updates-publisher-example.aspx

certutil -addstore -f "TrustedPublisher" a:oracle-cert.cer

# Install the Virtualbox Additions
cd /cygdrive/e
./VBoxWindowsAdditions.exe /S

#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/

# Unmount ISO file
cd "/cygdrive/c/Program Files (x86)/DAEMON Tools Lite"
./DTLite.exe -unmount 0
curl -L http://www.opscode.com/chef/install.msi -o chef-client-latest.msi
msiexec /qb /i chef-client-latest.msi

#http://www.msfn.org/board/topic/105277-howto-create-a-fully-up-to-date-xp-x64-dvd/

# Next step is get ruby working
# But thanks to opscode's work , that should not be an issue
Expand All @@ -67,41 +52,43 @@ cd /home/vagrant
# Ruby 1.9
#wget http://rubyforge.org/frs/download.php/74298/rubyinstaller-1.9.2-p180.exe -O rubyinstaller.exe
# Ruby 1.8
wget http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.8.7-p334.exe -O rubyinstaller.exe
##wget http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.8.7-p334.exe -O rubyinstaller.exe

chmod +x rubyinstaller.exe
./rubyinstaller.exe /verysilent /dir="C:\ruby" /tasks="assocfiles,modpath" /SUPPRESSMSGBOXES
#chmod +x rubyinstaller.exe
#./rubyinstaller.exe /verysilent /dir="C:\ruby" /tasks="assocfiles,modpath" /SUPPRESSMSGBOXES

# Now add it to the path cmd, and cygwin path
# http://serverfault.com/questions/63017/how-do-i-modify-the-system-path-in-windows-2003-windows-2008-using-a-script
/cygdrive/c/Windows/System32/setx.exe PATH "c:\windows\system32;c:\ruby\bin" /M
export PATH=$PATH:/cygdrive/c/ruby/bin
##/cygdrive/c/Windows/System32/setx.exe PATH "c:\windows\system32;c:\ruby\bin" /M
##export PATH=$PATH:/cygdrive/c/ruby/bin

# Install Ruby dev kit (native extensions)
mkdir /cygdrive/c/devkit
cd /cygdrive/c/devkit
wget --no-check-certificate http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe -O rubydevkit.exe
chmod +x rubydevkit.exe
./rubydevkit -y
ruby dk.rb init
ruby dk.rb install
##mkdir /cygdrive/c/devkit
##cd /cygdrive/c/devkit
##wget --no-check-certificate http://github.com/downloads/oneclick/rubyinstaller/DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe -O rubydevkit.exe
##chmod +x rubydevkit.exe
##./rubydevkit -y
##ruby dk.rb init
##ruby dk.rb install

# Installing puppet
gem.bat install puppet --no-rdoc --no-ri --verbose
##gem.bat install puppet --no-rdoc --no-ri --verbose

# Installing chef required gems on windows
# For ruby 1.8
gem.bat install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
##gem.bat install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
# For ruby 1.9
#gem.bat install win32-open3 rdp-ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose

# Install chef
gem.bat install ohai --no-rdoc --no-ri --verbose
gem.bat install chef --no-rdoc --no-ri --verbose
##gem.bat install ohai --no-rdoc --no-ri --verbose
##gem.bat install chef --no-rdoc --no-ri --verbose

# Currently 1.9 ruby + chef 10 doesn't seem to be able to
#http://stackoverflow.com/questions/4819807/ohai-fails-to-determine-os-version-in-cygwin



#Making aliases
cat <<EOF > /home/vagrant/.bash_profile
alias chef-client="chef-client.bat"
Expand Down

0 comments on commit 0bac328

Please sign in to comment.