diff options
author | David Ostrovsky <david@ostrovsky.org> | 2017-01-21 11:44:33 +0100 |
---|---|---|
committer | David Ostrovsky <david@ostrovsky.org> | 2017-02-01 18:07:38 +0000 |
commit | 30473907a565764eb35a19051dc0d52704cf7bb7 (patch) | |
tree | 438cb94e9bc3a61fba8dcbee57fe107802dca732 /include/unotest | |
parent | 56a8a76e9e001dc5274815c3893bf48c9e7b7298 (diff) |
tdf#105311 VC++ Runtime installed in wrong directory
Starting from MSVC 14.0, the directory table layout of VC++ Runtime merge
module changed. As consequence, all MSI produced with newer compilers,
including MSVC 15.0 (aka VS 2017) are broken in term that the VC++
Runtime DLLs are installed in the wrong directory, e.g.: C:\System64.
According to the specification for merging merge module (msm), see:
"Authoring Merge Module Directory Tables": [1], custom action 51 (set
property) must be emitted for every directory name in the merge module
directory table if the directory name is starting with the standard
directory name.
Quoting it here:
"
When a predefined directory is included in a merge module, the merge
tool automatically adds a Custom Action Type 51 to the target database.
The merge module author must ensure that a CustomAction table is also
included. The CustomAction table may be empty, but this table is required
to exist in the target database and ensures that the modified predefined
directories are written to the correct locations. For example, when a
system directory is included in a merge module, the merge module author
must ensure that a Custom Action table exists.
Note that the matching algorithm for the generation of these type 51
custom actions only checks that the directory name begins with one of
the predefined SystemFolder properties. It does not verify that the
directory name exactly equals the directory property. Any directory
beginning with one of these standard folder names gets a type 51 custom
action, even if the rest of the name is not a GUID. Authors need to take
care that this does not generate false positive matches, and unintended
custom action generation, on derivative primary keys that begin with one
of the SystemFolder properties."
Rectify the problem by analyzing the directory table from the merge
module, checking whether the directory name starts with the standard
prefix name and if it is the case, emitting custom action 51 to set this
variable to the standard directory name.
Implementation details:
We use the existing facility for emitting the custom action table events
including referencing them in the corresponding sequence tables. Given
that the specification above doesn't mention what sequence table should
be referencing this emitted custom action, we reversed engineer this
information from WiX toolkit. Merging the VC++ CRT module with WiX
toolkit and investigating the resulting MSI with Orca MSI reader, reveals
that these sequence tables were referencing from these sequence tables:
* AdminExecuteSequence
* AdminUISequence
* AdvtExecuteSequence
* InstallExecuteSequence
* InstallUISequence
Replicate this behaviour here as well. Note, though, that custom actions
are generally not referenced in AdminUISequence and AdvtExecuteSequence
tables in LibreOffice MSI building tool chain.
Rendering of the custom action is achieved by programmatic emulation of
custom action in SCP module. Consider this similar SCP module based
action:
Name = "MigrateInstallPath";
Typ = "321";
Source = "shlxtmsi.dll";
Target = "MigrateInstallPath";
Inbinarytable = 1;
Assignment1 = ("InstallExecuteSequence", "", "CostInitialize");
Assignment2 = ("InstallUISequence", "", "CostInitialize");
We instantiate the following data structure to emit custom action
System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1:
Name = "System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1"
Typ = "51"
Source = "System64Folder.3CFBED52_9B44_3A4D_953C_90E456671BA1"
Target = "[System64Folder]"
Styles = "NO_FILES"
Assignment1 = ("AdminExecuteSequence", "", "CostInitialize")
Assignment2 = ("InstallExecuteSequence", "", "CostInitialize")
Assignment3 = ("InstallUISequence", "", "CostInitialize")
[1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa367787%28v=vs.85%29.aspx
Change-Id: I2fbd37ff63298d99b2ba1b6afe6e875f56d8e378
Reviewed-on: https://gerrit.libreoffice.org/33366
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: David Ostrovsky <david@ostrovsky.org>
Diffstat (limited to 'include/unotest')
0 files changed, 0 insertions, 0 deletions