summaryrefslogtreecommitdiff
path: root/scp2/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-04-15 23:24:42 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-04-25 06:57:23 +0200
commitb84244378d411b83355b8763d3505031dd5ec324 (patch)
tree1588a7ed3b945258590243c228ce1ac470a50107 /scp2/source
parentaa45e2745f14c5626fe163939dc7d101efe9d1cd (diff)
Install UCRT from MSUs, not using nested VC Redist install
Using nested install is bad because (1) MS advises against it (though it most possibly doesn't relate to our specific case, when we install the vc redist exe package in UI part, so actually only a single MSI session is active at any time); (2) because it adds some extra interactions (user sees something "unrelated" being installed, which raises concerns; additional admin authentication required); and (3) because it runs in InstallUISequence, thus only installing the UCRT when doing interactive installation (unattended installs, including GPO, need to install UCRT separately). This patch aims to incorporate the original UCRT MSU (Windows Update) packages (https://support.microsoft.com/en-us/help/2999226) available as a zip archive from https://www.microsoft.com/en-us/download/details.aspx?id=48234 - the same as used in VC redists for VS 2015 and 2017. This obsoletes the separate installation of the redist; since we also have the redist as merge module in our MSI, that is enough (and removes redundancy). The MSUs are installed using wusa.exe in a custom action (deferred, non-impersonating). As a small bonus, embedding MSUs instead of redist EXE allows us to shrink the size of installer a little (~10 MB). As deferred custom actions cannot access current installer database, we workaround this by using initial immediate impersonating action to extract the binaries into a temporary location. To ensure that the file gets removed upon completion (both successful and failed), we use an additional cleanup action. Commit 61b1d631331551b43bc7d619be33bfbfeff7cad6 is effectively reverted. Change-Id: I1529356fdcc67ff24b232c01ddf8bb3a31bb00bd Reviewed-on: https://gerrit.libreoffice.org/52923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'scp2/source')
-rw-r--r--scp2/source/ooo/ucrt.scp154
-rw-r--r--scp2/source/ooo/vc_redist.scp23
2 files changed, 154 insertions, 23 deletions
diff --git a/scp2/source/ooo/ucrt.scp b/scp2/source/ooo/ucrt.scp
new file mode 100644
index 000000000000..4a13309f6364
--- /dev/null
+++ b/scp2/source/ooo/ucrt.scp
@@ -0,0 +1,154 @@
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "macros.inc"
+
+File gid_File_Windows6_1_KB2999226_x64_msu
+ Name = "Windows6.1-KB2999226-x64.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+File gid_File_Windows8_RT_KB2999226_x64_msu
+ Name = "Windows8-RT-KB2999226-x64.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+File gid_File_Windows8_1_KB2999226_x64_msu
+ Name = "Windows8.1-KB2999226-x64.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+#ifndef WINDOWS_X64
+
+File gid_File_Windows6_1_KB2999226_x86_msu
+ Name = "Windows6.1-KB2999226-x86.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+File gid_File_Windows8_RT_KB2999226_x86_msu
+ Name = "Windows8-RT-KB2999226-x86.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+File gid_File_Windows8_1_KB2999226_x86_msu
+ Name = "Windows8.1-KB2999226-x86.msu";
+ Dir = gid_Brand_Dir_Program;
+ Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
+End
+
+#endif /* WINDOWS_X64 */
+
+/* A deferred not-impersonated action that will call wusa.exe to actually install
+ msu. Since deferred actions don't have access to current DB, the action depends
+ on immediate-executed action inst_ucrt (see below) that precedes it, unpacks
+ the binary to a temp file, and sets this action's CustomActionData property.
+*/
+WindowsCustomAction gid_Customaction_inst_msu
+ Name = "inst_msu";
+ Typ = "3073";
+ Source = "inst_msu_msi.dll";
+ Target = "InstallMSU";
+ Inbinarytable = 1;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And inst_msu", "InstallFiles");
+End
+
+/* An immediately-executed action that will unpack a binary, which name in binary table is set
+ in "InstMSUBinary" property, to a temporary file, and sets "inst_msu" and "cleanup_msu" props.
+*/
+WindowsCustomAction gid_Customaction_unpack_msu
+ Name = "unpack_msu";
+ Typ = "1";
+ Source = "inst_msu_msi.dll";
+ Target = "UnpackMSUForInstall";
+ Inbinarytable = 1;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And InstMSUBinary", "cleanup_msu");
+End
+
+/* A rollback action that removes temp file. It must precede inst_msu.
+*/
+WindowsCustomAction gid_Customaction_cleanup_msu
+ Name = "cleanup_msu";
+ Typ = "1345";
+ Source = "inst_msu_msi.dll";
+ Target = "CleanupMSU";
+ Inbinarytable = 1;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And cleanup_msu", "inst_msu");
+End
+
+WindowsCustomAction gid_Customaction_check_win7x64_ucrt
+ Name = "check_win7x64_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows61-KB2999226-x64msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 601 And VersionNT64 And Not UCRT_DETECTED", "FileCost");
+ Styles = "NO_FILE";
+End
+
+WindowsCustomAction gid_Customaction_check_win8x64_ucrt
+ Name = "check_win8x64_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows8-RT-KB2999226-x64msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 602 And VersionNT64 And Not UCRT_DETECTED", "check_win7x64_ucrt");
+ Styles = "NO_FILE";
+End
+
+WindowsCustomAction gid_Customaction_check_win81x64_ucrt
+ Name = "check_win81x64_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows81-KB2999226-x64msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And VersionNT64 And Not UCRT_DETECTED", "check_win8x64_ucrt");
+ Styles = "NO_FILE";
+End
+
+#ifndef WINDOWS_X64
+
+/* 32-bit installer must be prepared to run on both 32- and 64-bit Windows. So, it might need to
+ install either 32-bit or 64-bit UCRT package, depending on OS bitness.
+*/
+
+WindowsCustomAction gid_Customaction_check_win7x32_ucrt
+ Name = "check_win7x32_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows61-KB2999226-x86msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 601 And Not VersionNT64 And Not UCRT_DETECTED", "check_win81x64_ucrt");
+ Styles = "NO_FILE";
+End
+
+WindowsCustomAction gid_Customaction_check_win8x32_ucrt
+ Name = "check_win8x32_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows8-RT-KB2999226-x86msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 602 And Not VersionNT64 And Not UCRT_DETECTED", "check_win7x32_ucrt");
+ Styles = "NO_FILE";
+End
+
+WindowsCustomAction gid_Customaction_check_win81x32_ucrt
+ Name = "check_win81x32_ucrt";
+ Typ = "51";
+ Source = "InstMSUBinary";
+ Target = "Windows81-KB2999226-x86msu";
+ Inbinarytable = 0;
+ Assignment1 = ("InstallExecuteSequence", "Not Installed And VersionNT = 603 And Not VersionNT64 And Not UCRT_DETECTED", "check_win8x32_ucrt");
+ Styles = "NO_FILE";
+End
+
+#endif /* WINDOWS_X64 */
diff --git a/scp2/source/ooo/vc_redist.scp b/scp2/source/ooo/vc_redist.scp
index 921a9433e820..727c13b27615 100644
--- a/scp2/source/ooo/vc_redist.scp
+++ b/scp2/source/ooo/vc_redist.scp
@@ -18,8 +18,6 @@
#include "macros.inc"
-#if defined(MSM_PATH)
-
#if defined(WITH_VC140_REDIST)
#if defined WINDOWS_X64
@@ -76,24 +74,3 @@ MergeModule gid_MergeModule_Microsoft_VC141_CRT_x86
End
#endif
-
-#endif // MSM_PATH
-
-#if defined(VCREDIST_EXE_NAME)
-
-File gid_File_Vcredist_Exe
- Name = VCREDIST_EXE_NAME;
- Dir = gid_Brand_Dir_Program;
- Styles = (PACKED, BINARYTABLE, BINARYTABLE_ONLY);
-End
-
-WindowsCustomAction gid_Customaction_InstallVCRedist
- Name = "InstallVCRedist";
- Typ = "66"; /* 0x02 = exe in a binary table stream; 0x40 = ignore exit code and continue */
- Source = VCREDIST_EXE_NAME;
- Target = "/repair /norestart /passive";
- Inbinarytable = 1;
- Assignment1 = ("InstallUISequence", "Not Installed And Not ( VCRUNTIME_DETECTED And UCRT_DETECTED ) And VC_REDIST = 1", "behind_ExecuteAction");
-End
-
-#endif