From 0a818d52c9ed7fff2c5bd06d77cba64cebabf7f4 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 21 Nov 2018 14:22:04 +0100 Subject: [PATCH] added script to update guid in install wix files. --- .../install/git_update_eiffelstudio_guid.sh | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 windows_deliv/install/git_update_eiffelstudio_guid.sh diff --git a/windows_deliv/install/git_update_eiffelstudio_guid.sh b/windows_deliv/install/git_update_eiffelstudio_guid.sh new file mode 100644 index 0000000..f01715a --- /dev/null +++ b/windows_deliv/install/git_update_eiffelstudio_guid.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +function new_uuid() { + echo $(od -x /dev/urandom | head -1 | awk '{OFS="-"; print $2$3,$4,$5,$6,$7$8$9}' | awk '{print toupper($0)}') +} + +function do_sed { + echo sed -i -e "$1" "$2" + sed -i -e "$1" "$2" +} + +echo Update EiffelStudio GUIDs +DELIV_INSTALL_DIR=$EIFFEL_SRC/Delivery/scripts/windows/install +DELIV_INSTALL_DIR=`pwd` + +# $DELIV_INSTALL_DIR/includes/Preprocessors.wxi +git checkout -- "$DELIV_INSTALL_DIR/install/includes/Preprocessors.wxi" + +line=32 +do_sed "$((line+1))s/\(ProductGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi +do_sed "$((line+2))s/\(RegistriesGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi +do_sed "$((line+3))s/\(ShortcutsGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi + + +do_sed "$((line+5))s/\(ProductGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi +do_sed "$((line+6))s/\(RegistriesGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi +do_sed "$((line+7))s/\(ShortcutsGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi + +do_sed "$((line+9))s/\(UpgradeGuid\s*=\s*\)\"[0-9A-Fa-f-]*\"/\1\"$(new_uuid)\"/g" $DELIV_INSTALL_DIR/includes/Preprocessors.wxi + +git diff --ignore-space-at-eol "$DELIV_INSTALL_DIR/includes/Preprocessors.wxi" +echo Check the lines are still the same