Commit 4e6434c6 authored by Jondy Zhao's avatar Jondy Zhao

slapos-build-installer:

  missing ipwin.exe
  fix slash problem when patch iss script file
parent 9a6bdfa4
...@@ -284,37 +284,47 @@ csih_inform "extracting ${_filename} ..." ...@@ -284,37 +284,47 @@ csih_inform "extracting ${_filename} ..."
(cd /opt ; tar xzf ${_filename} --no-same-owner) || (cd /opt ; tar xzf ${_filename} --no-same-owner) ||
csih_error "extract ${_filename} failed" csih_error "extract ${_filename} failed"
_filename=/opt/git/slapos.package/windows/ipwin/ipwin/ipwin.exe
[[ ! -f ${_filename} ]] &&
cp /usr/bin/ipwin.exe ${_filename} &&
csih_inform "copy ipwin.exe"
csih_inform "Prepare the sources OK" csih_inform "Prepare the sources OK"
echo "" echo ""
# ----------------------------------------------------------- # -----------------------------------------------------------
# Generate installer # Generate installer
# ----------------------------------------------------------- # -----------------------------------------------------------
_issfile=~/slapos.iss _issfile=~/slapos.iss
_installer_name=slapos-windows-all-in-one _installer_name=slapos-windows-all-in-one
_output_dir=$(cygpath -w ~/) _output_dir=$(cygpath -a -w ~ | sed -e 's%\\%\\\\%g')
_source_dir=$(cygpath -a -w $(cygpath -w /)\\..) _source_dir=$(cygpath -a -w $(cygpath -w /)\\.. | sed -e 's%\\%\\\\%g')
_srcfile=/opt/git/slapos.package/windows/scripts/slapos-all-in-one.iss _srcfile=/opt/git/slapos.package/windows/scripts/slapos-all-in-one.iss
_install_path=$(cygpath -w /opt/slapos-node) _install_path=$(cygpath -w /opt/slapos-node | sed -e 's%\\%\\\\%g')
csih_inform "Starting generate Windows installer ..." csih_inform "Starting generate Windows installer ..."
[[ -x "$ISCC" ]] || csih_error "missing $ISCC" [[ -x "$ISCC" ]] || csih_error "missing $ISCC"
csih_inform "copy ${_srcfile} to ${_issfile}" csih_inform "copy ${_srcfile} to ${_issfile}"
cp ${_srcfile} ${_issfile} || csih_error "copy failed" cp ${_srcfile} ${_issfile} || csih_error "copy failed"
csih_inform "patch ${_issfile} ...}" csih_inform "patch ${_issfile} ..."
sed -i -e "s/^DefaultDirName=.*/DefaultDirName=${_install_path}/" \ sed -i -e "s%^DefaultDirName=.*%DefaultDirName=${_install_path}%" \
-e "s/^OutputBaseFilename=.*/OutputBaseFilename=${_installer_name}/" \ -e "s%^OutputBaseFilename=.*%OutputBaseFilename=${_installer_name}%" \
-e "s/^OutputDir=.*/OutputDir=${_output_dir}/" \ -e "s%^OutputDir=.*%OutputDir=${_output_dir}%" \
-e "s/^SourceDir=.*/SourceDir=${_source_dir}/" \ -e "s%^SourceDir=.*%SourceDir=${_source_dir}%" \
${_issfile} || csih_error "patch failed" ${_issfile} || csih_error "patch failed"
csih_inform "run issc to build ${_issfile} ..." csih_inform "run issc to build ${_issfile} ..."
$ISCC /Q $(cygpath -w ${_issfile}) || $ISCC $(cygpath -w ${_issfile}) ||
csih_error "issc failed" csih_error "issc failed"
csih_inform "Generate Windows installer OK" csih_inform "Generate Windows installer OK"
echo "" echo ""
# -----------------------------------------------------------
# Finish
# -----------------------------------------------------------
echo "" echo ""
csih_inform "Build Slapos Windows installer successfully." csih_inform "Build Slapos Windows installer successfully."
echo "" echo ""
......
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