Commit d197529b authored by Jondy Zhao's avatar Jondy Zhao

slapos-windows-installer: refine the self installer

parent 45bd7748
...@@ -11,25 +11,22 @@ recipe = slapos.recipe.cmmi ...@@ -11,25 +11,22 @@ recipe = slapos.recipe.cmmi
# This url is useless # This url is useless
path = $${buildout:directory} path = $${buildout:directory}
pre-configure = pre-configure =
declare -r installer=${installer:location}/slapos-windows-all-in-one.exe declare -r installer=/opt/publish/slapos-windows-all-in-one.exe
declare -r targetdir=$(cygpath -w $${buildout:directory}) declare -r targetdir=$(cygpath -w $${buildout:directory})
declare -r logfile=$(cygpath -w $${buildout:directory}/slapos-windows-installer.log) declare -r logfile=$(cygpath -w $${buildout:directory}/slapos-windows-installer.log)
echo "$installer /DIR=\"\$targetdir\" /LOG=\"\$logfile\" /VERYSILENT" > $${:configure-command} echo "$installer /DIR=\"\$targetdir\" /LOG=\"\$logfile\" /VERYSILENT" > $${:configure-command}
chmod +x $${:configure-command} chmod +x $${:configure-command}
configure-command = $${buildout:directory}/bootloader.sh configure-command = $${buildout:directory}/bootloader.sh
pre-install = pre-install =
declare -r cyghome="$(cygpath -m -a /)/.." cp /certificate $${buildout:directory}/cygwin/certificate
cp $cyghome/setup.exe $${buildout:directory} cp /key $${buildout:directory}/cygwin/key
cp $cyghome/certificate $${buildout:directory}/cygwin/certificate cp /test-computer.crt $${buildout:directory}/cygwin/computer.crt
cp $cyghome/key $${buildout:directory}/cygwin/key cp /test-computer.key $${buildout:directory}/cygwin/computer.key
cp $cyghome/test-computer.crt $${buildout:directory}/cygwin/computer.crt cp /etc/slapos/scripts/slapos-windows-wrapper.bat $${buildout:directory}/slapos-windows-wrapper.bat
cp $cyghome/test-computer.key $${buildout:directory}/cygwin/computer.key
cp ${installer:cygroot}/slapos-windows-wrapper.bat $${buildout:directory}/slapos-windows-wrapper.bat
make-binary = true make-binary = true
post-install = post-install =
$${buildout:directory}/slapos-windows-wrapper.bat /etc/slapos/scripts/slapos-configure.sh \ $${buildout:directory}/slapos-windows-wrapper.bat /etc/slapos/scripts/slapos-configure.sh \
--password=slaptester \ --password=slaptester \
--ipv4-local-network=10.89.208.0/24 \
--client-certificate=/certificate \ --client-certificate=/certificate \
--client-key=/key \ --client-key=/key \
--computer-certificate=/computer.crt \ --computer-certificate=/computer.crt \
......
...@@ -7,52 +7,12 @@ parts = ...@@ -7,52 +7,12 @@ parts =
installer installer
instance-template instance-template
[inno-setup]
recipe = hexagonit.recipe.download
url = http://dashingsoft.com/products/slapos/inno-setup.tar.bz2
md5sum = 44620b8619c9cc5b3e262655f0089f05
download-only = true
[slapos-build-installer]
recipe = hexagonit.recipe.download
url = http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/scripts/slapos-build-installer
md5sum = 7aafc3fcf21596c61a8e532bea3275ed
download-only = true
[slapos-windows-wrapper]
recipe = hexagonit.recipe.download
url = http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/scripts/slapos-windows-wrapper.bat
md5sum = e7f1443dab3c0180a906534a1fe95ceb
download-only = true
[setup-cygwin]
recipe = hexagonit.recipe.download
url = http://git.erp5.org/gitweb/slapos.package.git/blob_plain/heads/cygwin:/windows/scripts/setup-cygwin.bat
md5sum = eb868bed0d0fd9d950f4f972b09a2479
download-only = true
[cygwin-packages]
recipe = hexagonit.recipe.download
url = http://dashingsoft.com/products/slapos/cygwin-packages.tar.bz2
md5sum = b0e3f3cf51573c3c94c787201fbb8cdf
download-only = true
[installer] [installer]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
path = ${buildout:parts-directory}/${:_buildout_section_name_} configure-command = /etc/slapos/scripts/build-slapos.sh
cygroot = ${buildout:parts-directory}/${:_buildout_section_name_} configure-options = /opt/buildout
pre-configure=
mkdir -p ${:cygroot}/cygwin
(cd ${:cygroot} ; wget http://dashingsoft.com/products/slapos/inno-setup.tar.bz2 ; tar xjf inno-setup.tar.bz2)
(cd ${:cygroot} ; wget http://dashingsoft.com/products/slapos/cygwin-packages.tar.bz2 ; tar xjf cygwin-packages.tar.bz2)
cp $(cygpath -m -a /)/../setup.exe ${:cygroot}
cp ${slapos-build-installer:location}/slapos-build-installer ${:cygroot}/cygwin
cp ${slapos-windows-wrapper:location}/slapos-windows-wrapper.bat ${:cygroot}
cp ${setup-cygwin:location}/setup-cygwin.bat ${:cygroot}
chmod +x ${:cygroot}/*.bat
configure-command = ${:cygroot}/setup-cygwin.bat
make-binary = true make-binary = true
post-install= ${:cygroot}/slapos-windows-wrapper.bat /slapos-build-installer post-install = /etc/slapos/scripts/slapos-build-installer ${:configure-options}
#---------------- #----------------
#-- Instance-level buildout profiles. #-- Instance-level buildout profiles.
...@@ -60,7 +20,7 @@ post-install= ${:cygroot}/slapos-windows-wrapper.bat /slapos-build-installer ...@@ -60,7 +20,7 @@ post-install= ${:cygroot}/slapos-windows-wrapper.bat /slapos-build-installer
[instance-template] [instance-template]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in url = ${:_profile_base_location_}/instance.cfg.in
md5sum = 8af79052227761407fae5c5a6cb5ec02 md5sum = 450861d13f5165a800d849050a6a6821
output = ${buildout:directory}/instance.cfg output = ${buildout:directory}/instance.cfg
mode = 0644 mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment