[gitg/windows-installer: 2/2] Fixes on windows installer



commit 88a5090465931e97ecb52531022d6ced06793538
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Thu Oct 25 16:09:40 2018 +0200

    Fixes on windows installer

 win32/make-installer     | 33 ++++++++++++++++++++++-----------
 win32/make-installer.bat |  7 +++++++
 2 files changed, 29 insertions(+), 11 deletions(-)
---
diff --git a/win32/make-installer b/win32/make-installer
index 381a2e37..1bbd84bf 100644
--- a/win32/make-installer
+++ b/win32/make-installer
@@ -1,13 +1,14 @@
 #!/usr/bin/env bash
 
-_wixdir="/c/Program Files (x86)/WiX Toolset v3.8"
+_wix_version=3.11
+_wixdir="/c/Program Files (x86)/WiX Toolset v${_wix_version}"
 _thisdir="$(dirname $0)"
 test "${_thisdir}" = "." && _thisdir=${PWD}
 _installer_root="${_thisdir}"/installer
 _arch=$(uname -m)
 _date=$(date +'%Y%m%d')
 _dateqif=$(date +'%Y-%m-%d')
-_version=@VERSION@
+_version=3.30.1
 _filename=gitg-${_arch}-${_version}.msi
 _log=/tmp/installer.log
 if [ "${_arch}" = "x86_64" ]; then
@@ -31,7 +32,7 @@ fi
 
 _stage="$1"
 case "${_stage}" in
-  stage1 | stage2)
+       stage1 | stage2 | stage3)
     ;;
   *)
     usage
@@ -150,7 +151,13 @@ create_chroot_system() {
 }
 
 install_gitg_packages() {
-  pacman -S mingw-w64-${_arch}-librsvg mingw-w64-${_arch}-gitg mingw-w64-${_arch}-libgee 
mingw-w64-${_arch}-adwaita-icon-theme --noconfirm --root "${_newgitg}"
+  pacman -S mingw-w64-${_arch}-librsvg mingw-w64-${_arch}-libgee mingw-w64-${_arch}-adwaita-icon-theme 
--noconfirm --root "${_newgitg}"
+  if [ -f "mingw-w64-${_arch}-gitg-${_version}-1-any.pkg.tar.xz" ]; then
+    pacman -U mingw-w64-${_arch}-gitg-${_version}-1-any.pkg.tar.xz --noconfirm --root "${_newgitg}"
+  else
+    pacman -S "mingw-w64-${_arch}-gitg" --noconfirm --root "${_newgitg}"
+  fi
+
   _result=$?
   if [ "$_result" -ne "0" ]; then
     exit_cleanly "1" "failed to create ${_newgitg} via command 'pacman -S gitg --noconfirm --root 
${_newgitg}'"
@@ -167,12 +174,16 @@ if [ "${_stage}" = "stage1" ]; then
   exit 0
 fi
 
-echo "Installing gitg packages into ${_newgitg}"
-install_gitg_packages
+if [ "${_stage}" = "stage2" ]; then
+  echo "Installing gitg packages into ${_newgitg}"
+  install_gitg_packages
+fi
 
-echo "Creating gitg installer /tmp/$_filename"
-[ -f /tmp/$_filename ] && rm -f /tmp/$_filename
+if [ "${_stage}" = "stage3" ]; then
+  echo "Creating gitg installer /tmp/$_filename"
+  [ -f /tmp/$_filename ] && rm -f /tmp/$_filename
 
-do_seds
-make_installer
-exit_cleanly "0" "All done, see ${_filename}"
+  do_seds
+  make_installer
+  exit_cleanly "0" "All done, see ${_filename}"
+fi
diff --git a/win32/make-installer.bat b/win32/make-installer.bat
index 4b1d6423..dd131cf8 100644
--- a/win32/make-installer.bat
+++ b/win32/make-installer.bat
@@ -1,3 +1,5 @@
+@echo off
+
 C:/msys64/usr/bin/bash.exe -c "./make-installer stage1"
 if errorlevel 1 (
 exit /b %errorlevel%
@@ -7,3 +9,8 @@ C:/msys64/usr/bin/bash.exe -c "./make-installer stage2"
 if errorlevel 1 (
 exit /b %errorlevel%
 )
+
+C:/msys64/usr/bin/bash.exe -c "./make-installer stage3"
+if errorlevel 1 (
+exit /b %errorlevel%
+)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]