2016-01-12 07:59:05 +01:00
|
|
|
#!/bin/bash
|
2017-01-16 21:15:39 +01:00
|
|
|
#Copyright (c) Citrix Systems, Inc.
|
2016-01-12 07:59:05 +01:00
|
|
|
#All rights reserved.
|
|
|
|
#
|
|
|
|
#Redistribution and use in source and binary forms, with or without modification,
|
|
|
|
#are permitted provided that the following conditions are met:
|
|
|
|
#
|
|
|
|
#1. Redistributions of source code must retain the above copyright notice, this
|
|
|
|
#list of conditions and the following disclaimer.
|
|
|
|
#
|
|
|
|
#2. Redistributions in binary form must reproduce the above copyright notice,
|
|
|
|
#this list of conditions and the following disclaimer in the documentation and/or
|
|
|
|
#other materials provided with the distribution.
|
|
|
|
#
|
|
|
|
#THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
|
|
#ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
|
|
#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
#IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
|
|
|
#INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
#NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
|
#PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
#WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
#ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
#POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2016-03-09 14:30:42 +01:00
|
|
|
echo Entered re-branding.sh
|
2017-01-18 14:33:36 +01:00
|
|
|
set -u
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
ROOT_DIR="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
|
2017-01-18 14:33:36 +01:00
|
|
|
REPO="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
version_cpp()
|
|
|
|
{
|
2017-01-18 14:33:36 +01:00
|
|
|
num=$(echo "${BRANDING_XC_PRODUCT_VERSION}.${BUILD_NUMBER}" | sed 's/\./, /g')
|
2016-02-03 11:34:32 +01:00
|
|
|
sed -b -i -e "s/1,0,0,1/${num}/g" \
|
2016-01-12 07:59:05 +01:00
|
|
|
-e "s/1, 0, 0, 1/${num}/g" \
|
2017-01-18 14:33:36 +01:00
|
|
|
-e "s/@BUILD_NUMBER@/${BUILD_NUMBER}/g" \
|
2016-02-03 11:34:32 +01:00
|
|
|
$1
|
2016-01-12 07:59:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
version_csharp()
|
|
|
|
{
|
2017-01-18 14:33:36 +01:00
|
|
|
sed -b -i -e "s/0\.0\.0\.0/${BRANDING_XC_PRODUCT_VERSION}.${BUILD_NUMBER}/g" \
|
2016-02-03 11:34:32 +01:00
|
|
|
$1
|
2016-01-12 07:59:05 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
rebranding_global()
|
|
|
|
{
|
2016-02-10 12:52:30 +01:00
|
|
|
sed -b -i -e "s#\[BRANDING_COMPANY_NAME_LEGAL\]#${BRANDING_COMPANY_NAME_LEGAL}#g" \
|
|
|
|
-e "s#\[Citrix\]#${BRANDING_COMPANY_NAME_SHORT}#g" \
|
2018-07-06 04:04:51 +02:00
|
|
|
-e "s#\[Citrix XenServer\]#${BRANDING_COMPANY_AND_PRODUCT}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\"\[BRANDING_COPYRIGHT\]\"#${BRANDING_COPYRIGHT}#g" \
|
|
|
|
-e "s#\"\[BRANDING_COPYRIGHT_2\]\"#${BRANDING_COPYRIGHT_2}#g" \
|
|
|
|
-e "s#\[XenServer product\]#${BRANDING_PRODUCT_BRAND}#g" \
|
2018-07-06 04:04:51 +02:00
|
|
|
-e "s#\[Legacy XenServer product\]#${BRANDING_LEGACY_PRODUCT_BRAND}#g" \
|
2016-05-13 01:35:58 +02:00
|
|
|
-e "s#\[BRANDING_PRODUCT_VERSION\]#${BRANDING_XC_PRODUCT_VERSION}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[BRANDING_PRODUCT_VERSION_TEXT\]#${BRANDING_PRODUCT_VERSION_TEXT}#g" \
|
2017-03-31 17:54:26 +02:00
|
|
|
-e "s#\[BRANDING_BUILD_NUMBER\]#${BUILD_NUMBER}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[xensearch\]#${BRANDING_SEARCH}#g" \
|
|
|
|
-e "s#\[xsupdate\]#${BRANDING_UPDATE}#g" \
|
|
|
|
-e "s#\[XenServer\]#${BRANDING_SERVER}#g" \
|
|
|
|
-e "s#\[XenCenter\]#${BRANDING_BRAND_CONSOLE}#g" \
|
2016-06-30 04:31:10 +02:00
|
|
|
-e "s#\[xbk\]#${BRANDING_BACKUP}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[BRANDING_VERSION_5_6\]#${BRANDING_XC_PRODUCT_5_6_VERSION}#g" \
|
2016-10-21 11:58:32 +02:00
|
|
|
-e "s#\[BRANDING_VERSION_6_0\]#${BRANDING_XC_PRODUCT_6_0_VERSION}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[BRANDING_VERSION_6_2\]#${BRANDING_XC_PRODUCT_6_2_VERSION}#g" \
|
|
|
|
-e "s#\[BRANDING_VERSION_6_5\]#${BRANDING_XC_PRODUCT_6_5_VERSION}#g" \
|
2016-02-29 16:08:01 +01:00
|
|
|
-e "s#\[BRANDING_VERSION_7_0\]#${BRANDING_XC_PRODUCT_7_0_VERSION}#g" \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[BRANDING_XENSERVER_UPDATE_URL\]#${BRANDING_XENSERVER_UPDATE_URL}#g" \
|
2017-04-01 04:41:06 +02:00
|
|
|
-e "s#\[BRANDING_PERF_ALERT_MAIL_LANGUAGE_DEFAULT\]#${BRANDING_PERF_ALERT_MAIL_LANGUAGE_DEFAULT}#g" \
|
2016-02-03 11:34:32 +01:00
|
|
|
$1
|
2016-01-12 07:59:05 +01:00
|
|
|
}
|
|
|
|
|
2016-02-10 12:52:30 +01:00
|
|
|
rebranding_features()
|
|
|
|
{
|
2016-02-29 15:54:26 +01:00
|
|
|
sed -b -i -e "s#\[BRANDING_HIDDEN_FEATURES\]#${BRANDING_HIDDEN_FEATURES}#g" \
|
|
|
|
-e "s#\[BRANDING_ADDITIONAL_FEATURES\]#${BRANDING_ADDITIONAL_FEATURES}#g" \
|
|
|
|
$1
|
2016-02-10 12:52:30 +01:00
|
|
|
}
|
|
|
|
|
2016-01-26 07:48:38 +01:00
|
|
|
rebranding_GUID()
|
|
|
|
{
|
2017-06-16 09:55:38 +02:00
|
|
|
sed -b -i \
|
2016-02-10 12:52:30 +01:00
|
|
|
-e "s#\[BRANDING_XENCENTER_UPGRADE_CODE_GUID\]#${BRANDING_XENCENTER_UPGRADE_CODE_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_JA_RESOURCES_GUID\]#${BRANDING_JA_RESOURCES_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_SC_RESOURCES_GUID\]#${BRANDING_SC_RESOURCES_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_REPORT_VIEWER_GUID\]#${BRANDING_REPORT_VIEWER_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_MAIN_EXECUTABLE_GUID\]#${BRANDING_MAIN_EXECUTABLE_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_TEST_RESOURCES_GUID\]#${BRANDING_TEST_RESOURCES_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_EXTERNAL_TOOLS_GUID\]#${BRANDING_EXTERNAL_TOOLS_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_SCHEMAS_FILES_GUID\]#${BRANDING_SCHEMAS_FILES_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_REGISTRY_ENTRIES_GUID\]#${BRANDING_REGISTRY_ENTRIES_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_APPLICAION_SHOTCUT_GUID\]#${BRANDING_APPLICAION_SHOTCUT_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_README_FILE_GUID\]#${BRANDING_README_FILE_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_XSUPDATE_FILE_GUID\]#${BRANDING_XSUPDATE_FILE_GUID}#g" \
|
|
|
|
-e "s#\[BRANDING_HEALTH_CHECK_GUID\]#${BRANDING_HEALTH_CHECK_GUID}#g" \
|
2016-02-03 11:34:32 +01:00
|
|
|
$1
|
2016-01-26 07:48:38 +01:00
|
|
|
}
|
|
|
|
|
2016-01-12 07:59:05 +01:00
|
|
|
version_brand_cpp()
|
|
|
|
{
|
|
|
|
for file in $1
|
|
|
|
do
|
|
|
|
version_cpp ${file} && rebranding_global ${file}
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-01-26 07:48:38 +01:00
|
|
|
branding_wxs()
|
|
|
|
{
|
|
|
|
for file in $1
|
|
|
|
do
|
2016-02-10 12:52:30 +01:00
|
|
|
rebranding_global ${file} && rebranding_features ${file} && rebranding_GUID ${file}
|
2016-01-26 07:48:38 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2016-01-12 07:59:05 +01:00
|
|
|
version_brand_csharp()
|
|
|
|
{
|
|
|
|
for projectName in $1
|
|
|
|
do
|
|
|
|
assemblyInfo=${REPO}/${projectName}/Properties/AssemblyInfo.cs
|
2017-01-18 14:33:36 +01:00
|
|
|
version_csharp ${assemblyInfo} && rebranding_global ${assemblyInfo}
|
2016-01-12 07:59:05 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
RESX_rebranding()
|
|
|
|
{
|
|
|
|
for resx in $1
|
|
|
|
do
|
|
|
|
rebranding_global ${resx}.resx
|
|
|
|
rebranding_global ${resx}.zh-CN.resx
|
|
|
|
rebranding_global ${resx}.ja.resx
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
#splace rebranding
|
2017-01-11 16:57:28 +01:00
|
|
|
version_brand_cpp "${REPO}/splash/splash.rc ${REPO}/splash/main.cpp ${REPO}/splash/splash.vcproj ${REPO}/splash/splash.vcxproj ${REPO}/splash/util.cpp"
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
#projects sign change
|
|
|
|
cd ${REPO} && /usr/bin/find -name \*.csproj -exec sed -i 's#<SignManifests>false#<SignManifests>true#' {} \;
|
|
|
|
|
|
|
|
#AssemblyInfo rebranding
|
2017-06-16 09:55:38 +02:00
|
|
|
version_brand_csharp "XenAdmin CommandLib XenCenterLib XenModel XenOvfApi XenOvfTransport XenCenterVNC xe xva_verify XenServer XenServerHealthCheck"
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
#XenAdmin rebranding
|
|
|
|
rebranding_global ${REPO}/XenAdmin/Branding.cs
|
|
|
|
#XenAdmin controls
|
|
|
|
XENADMIN_RESXS=$(/usr/bin/find ${REPO}/XenAdmin -name \*.resx)
|
|
|
|
for XENADMIN_RESX in ${XENADMIN_RESXS}
|
|
|
|
do
|
|
|
|
rebranding_global ${XENADMIN_RESX}
|
|
|
|
done
|
|
|
|
#xenadmin resouces
|
2016-01-14 11:52:53 +01:00
|
|
|
RESX_rebranding "${REPO}/XenAdmin/Properties/Resources"
|
|
|
|
rebranding_global ${REPO}/XenAdmin/app.config
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
#XenModel rebranding
|
2017-10-02 10:41:41 +02:00
|
|
|
RESX_rebranding "${REPO}/XenModel/Messages ${REPO}/XenModel/InvisibleMessages ${REPO}/XenModel/FriendlyNames ${REPO}/XenModel/XenAPI/FriendlyErrorNames"
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
#XenOvfApi rebranding
|
|
|
|
RESX_rebranding "${REPO}/XenOvfApi/Messages ${REPO}/XenOvfApi/Content"
|
2016-01-15 02:57:36 +01:00
|
|
|
rebranding_global ${REPO}/XenOvfApi/app.config
|
2016-01-12 07:59:05 +01:00
|
|
|
|
|
|
|
#XenOvfTransport XenOvfTransport
|
2016-01-14 11:52:53 +01:00
|
|
|
RESX_rebranding ${REPO}/XenOvfTransport/Messages
|
2016-01-14 10:03:59 +01:00
|
|
|
rebranding_global ${REPO}/XenOvfTransport/app.config
|
2016-01-14 11:52:53 +01:00
|
|
|
|
|
|
|
#mk
|
|
|
|
rebranding_global ${REPO}/mk/ISO_files/AUTORUN.INF
|
2016-02-17 11:31:04 +01:00
|
|
|
rebranding_global ${REPO}/mk/package-and-sign.sh
|
2016-01-14 11:52:53 +01:00
|
|
|
|
|
|
|
#WixInstaller
|
|
|
|
rebranding_global ${REPO}/WixInstaller/en-us.wxl
|
|
|
|
rebranding_global ${REPO}/WixInstaller/ja-jp.wxl
|
|
|
|
rebranding_global ${REPO}/WixInstaller/zh-cn.wxl
|
2017-06-16 16:02:35 +02:00
|
|
|
branding_wxs "${REPO}/WixInstaller/XenCenter.l10n.diff ${REPO}/WixInstaller/XenCenter.wxs"
|
2016-01-14 11:52:53 +01:00
|
|
|
|
|
|
|
#XenAdminTests
|
2016-01-14 10:03:59 +01:00
|
|
|
rebranding_global ${REPO}/XenAdminTests/TestResources/ContextMenuBuilderTestResults.xml
|
2016-01-15 02:57:36 +01:00
|
|
|
rebranding_global ${REPO}/XenAdminTests/app.config
|
|
|
|
rebranding_global ${REPO}/XenAdminTests/TestResources/state1.treeview.serverview.xml
|
2016-01-18 04:07:13 +01:00
|
|
|
rebranding_global ${REPO}/XenAdminTests/TestResources/state1.treeview.orgview.xml
|
|
|
|
rebranding_global ${REPO}/XenAdminTests/TestResources/searchresults.xml
|
|
|
|
rebranding_global ${REPO}/XenAdminTests/TestResources/state3.xml
|
2016-01-22 06:50:12 +01:00
|
|
|
rebranding_global ${REPO}/XenAdminTests/XenAdminTests.csproj
|
2016-03-09 14:30:42 +01:00
|
|
|
echo cp ${REPO}/XenAdminTests/TestResources/succeed.[xsupdate] ${REPO}/XenAdminTests/TestResources/succeed.${BRANDING_UPDATE}
|
|
|
|
cp ${REPO}/XenAdminTests/TestResources/succeed.[xsupdate] ${REPO}/XenAdminTests/TestResources/succeed.${BRANDING_UPDATE}
|
2016-01-14 10:03:59 +01:00
|
|
|
|
|
|
|
#XenServerHealthCheck
|
|
|
|
rebranding_global ${REPO}/XenServerHealthCheck/Branding.cs
|
2016-01-15 02:57:36 +01:00
|
|
|
rebranding_global ${REPO}/XenServerHealthCheck/app.config
|
2016-01-22 06:50:12 +01:00
|
|
|
|
2016-02-02 04:14:59 +01:00
|
|
|
rebranding_CHM()
|
|
|
|
{
|
|
|
|
for files in $1
|
|
|
|
do
|
2016-02-03 11:34:32 +01:00
|
|
|
sed -b -i -e "s#XenCenter.chm#${BRANDING_BRAND_CONSOLE}.chm#g" \
|
2016-02-02 04:14:59 +01:00
|
|
|
-e "s#XenCenter.ja.chm#${BRANDING_BRAND_CONSOLE}.ja.chm#g" \
|
|
|
|
-e "s#XenCenter.zh-CN.chm#${BRANDING_BRAND_CONSOLE}.zh-CN.chm#g" \
|
2016-02-03 11:34:32 +01:00
|
|
|
$files
|
2016-02-02 04:14:59 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "XenCenter" != "${BRANDING_BRAND_CONSOLE}" ]
|
|
|
|
then
|
|
|
|
rebranding_CHM "${REPO}/XenAdmin/XenAdmin.csproj"
|
|
|
|
rebranding_CHM "${REPO}/XenModel/InvisibleMessages.zh-CN.resx ${REPO}/XenModel/InvisibleMessages.ja.resx ${REPO}/XenModel/InvisibleMessages.resx"
|
|
|
|
rm ${REPO}/XenAdmin/Help/XenCenter.chm ${REPO}/XenAdmin/Help/XenCenter.ja.chm ${REPO}/XenAdmin/Help/XenCenter.zh-CN.chm
|
|
|
|
mv ${REPO}/Branding/Help/*.chm ${REPO}/XenAdmin/Help/
|
2016-02-10 12:52:30 +01:00
|
|
|
fi
|
2016-02-25 12:52:10 +01:00
|
|
|
|
|
|
|
#Overwrite HomePage
|
2016-02-26 15:27:37 +01:00
|
|
|
if [ -d ${REPO}/Branding/HomePage ]
|
2016-02-25 12:52:10 +01:00
|
|
|
then
|
|
|
|
rm ${REPO}/XenAdmin/HomePage*.mht
|
|
|
|
cp ${REPO}/Branding/HomePage/*.mht ${REPO}/XenAdmin/
|
2016-02-26 15:27:37 +01:00
|
|
|
fi
|
2017-01-18 14:33:36 +01:00
|
|
|
|
|
|
|
set +u
|