Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit dd98fe6

Browse files
authoredSep 6, 2023
CP-45071: Convert XenCenter build scripts to PowerShell. (#3219)
* CP-45071: Convert XenCenter build scripts to PowerShell. * Removed obsolete variable. * Pass the timestamp server and the certificate thumbprint as parameters to the build and sign scripts. * Added further logging and made the verbose output of cmdlets optional. * Updated README. * Improved script readability. Signed-off-by: Konstantina Chremmou <Konstantina.Chremmou@cloud.com>
1 parent 53dd3d9 commit dd98fe6

21 files changed

+520
-441
lines changed
 

‎Jenkinsfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!groovy
22

3-
/* Copyright (c) Cloud Software Group, Inc.
3+
/* Copyright (c) Cloud Software Group, Inc.
44
*
55
* Redistribution and use in source and binary forms,
66
* with or without modification, are permitted provided
@@ -30,10 +30,10 @@
3030
* SUCH DAMAGE.
3131
*/
3232

33-
def XENADMIN_BRANDING_TAG = 'v5.1'
33+
def XENADMIN_BRANDING_TAG = 'v5.2'
3434

35-
@Library(['PacmanSharedLibrary', "xencenter-pipeline@v4.9"])
36-
import com.citrix.pipeline.xencenter.*
35+
@Library(['PacmanSharedLibrary', "xencenter-pipeline@v4.10"])
36+
import com.xenserver.pipeline.xencenter.*
3737

3838
properties([
3939
[

‎README.md

+4
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@ To run the [NUnit](http://www.nunit.org/) tests you will need the following libr
5454
* Moq.dll
5555

5656
which can be obtained from <http://www.nuget.org/>.
57+
58+
Note that the build script assumes that you have added MSBuild's location (usually
59+
`C:\Program Files\Microsoft Visual Studio\2022\<edition>\MSBuild\Current\Bin`)
60+
to your `PATH` environment variable.

‎WixInstaller/XenCenter.wxs

+9-9
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
<Directory Id="TARGETDIR" Name="SourceDir">
4141
<Directory Id="ProgramFilesFolder">
4242
<Directory Id="XenServer" Name="$(var.BrandProduct)">
43-
<Directory Id="INSTALLDIR" ShortName="$(var.BrandConsoleShort)" Name="$(var.BrandConsoleNoSpace)">
43+
<Directory Id="INSTALLDIR" ShortName="$(var.BrandConsoleShort)" Name="$(var.BrandConsole)">
4444
<Component Id="ReportViewer" Guid="$(var.ReportViewerGuid)">
4545
<File Id="MicRepVwrCmnDLL" Source="$(env.RepoRoot)\XenAdmin\ReportViewer\Microsoft.ReportViewer.Common.dll" />
4646
<File Id="MicRepVwrPrcObjDLL" Source="$(env.RepoRoot)\XenAdmin\ReportViewer\Microsoft.ReportViewer.ProcessingObjectModel.dll" />
@@ -56,11 +56,11 @@
5656
</Component>
5757
<Component Id="MainExecutable" Guid="$(var.MainExeGuid)">
5858
<!-- XenCenter EXE -->
59-
<File Id="XenCenterEXE" Source="$(env.RepoRoot)\XenAdmin\bin\Release\$(var.BrandConsoleNoSpace).exe" KeyPath="yes" />
59+
<File Id="XenCenterEXE" Source="$(env.RepoRoot)\XenAdmin\bin\Release\$(var.BrandConsole).exe" KeyPath="yes" />
6060
<!-- other EXEs -->
6161
<File Id="XeEXE" Source="$(env.RepoRoot)\xe\bin\Release\xe.exe" />
6262
<!-- config -->
63-
<File Id="XenCenterCONFIG" Source="$(env.RepoRoot)\XenAdmin\bin\Release\$(var.BrandConsoleNoSpace).exe.config" />
63+
<File Id="XenCenterCONFIG" Source="$(env.RepoRoot)\XenAdmin\bin\Release\$(var.BrandConsole).exe.config" />
6464
<!-- DLLs -->
6565
<File Id="CommandLibDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\CommandLib.dll" />
6666
<File Id="CookComputingDLL" Source="$(env.RepoRoot)\XenAdmin\bin\Release\CookComputing.XmlRpcV2.dll" />
@@ -149,16 +149,16 @@
149149
<Condition>INSTALLSHORTCUT</Condition>
150150
<Shortcut Id="DesktopXenCenter"
151151
Name="$(var.BrandConsole)"
152-
Target="[INSTALLDIR]$(var.BrandConsoleNoSpace).exe"
152+
Target="[INSTALLDIR]$(var.BrandConsole).exe"
153153
WorkingDirectory="INSTALLDIR"
154154
/>
155-
<RegistryValue Root="HKCU" Key="Software\$(var.BrandProduct)\$(var.BrandConsoleNoSpace)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
155+
<RegistryValue Root="HKCU" Key="Software\$(var.BrandProduct)\$(var.BrandConsole)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
156156
</Component>
157157
</Directory>
158158
</Directory>
159159
<DirectoryRef Id="TARGETDIR">
160160
<Component Id="RegistryEntries" Guid="$(var.RegEntriesGuid)">
161-
<RegistryKey Root="HKMU" Key="Software\$(var.BrandProduct)\$(var.BrandConsoleNoSpace)">
161+
<RegistryKey Root="HKMU" Key="Software\$(var.BrandProduct)\$(var.BrandConsole)">
162162
<RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]" />
163163
<?if "$(var.HiddenFeatures)" != ""?>
164164
<RegistryValue Type="string" Name="HiddenFeatures" Value="$(var.HiddenFeatures)" />
@@ -172,9 +172,9 @@
172172

173173
<DirectoryRef Id="ApplicationProgramsFolder">
174174
<Component Id="ApplicationShortcut" Guid="$(var.AppShortcutGuid)">
175-
<Shortcut Id="StartmenuXenCenter" ShortName="$(var.BrandConsoleShort)" Name="$(var.BrandConsole)" Target="[INSTALLDIR]$(var.BrandConsoleNoSpace).exe" WorkingDirectory="INSTALLDIR" Icon="XenCenterICO" />
175+
<Shortcut Id="StartmenuXenCenter" ShortName="$(var.BrandConsoleShort)" Name="$(var.BrandConsole)" Target="[INSTALLDIR]$(var.BrandConsole).exe" WorkingDirectory="INSTALLDIR" Icon="XenCenterICO" />
176176
<RemoveFolder Id="ApplicationProgramsFolder" On="both" />
177-
<RegistryValue Root="HKCU" Key="Software\$(var.BrandProduct)\$(var.BrandConsoleNoSpace)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
177+
<RegistryValue Root="HKCU" Key="Software\$(var.BrandProduct)\$(var.BrandConsole)" Name="installed" Type="integer" Value="1" KeyPath="yes" />
178178
</Component>
179179
</DirectoryRef>
180180

@@ -200,7 +200,7 @@
200200
<![CDATA[Installed OR (WIXNETFX4RELEASEINSTALLED >= "#528040")]]>
201201
</Condition>
202202
<Property Id="PERMACHINEINSTALL">
203-
<RegistrySearch Id="InstallRegistry" Type="raw" Root="HKLM" Key="Software\$(var.BrandProduct)\$(var.BrandConsoleNoSpace)" Name="InstallDir" />
203+
<RegistrySearch Id="InstallRegistry" Type="raw" Root="HKLM" Key="Software\$(var.BrandProduct)\$(var.BrandConsole)" Name="InstallDir" />
204204
</Property>
205205
<Property Id="REINSTALLMODE" Value="amus" />
206206
<Property Id="INSTALLSHORTCUT" Value="0"/>

‎WixInstaller/branding.wxi

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<!--
4-
Copyright (c) Cloud Software Group, Inc.
4+
Copyright (c) Cloud Software Group, Inc.
55
66
Redistribution and use in source and binary forms,
77
with or without modification, are permitted provided
@@ -49,7 +49,6 @@
4949
<?define CompanyNameLegal="@COMPANY_NAME_LEGAL@"?>
5050
<?define CompanyNameShort="@COMPANY_NAME_SHORT@"?>
5151
<?define BrandConsole="@BRAND_CONSOLE@"?>
52-
<?define BrandConsoleNoSpace="@BRAND_CONSOLE_NO_SPACE@"?>
5352
<?define BrandConsoleShort="@BRAND_CONSOLE_SHORT@"?>
5453
<?define BrandProduct="@PRODUCT_BRAND@"?>
5554
<?define FileExtBackup="xbk"?>

‎WixInstaller/candleList.txt

-29
This file was deleted.

‎WixInstaller/litList.txt

-29
This file was deleted.

‎WixInstaller/wix_src.patch

+7-6
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ diff -ru wixlib/Common.wxs wixlib/Common.wxs
9595
+<Fragment>
9696
+ <Binary Id="WixUIWixca" SourceFile="PrintEula.dll" />
9797
+</Fragment>
98-
+
98+
+
9999
</Wix>
100100
diff -ru wixlib/CustomizeDlg.wxs wixlib/CustomizeDlg.wxs
101101
--- wixlib/CustomizeDlg.wxs 2019-09-15 07:13:54.000000000 +0100
@@ -158,7 +158,7 @@ diff -ru wixlib/CustomizeDlg.wxs wixlib/CustomizeDlg.wxs
158158
diff -ru wixlib/CustomizeStdDlg.wxs wixlib/CustomizeStdDlg.wxs
159159
--- wixlib/CustomizeStdDlg.wxs Tue Feb 21 12:03:46 2012
160160
+++ wixlib/CustomizeStdDlg.wxs Tue Jul 20 20:54:33 2015
161-
@@ -13,7 +13,7 @@
161+
@@ -5,7 +5,7 @@
162162
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
163163
<Fragment>
164164
<UI>
@@ -554,7 +554,7 @@ diff -ru wixlib/WixUI_en-us.wxl wixlib/WixUI_en-us.wxl
554554
<String Id="UITextVolumeCostRequired" Overridable="yes"><!-- _locID_text="UITextVolumeCostRequired" _locComment="UITextVolumeCostRequired" -->Required</String>
555555
<String Id="UITextVolumeCostSize" Overridable="yes"><!-- _locID_text="UITextVolumeCostSize" _locComment="UITextVolumeCostSize" -->Disk Size</String>
556556
<String Id="UITextVolumeCostVolume" Overridable="yes"><!-- _locID_text="UITextVolumeCostVolume" _locComment="UITextVolumeCostVolume" -->Volume</String>
557-
+
557+
+
558558
+ <String Id="ErrorNewerProduct">A newer version of this product is already installed.</String>
559559
+ <String Id="InstallDirDlgUsersLabel">Install for:</String>
560560
+ <String Id="InstallDirDlgUsersAllRadioButton">&amp;All Users</String>
@@ -600,10 +600,10 @@ diff -ru wixlib/WixUI_FeatureTree.wxs wixlib/WixUI_FeatureTree.wxs
600600
<Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
601601
<Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
602602
<Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish>
603-
+
603+
+
604604
+ <Publish Dialog="CustomizeStdDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish>
605605
+ <Publish Dialog="CustomizeStdDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>
606-
+
606+
+
607607
</UI>
608608

609609
<UIRef Id="WixUI_Common" />
@@ -1023,4 +1023,5 @@ diff --git wixlib/MsiRMFilesInUse.wxs wixlib/MsiRMFilesInUse.wxs
10231023
+ <Publish Property="XS_WixUIRMPressedOk" Value="1">1</Publish>
10241024
</Control>
10251025
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
1026-
<Publish Event="EndDialog" Value="Exit">1</Publish>
1026+
<Publish Event="EndDialog" Value="Exit">1</Publish>
1027+

‎XenAdmin/Alerts/Types/ClientUpdateAlert.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public override bool Equals(Alert other)
9898

9999
public static void DownloadAndInstallNewClient(ClientUpdateAlert updateAlert, IWin32Window parent)
100100
{
101-
var outputPathAndFileName = Path.Combine(Path.GetTempPath(), $"{BrandManager.BrandConsoleNoSpace}.msi");
101+
var outputPathAndFileName = Path.Combine(Path.GetTempPath(), $"{BrandManager.BrandConsole}.msi");
102102

103103
var downloadAndInstallClientAction = new DownloadAndUpdateClientAction(updateAlert.Name, new Uri(updateAlert.NewVersion.Url), outputPathAndFileName, updateAlert.Checksum);
104104

‎XenAdmin/Core/Registry.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ public static string GetYumRepoDevTeamSource()
266266
private const string FORCE_SYSTEM_FONTS = "ForceSystemFonts";
267267
private const string DISABLE_PLUGINS = "DisablePlugins";
268268
private const string DONT_SUDO = "DontSudo";
269-
private static readonly string XENCENTER_LOCAL_KEYS = $"SOFTWARE\\{BrandManager.ProductBrand}\\{BrandManager.BrandConsoleNoSpace}";
269+
private static readonly string XENCENTER_LOCAL_KEYS = $"SOFTWARE\\{BrandManager.ProductBrand}\\{BrandManager.BrandConsole}";
270270
private const string PSExecutionPolicyKey = @"Software\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell";
271271
private const string PSExecutionPolicyName = "ExecutionPolicy";
272272
private const string PowerShellKey = @"Software\Microsoft\PowerShell\1";

‎XenAdmin/Program.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@ static Program()
125125
var logFolder = Path.Combine(
126126
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
127127
BrandManager.ProductBrand,
128-
BrandManager.BrandConsoleNoSpace,
128+
BrandManager.BrandConsole,
129129
"logs");
130130

131-
log4net.GlobalContext.Properties["LOG_FILE"] = Path.Combine(logFolder, $"{BrandManager.BrandConsoleNoSpace}.log");
132-
log4net.GlobalContext.Properties["AUDIT_TRAIL"] = Path.Combine(logFolder, $"{BrandManager.BrandConsoleNoSpace}-AuditTrail.log");
133-
log4net.GlobalContext.Properties["NETWORK_TRACE"] = Path.Combine(logFolder, $"{BrandManager.BrandConsoleNoSpace}-NetworkTrace.log");
131+
log4net.GlobalContext.Properties["LOG_FILE"] = Path.Combine(logFolder, $"{BrandManager.BrandConsole}.log");
132+
log4net.GlobalContext.Properties["AUDIT_TRAIL"] = Path.Combine(logFolder, $"{BrandManager.BrandConsole}-AuditTrail.log");
133+
log4net.GlobalContext.Properties["NETWORK_TRACE"] = Path.Combine(logFolder, $"{BrandManager.BrandConsole}-NetworkTrace.log");
134134

135135
log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(Assembly.GetCallingAssembly().Location + ".config"));
136136
log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -145,7 +145,7 @@ static Program()
145145
public static void Main(string[] args)
146146
{
147147
string appGuid = ((GuidAttribute)Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(GuidAttribute), false).GetValue(0)).Value;
148-
_pipePath = string.Format(PIPE_PATH_PATTERN, BrandManager.BrandConsoleNoSpace, Process.GetCurrentProcess().SessionId, Environment.UserName, appGuid);
148+
_pipePath = string.Format(PIPE_PATH_PATTERN, BrandManager.BrandConsole, Process.GetCurrentProcess().SessionId, Environment.UserName, appGuid);
149149

150150
if (NamedPipes.Pipe.ExistsPipe(_pipePath))
151151
{

‎XenAdmin/Settings.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ private static void UpgradeFromPreviousInstallation()
781781
Version previousVersion = null;
782782
Version currentVersion = Program.Version;
783783

784-
var directories = companyFolder.GetDirectories($"{BrandManager.BrandConsoleNoSpace}*");
784+
var directories = companyFolder.GetDirectories($"{BrandManager.BrandConsole}*");
785785

786786
foreach (var dir in directories)
787787
{

‎XenAdmin/XenAdmin.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<OutputType>WinExe</OutputType>
1010
<AppDesignerFolder>Properties</AppDesignerFolder>
1111
<RootNamespace>XenAdmin</RootNamespace>
12-
<AssemblyName>[XenCenter_No_Space]</AssemblyName>
12+
<AssemblyName>[XenCenter]</AssemblyName>
1313
<ApplicationIcon>..\Branding\Images\AppIcon.ico</ApplicationIcon>
1414
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
1515
<PublishUrl>publish\</PublishUrl>

‎XenAdminTests/CodeTests/AssemblyTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace XenAdminTests.CodeTests
4444
[TestFixture, Category(TestCategories.Unit)]
4545
public class AssemblyTests
4646
{
47-
private static readonly string MainAssemblyName = BrandManager.BrandConsoleNoSpace;
47+
private static readonly string MainAssemblyName = BrandManager.BrandConsole;
4848

4949
public class TestDataClass
5050
{

‎XenModel/Actions/StatusReport/ClientSideStatusReportAction.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ protected override void Run()
8282

8383
private void CopyClientLogs()
8484
{
85-
string logDestination = string.Format("{0}\\{1}-{2}.log", filePath, timeString, BrandManager.BrandConsoleNoSpace);
85+
string logDestination = string.Format("{0}\\{1}-{2}.log", filePath, timeString, BrandManager.BrandConsole);
8686
if (includeClientLogs)
8787
{
8888
string logPath = XenAdminConfigManager.Provider.GetLogFile();

‎XenModel/BrandManager.cs

-3
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ static BrandManager()
4747
var customBranding = (CustomBrandingAttribute)assembly.GetCustomAttribute(typeof(CustomBrandingAttribute));
4848

4949
BrandConsole = customBranding.BrandConsole;
50-
BrandConsoleNoSpace = customBranding.BrandConsoleNoSpace;
5150
CompanyNameShort = customBranding.CompanyNameShort;
5251
ProductBrand = customBranding.ProductBrand;
5352
ProductVersionPost82 = customBranding.ProductVersionText;
@@ -66,8 +65,6 @@ static BrandManager()
6665

6766
public static readonly string BrandConsole;
6867

69-
public static readonly string BrandConsoleNoSpace;
70-
7168
public static readonly string Cis = Get("CIS");
7269

7370
public static readonly string CompanyNameLegacy = Get("COMPANY_NAME_LEGACY");

‎XenModel/Properties/AssemblyInfo.cs

+3-7
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
using System.Runtime.InteropServices;
3535
using XenAdmin.Properties;
3636

37-
// General Information about an assembly is controlled through the following
37+
// General Information about an assembly is controlled through the following
3838
// set of attributes. Change these attribute values to modify the information
3939
// associated with an assembly.
4040

@@ -43,8 +43,8 @@
4343
[assembly: AssemblyConfiguration("")]
4444
[assembly: AssemblyProduct("[XenCenter]")]
4545

46-
// Setting ComVisible to false makes the types in this assembly not visible
47-
// to COM components. If you need to access a type in this assembly from
46+
// Setting ComVisible to false makes the types in this assembly not visible
47+
// to COM components. If you need to access a type in this assembly from
4848
// COM, set the ComVisible attribute to true on that type.
4949
[assembly: ComVisible(false)]
5050

@@ -55,7 +55,6 @@
5555

5656
[assembly: CustomBranding(
5757
"[XenCenter]",
58-
"[XenCenter_No_Space]",
5958
"[Vendor]",
6059
"[XenServerProduct]",
6160
"[XenServer version]",
@@ -77,7 +76,6 @@ public class CustomBrandingAttribute : Attribute
7776
{
7877
public CustomBrandingAttribute(
7978
string brandConsole,
80-
string brandConsoleNoSpace,
8179
string companyNameShort,
8280
string productBrand,
8381
string productVersionText,
@@ -94,7 +92,6 @@ string yumRepoNormalSource
9492
)
9593
{
9694
BrandConsole = brandConsole;
97-
BrandConsoleNoSpace = brandConsoleNoSpace;
9895
CompanyNameShort = companyNameShort;
9996
ProductBrand = productBrand;
10097
ProductVersionText = productVersionText;
@@ -111,7 +108,6 @@ string yumRepoNormalSource
111108
}
112109

113110
public string BrandConsole { get; }
114-
public string BrandConsoleNoSpace { get; }
115111
public string CompanyNameShort { get; }
116112
public string ProductBrand { get; }
117113
public string ProductVersionText { get; }
+20-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#!/bin/sh
2-
3-
# Copyright (c) Cloud Software Group, Inc.
1+
# Copyright (c) Cloud Software Group, Inc.
42
#
53
# Redistribution and use in source and binary forms,
64
# with or without modification, are permitted provided
@@ -29,23 +27,22 @@
2927
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3028
# SUCH DAMAGE.
3129

32-
BRANDING_COMPANY_NAME_LEGAL="[Vendor Legal]"
33-
BRANDING_COMPANY_NAME_SHORT="[Vendor]"
34-
BRANDING_PRODUCT_BRAND="[XenServerProduct]"
35-
BRANDING_SERVER="[XenServer host]"
36-
BRANDING_BRAND_CONSOLE="[XenCenter]"
37-
BRANDING_BRAND_CONSOLE_NO_SPACE="[XenCenter]"
38-
BRANDING_BRAND_CONSOLE_SHORT=XenCente
39-
BRANDING_HELP_PATH=xencenter/current-release/
40-
BRANDING_PV_TOOLS="[Guest Tools]"
41-
BRANDING_PRODUCT_VERSION_TEXT=0.0.0
42-
BRANDING_XC_PRODUCT_VERSION=0.0.0
43-
BRANDING_XC_PRODUCT_VERSION_INSTALLER=0.0.0
44-
XC_UPDATES_URL="[Xc updates url]"
45-
CFU_URL="[Cfu url]"
46-
YUM_REPO_BASE_BIN="[YumRepoBaseBin]"
47-
YUM_REPO_BASE_SRC="[YumRepoBaseSource]"
48-
YUM_REPO_EARLY_ACCESS_BIN="[YumRepoEarlyAccessBin]"
49-
YUM_REPO_EARLY_ACCESS_SRC="[YumRepoEarlyAccessSource]"
50-
YUM_REPO_NORMAL_BIN="[YumRepoNormalBin]"
51-
YUM_REPO_NORMAL_SRC="[YumRepoNormalSource]"
30+
$BRANDING_COMPANY_NAME_LEGAL="[Vendor Legal]"
31+
$BRANDING_COMPANY_NAME_SHORT="[Vendor]"
32+
$BRANDING_PRODUCT_BRAND="[XenServerProduct]"
33+
$BRANDING_SERVER="[XenServer host]"
34+
$BRANDING_BRAND_CONSOLE="[XenCenter]"
35+
$BRANDING_BRAND_CONSOLE_SHORT="XenCente"
36+
$BRANDING_HELP_PATH="xencenter/current-release/"
37+
$BRANDING_PV_TOOLS="[Guest Tools]"
38+
$BRANDING_PRODUCT_VERSION_TEXT="0.0.0"
39+
$BRANDING_XC_PRODUCT_VERSION="0.0.0"
40+
$BRANDING_XC_PRODUCT_VERSION_INSTALLER="0.0.0"
41+
$XC_UPDATES_URL="[Xc updates url]"
42+
$CFU_URL="[Cfu url]"
43+
$YUM_REPO_BASE_BIN="[YumRepoBaseBin]"
44+
$YUM_REPO_BASE_SRC="[YumRepoBaseSource]"
45+
$YUM_REPO_EARLY_ACCESS_BIN="[YumRepoEarlyAccessBin]"
46+
$YUM_REPO_EARLY_ACCESS_SRC="[YumRepoEarlyAccessSource]"
47+
$YUM_REPO_NORMAL_BIN="[YumRepoNormalBin]"
48+
$YUM_REPO_NORMAL_SRC="[YumRepoNormalSource]"

‎scripts/re-branding.sh

-91
This file was deleted.

‎scripts/rebranding.ps1

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Copyright (c) Cloud Software Group, Inc.
2+
#
3+
# Redistribution and use in source and binary forms,
4+
# with or without modification, are permitted provided
5+
# that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above
8+
# copyright notice, this list of conditions and the
9+
# following disclaimer.
10+
# * Redistributions in binary form must reproduce the above
11+
# copyright notice, this list of conditions and the
12+
# following disclaimer in the documentation and/or other
13+
# materials provided with the distribution.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
16+
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17+
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18+
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+
# SUCH DAMAGE.
29+
30+
Param(
31+
[Parameter(HelpMessage = "Global build number", Mandatory = $true)]
32+
[int]$buildNumber
33+
)
34+
35+
$verbose = $false
36+
if ($PSBoundParameters.ContainsKey('Verbose')) {
37+
$verbose = $PsBoundParameters['Verbose']
38+
}
39+
40+
####################
41+
# Helper functions #
42+
####################
43+
44+
function version_csharp([string]$file) {
45+
Write-Verbose "Versioning file $file" -Verbose:$verbose
46+
47+
(Get-Content -Path $file -Encoding "utf8") `
48+
-replace "0.0.0.0", "$BRANDING_XC_PRODUCT_VERSION.$buildNumber" `
49+
-replace "0000", "$BRANDING_XC_PRODUCT_VERSION.$buildNumber" |`
50+
Set-Content -Path $file -Encoding "utf8"
51+
}
52+
53+
function rebranding_global([string]$file) {
54+
Write-Verbose "Rebranding file $file" -Verbose:$verbose
55+
56+
(Get-Content -Path $file -Encoding "utf8") `
57+
-replace "\[Vendor Legal\]", $BRANDING_COMPANY_NAME_LEGAL `
58+
-replace "\[Vendor\]", $BRANDING_COMPANY_NAME_SHORT `
59+
-replace "\[Guest Tools\]", $BRANDING_PV_TOOLS `
60+
-replace "\[XenServerProduct\]", $BRANDING_PRODUCT_BRAND `
61+
-replace "\[XenServer version\]", $BRANDING_PRODUCT_VERSION_TEXT `
62+
-replace "\[XenServer host\]", $BRANDING_SERVER `
63+
-replace "\[XenCenter\]", $BRANDING_BRAND_CONSOLE `
64+
-replace "xencenter/current-release/", $BRANDING_HELP_PATH `
65+
-replace "\[Xc updates url\]", $XC_UPDATES_URL `
66+
-replace "\[Cfu url\]", $CFU_URL `
67+
-replace "\[YumRepoBaseBin\]", $YUM_REPO_BASE_BIN `
68+
-replace "\[YumRepoBaseSource\]", $YUM_REPO_BASE_SRC `
69+
-replace "\[YumRepoEarlyAccessBin\]", $YUM_REPO_EARLY_ACCESS_BIN `
70+
-replace "\[YumRepoEarlyAccessSource\]", $YUM_REPO_EARLY_ACCESS_SRC `
71+
-replace "\[YumRepoNormalBin\]", $YUM_REPO_NORMAL_BIN `
72+
-replace "\[YumRepoNormalSource\]", $YUM_REPO_NORMAL_SRC |`
73+
Set-Content -Path $file -Encoding "utf8"
74+
}
75+
76+
##########################
77+
# Rebrand solution files #
78+
##########################
79+
80+
Write-Host "Started product rebranding"
81+
82+
$REPO = Get-Item "$PSScriptRoot\.." | Select-Object -ExpandProperty FullName
83+
84+
. $REPO\scripts\branding.ps1
85+
86+
version_csharp $REPO\CommonAssemblyInfo.cs
87+
rebranding_global $REPO\CommonAssemblyInfo.cs
88+
89+
$projects = @("CFUValidator", "CommandLib", "xe", "XenAdmin", "XenAdminTests", "XenCenterLib", "XenModel", "XenOvfApi")
90+
91+
foreach ($project in $projects) {
92+
$assemblyInfo = "$REPO\$project\Properties\AssemblyInfo.cs"
93+
version_csharp $assemblyInfo
94+
rebranding_global $assemblyInfo
95+
}
96+
97+
rebranding_global $REPO\XenAdmin\XenAdmin.csproj
98+
99+
rebranding_global $REPO\XenAdminTests\TestResources\ContextMenuBuilderTestResults.xml
100+
rebranding_global $REPO\XenAdminTests\XenAdminTests.csproj
101+
102+
#####################
103+
# Rebrand installer #
104+
#####################
105+
106+
$PRODUCT_GUID = [guid]::NewGuid().ToString()
107+
108+
$wxiFile="$REPO\WixInstaller\branding.wxi"
109+
110+
Write-Verbose "Rebranding file $wxiFile" -Verbose:$verbose
111+
112+
(Get-Content -Path $wxiFile -Encoding "utf8") `
113+
-replace "@AUTOGEN_PRODUCT_GUID@", $PRODUCT_GUID `
114+
-replace "@PRODUCT_VERSION@", $BRANDING_XC_PRODUCT_VERSION_INSTALLER `
115+
-replace "@COMPANY_NAME_LEGAL@", $BRANDING_COMPANY_NAME_LEGAL `
116+
-replace "@COMPANY_NAME_SHORT@", $BRANDING_COMPANY_NAME_SHORT `
117+
-replace "@BRAND_CONSOLE@", $BRANDING_BRAND_CONSOLE `
118+
-replace "@BRAND_CONSOLE_SHORT@", $BRANDING_BRAND_CONSOLE_SHORT `
119+
-replace "@PRODUCT_BRAND@", $BRANDING_PRODUCT_BRAND |`
120+
Set-Content -Path $wxiFile -Encoding "utf8"
121+
122+
Write-Host "Completed product rebranding"

‎scripts/xenadmin-build.ps1

+339
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,339 @@
1+
# Copyright (c) Cloud Software Group, Inc.
2+
#
3+
# Redistribution and use in source and binary forms,
4+
# with or without modification, are permitted provided
5+
# that the following conditions are met:
6+
#
7+
# * Redistributions of source code must retain the above
8+
# copyright notice, this list of conditions and the
9+
# following disclaimer.
10+
# * Redistributions in binary form must reproduce the above
11+
# copyright notice, this list of conditions and the
12+
# following disclaimer in the documentation and/or other
13+
# materials provided with the distribution.
14+
#
15+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
16+
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
17+
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
18+
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20+
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22+
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24+
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25+
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26+
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28+
# SUCH DAMAGE.
29+
30+
Param(
31+
[Parameter(HelpMessage = "Global build number", Mandatory = $true)]
32+
[int]$buildNumber,
33+
34+
[Parameter(HelpMessage = "Thumbprint of the certificate to use for signing")]
35+
[string]$thumbPrint,
36+
37+
[Parameter(HelpMessage = "Timestamp server to use for signing")]
38+
[string]$timestampServer
39+
)
40+
41+
$verbose = $false
42+
if ($PSBoundParameters.ContainsKey('Verbose')) {
43+
$verbose = $PsBoundParameters['Verbose']
44+
}
45+
46+
$ErrorActionPreference = "Stop"
47+
48+
####################
49+
# Helper functions #
50+
####################
51+
52+
function mkdir_clean([string]$path) {
53+
if ([System.IO.Directory]::Exists($path)) {
54+
Remove-Item -Path $path -Force -Recurse -Verbose:$verbose
55+
}
56+
New-Item -ItemType Directory -Path $path -Verbose:$verbose
57+
}
58+
59+
function build([string]$solution) {
60+
msbuild /m /verbosity:minimal /p:Configuration=Release /p:TargetFrameworkVersion=v4.8 /p:VisualStudioVersion=17.0 $solution
61+
}
62+
63+
function get_locale_id([string]$locale) {
64+
switch ($locale) {
65+
"ja-jp" { 1041 }
66+
"zh-cn" { 2052 }
67+
"zh-tw" { 1028 }
68+
default { 1033 } #en-us
69+
}
70+
}
71+
72+
######################
73+
# clean working area #
74+
######################
75+
76+
$REPO = Get-Item "$PSScriptRoot\.." | Select-Object -ExpandProperty FullName
77+
$SCRATCH_DIR="$REPO\_scratch"
78+
$OUTPUT_DIR="$REPO\_output"
79+
80+
Write-Host "INFO: Cleaning scratch and output directories"
81+
mkdir_clean $SCRATCH_DIR
82+
mkdir_clean $OUTPUT_DIR
83+
84+
. $REPO\scripts\branding.ps1
85+
$appName = $BRANDING_BRAND_CONSOLE
86+
87+
############################################
88+
# package sources BEFORE applying branding #
89+
############################################
90+
91+
Write-Host "INFO: Packaging source files"
92+
93+
$gitCommit = git rev-parse HEAD
94+
git archive --format=zip -o "$SCRATCH_DIR\xenadmin-sources.zip" $gitCommit
95+
96+
Compress-Archive -Path "$SCRATCH_DIR\xenadmin-sources.zip","$REPO\packages\dotnet-packages-sources.zip" `
97+
-DestinationPath "$OUTPUT_DIR\$appName-source.zip" -Verbose:$verbose
98+
99+
##################
100+
# apply branding #
101+
##################
102+
103+
.$REPO\scripts\rebranding.ps1 $buildNumber -Verbose:$verbose
104+
105+
Write-Host "INFO: Expanding External Tools"
106+
Expand-Archive -Path $REPO\packages\XenCenterOVF.zip -DestinationPath $SCRATCH_DIR -Verbose:$verbose
107+
108+
Write-Host "INFO: Building solution"
109+
build $REPO\XenAdmin.sln
110+
111+
##############
112+
# sign files #
113+
##############
114+
115+
if ([System.IO.File]::Exists("$REPO\scripts\sign.ps1")) {
116+
. $REPO\scripts\sign.ps1
117+
118+
$filesToSign = @(
119+
"$REPO\XenAdmin\bin\Release\CommandLib.dll",
120+
"$REPO\XenAdmin\bin\Release\MSTSCLib.dll",
121+
"$REPO\XenAdmin\bin\Release\CoreUtilsLib.dll",
122+
"$REPO\XenAdmin\bin\Release\XenModel.dll",
123+
"$REPO\XenAdmin\bin\Release\XenOvf.dll",
124+
"$REPO\XenAdmin\bin\Release\$appName.exe",
125+
"$REPO\xe\bin\Release\xe.exe",
126+
"$REPO\XenAdmin\ReportViewer\Microsoft.ReportViewer.Common.dll",
127+
"$REPO\XenAdmin\ReportViewer\Microsoft.ReportViewer.ProcessingObjectModel.dll",
128+
"$REPO\XenAdmin\ReportViewer\Microsoft.ReportViewer.WinForms.dll",
129+
"$REPO\XenAdmin\ReportViewer\Microsoft.ReportViewer.Common.resources.dll",
130+
"$REPO\XenAdmin\ReportViewer\Microsoft.ReportViewer.WinForms.resources.dll"
131+
)
132+
133+
foreach ($file in $filesToSign) {
134+
sign_artifact $file $appName $thumbPrint $timestampServer
135+
}
136+
137+
sign_artifact $REPO\XenAdmin\bin\Release\CookComputing.XmlRpcV2.dll "XML-RPC.NET" $thumbPrint $timestampServer
138+
sign_artifact $REPO\XenAdmin\bin\Release\Newtonsoft.Json.CH.dll "JSON.NET" $thumbPrint $timestampServer
139+
sign_artifact $REPO\XenAdmin\bin\Release\log4net.dll "Log4Net" $thumbPrint $timestampServer
140+
sign_artifact $REPO\XenAdmin\bin\Release\ICSharpCode.SharpZipLib.dll "SharpZipLib" $thumbPrint $timestampServer
141+
sign_artifact $REPO\XenAdmin\bin\Release\DiscUtils.dll "DiscUtils" $thumbPrint $timestampServer
142+
143+
}
144+
else {
145+
Write-Host "INFO: Sign script does not exist; skip signing binaries"
146+
}
147+
148+
###############
149+
# prepare Wix #
150+
###############
151+
152+
Write-Host "INFO: Preparing Wix binaries and UI sources"
153+
mkdir_clean $SCRATCH_DIR\wixbin
154+
Expand-Archive -Path $REPO\packages\wix311-binaries.zip -DestinationPath $SCRATCH_DIR\wixbin
155+
mkdir_clean $SCRATCH_DIR\wixsrc
156+
Expand-Archive -Path $REPO\packages\wix311-debug.zip -DestinationPath $SCRATCH_DIR\wixsrc
157+
158+
Copy-Item -Recurse $REPO\WixInstaller $SCRATCH_DIR -Verbose:$verbose
159+
Copy-Item -Recurse $SCRATCH_DIR\wixsrc\src\ext\UIExtension\wixlib $SCRATCH_DIR\WixInstaller -Verbose:$verbose
160+
Copy-Item $SCRATCH_DIR\WixInstaller\wixlib\CustomizeDlg.wxs $SCRATCH_DIR\WixInstaller\wixlib\CustomizeStdDlg.wxs -Verbose:$verbose
161+
162+
if ("XenCenter" -ne $appName) {
163+
Rename-Item -Path $SCRATCH_DIR\WixInstaller\XenCenter.wxs -NewName "$appName.wxs" -Verbose:$verbose
164+
}
165+
166+
$origLocation = Get-Location
167+
Set-Location $SCRATCH_DIR\WixInstaller\wixlib -Verbose:$verbose
168+
try {
169+
Write-Host "INFO: Patching Wix UI library"
170+
git apply --verbose $SCRATCH_DIR\WixInstaller\wix_src.patch
171+
Write-Host "INFO: Patching Wix UI library completed"
172+
}
173+
finally {
174+
Set-Location $origLocation -Verbose:$verbose
175+
}
176+
177+
New-Item -ItemType File -Path $SCRATCH_DIR\WixInstaller\PrintEula.dll -Verbose:$verbose
178+
179+
###############
180+
# compile Wix #
181+
###############
182+
183+
$CANDLE="$SCRATCH_DIR\wixbin\candle.exe"
184+
$LIT="$SCRATCH_DIR\wixbin\lit.exe"
185+
$LIGHT="$SCRATCH_DIR\wixbin\light.exe"
186+
187+
$installerUiFiles = @(
188+
"BrowseDlg",
189+
"CancelDlg",
190+
"Common",
191+
"CustomizeDlg",
192+
"CustomizeStdDlg",
193+
"DiskCostDlg",
194+
"ErrorDlg",
195+
"ErrorProgressText",
196+
"ExitDialog",
197+
"FatalError",
198+
"FilesInUse",
199+
"InstallDirDlg",
200+
"InvalidDirDlg",
201+
"LicenseAgreementDlg",
202+
"MaintenanceTypeDlg",
203+
"MaintenanceWelcomeDlg",
204+
"MsiRMFilesInUse",
205+
"OutOfDiskDlg",
206+
"OutOfRbDiskDlg",
207+
"PrepareDlg",
208+
"ProgressDlg",
209+
"ResumeDlg",
210+
"SetupTypeDlg",
211+
"UserExit",
212+
"VerifyReadyDlg",
213+
"WaitForCostingDlg",
214+
"WelcomeDlg",
215+
"WixUI_InstallDir",
216+
"WixUI_FeatureTree"
217+
)
218+
219+
$candleList = $installerUiFiles | ForEach-Object { "$SCRATCH_DIR\WixInstaller\wixlib\$_.wxs" }
220+
$candleListString = $candleList -join " "
221+
$litList = $installerUiFiles | ForEach-Object { "$SCRATCH_DIR\WixInstaller\wixlib\$_.wixobj" }
222+
$litListString = $litList -join " "
223+
224+
$env:RepoRoot=$REPO
225+
$env:WixLangId=get_locale_id $locale
226+
227+
Write-Host "INFO: Compiling Wix UI"
228+
Invoke-Expression "$CANDLE -v -out $SCRATCH_DIR\WixInstaller\wixlib\ $candleListString"
229+
Invoke-Expression "$LIT -v -out $SCRATCH_DIR\WixInstaller\wixlib\WixUiLibrary.wixlib $litListString"
230+
231+
##########################################################
232+
# for each locale create an msi containing all resources #
233+
##########################################################
234+
235+
$locales = @("en-us")
236+
237+
foreach ($locale in $locales) {
238+
if ($locale -eq "en-us") {
239+
$name=$appName
240+
}
241+
else {
242+
$name=$appName.$locale
243+
}
244+
245+
Write-Host "INFO: Building msi installer"
246+
247+
Invoke-Expression "$CANDLE -v -ext WiXNetFxExtension -ext WixUtilExtension -out $SCRATCH_DIR\WixInstaller\ $SCRATCH_DIR\WixInstaller\$appName.wxs"
248+
249+
Invoke-Expression "$LIGHT -v -sval -ext WiXNetFxExtension -ext WixUtilExtension -out $SCRATCH_DIR\WixInstaller\$name.msi -loc $SCRATCH_DIR\WixInstaller\wixlib\wixui_$locale.wxl -loc $SCRATCH_DIR\WixInstaller\$locale.wxl $SCRATCH_DIR\WixInstaller\$appName.wixobj $SCRATCH_DIR\WixInstaller\wixlib\WixUiLibrary.wixlib"
250+
}
251+
252+
########################################
253+
# copy and sign the combined installer #
254+
########################################
255+
256+
if ([System.IO.File]::Exists("$REPO\scripts\sign.ps1")) {
257+
sign_artifact "$SCRATCH_DIR\WixInstaller\$appName.msi" $appName $thumbPrint $timestampServer
258+
}
259+
else {
260+
Write-Host "INFO: Sign script does not exist; skip signing installer"
261+
}
262+
263+
Copy-Item "$SCRATCH_DIR\WixInstaller\$appName.msi" $OUTPUT_DIR
264+
265+
###################
266+
# build the tests #
267+
###################
268+
269+
Write-Host "INFO: Building the tests"
270+
build $REPO\XenAdminTests\XenAdminTests.csproj
271+
Copy-Item $REPO\XenAdmin\ReportViewer\* $REPO\XenAdminTests\bin\Release\ -Verbose:$verbose
272+
273+
Compress-Archive -Path $REPO\XenAdminTests\bin\Release -DestinationPath $OUTPUT_DIR\XenAdminTests.zip -Verbose:$verbose
274+
Compress-Archive -Path $REPO\XenAdmin\TestResources\* -DestinationPath "$OUTPUT_DIR\$($appName)TestResources.zip" -Verbose:$verbose
275+
276+
####################################################
277+
# include cfu validator binary in output directory #
278+
####################################################
279+
280+
Compress-Archive -Path $REPO\CFUValidator\bin\Release\*.dll -DestinationPath $OUTPUT_DIR\CFUValidator.zip -Verbose:$verbose
281+
Compress-Archive -Path $REPO\CFUValidator\bin\Release\CFUValidator.exe -Update -DestinationPath $OUTPUT_DIR\CFUValidator.zip -Verbose:$verbose
282+
Compress-Archive -Path $REPO\CFUValidator\bin\Release\$appName.exe -Update -DestinationPath $OUTPUT_DIR\CFUValidator.zip -Verbose:$verbose
283+
284+
####################
285+
# package the pdbs #
286+
####################
287+
288+
Compress-Archive -Path $REPO\packages\*.pdb,$REPO\XenAdmin\bin\Release\*.pdb,$REPO\xe\bin\Release\xe.pdb `
289+
-DestinationPath "$OUTPUT_DIR\$appName.Symbols.zip" -Verbose:$verbose
290+
291+
################################################
292+
# calculate installer and source zip checksums #
293+
################################################
294+
295+
$msi_checksum = (Get-FileHash -Path "$OUTPUT_DIR\$appName.msi" -Algorithm SHA256 |`
296+
Select-Object -ExpandProperty Hash).ToLower()
297+
298+
$msi_checksum | Out-File -FilePath "$OUTPUT_DIR\$appName.msi.checksum" -Encoding utf8
299+
300+
Write-Host "INFO: Calculated checksum installer checksum: $msi_checksum"
301+
302+
$source_checksum = (Get-FileHash -Path "$OUTPUT_DIR\$appName-source.zip" -Algorithm SHA256 |`
303+
Select-Object -ExpandProperty Hash).ToLower()
304+
305+
$source_checksum | Out-File -FilePath "$OUTPUT_DIR\$appName-source.zip.checksum" -Encoding utf8
306+
307+
Write-Host "INFO: Calculated checksum source checksum: $source_checksum"
308+
309+
$xmlFormat=@"
310+
<?xml version=\"1.0\" ?>
311+
<patchdata>
312+
<versions>
313+
<version
314+
latest="true"
315+
latestcr="true"
316+
name="{0}"
317+
timestamp="{1}"
318+
url="{2}"
319+
checksum="{3}"
320+
value="{4}"
321+
/>
322+
</versions>
323+
</patchdata>
324+
"@
325+
326+
$msi_url = $XC_UPDATES_URL -replace "XCUpdates.xml","$appName.msi"
327+
$date=(Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
328+
$productFullName = "$appName $productVersion"
329+
$productVersion = "$BRANDING_XC_PRODUCT_VERSION.$buildNumber"
330+
331+
Write-Host "INFO: Generating XCUpdates.xml"
332+
333+
[string]::Format($xmlFormat, $productFullName, $date, $msi_url, $msi_checksum, $productVersion) |`
334+
Out-File -FilePath $OUTPUT_DIR\XCUpdates.xml -Encoding utf8
335+
336+
Write-Host "INFO: Generating stage-test-XCUpdates.xml. URL is a placeholder value"
337+
338+
[string]::Format($xmlFormat, $productFullName, $date, "@DEV_MSI_URL_PLACEHOLDER@", $msi_checksum, $productVersion) |`
339+
Out-File -FilePath $OUTPUT_DIR\stage-test-XCUpdates.xml -Encoding utf8

‎scripts/xenadmin-build.sh

-227
This file was deleted.

0 commit comments

Comments
 (0)
This repository has been archived.