Skip to content

Commit d8ca83f

Browse files
committed
add .gitignore, Readme and license
1 parent 5e44b1f commit d8ca83f

File tree

5 files changed

+87
-2
lines changed

5 files changed

+87
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vs/
2+
Debug/
3+
Release/

CreateEmbedLangTransform.sln

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.6.33712.159
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CreateEmbedLangTransform", "CreateEmbedLangTransform\CreateEmbedLangTransform.vcxproj", "{A2FA3A92-E08B-4593-A042-B3F693B2AF53}"
77
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{56C4810E-1A32-4D4B-82F4-FF97596B52CB}"
9+
ProjectSection(SolutionItems) = preProject
10+
LICENSE.txt = LICENSE.txt
11+
Readme.md = Readme.md
12+
EndProjectSection
13+
EndProject
814
Global
915
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1016
Debug|Win32 = Debug|Win32
@@ -19,4 +25,7 @@ Global
1925
GlobalSection(SolutionProperties) = preSolution
2026
HideSolutionNode = FALSE
2127
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {66BA9CFA-3945-4178-B876-314F0FF97F05}
30+
EndGlobalSection
2231
EndGlobal

CreateEmbedLangTransform/main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/*
2+
* Copyright 2016-2023, RISC Software GmbH. All rights reserved.
3+
* Distributed under the terms of the MIT License.
4+
*
5+
* Authors:
6+
* Joachim Mairböck <joachim.mairboeck@risc-software.at>
7+
*/
8+
19
#include <Windows.h>
210
#include <tchar.h>
311
#include <MsiQuery.h>

LICENSE.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2016-2023 RISC Software GmbH
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19+
SOFTWARE.

Readme.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CreateEmbedLangTransform
2+
3+
CreateEmbedLangTransform is a tool for post-processing Windows Installer packages to create a single multi-lingual package from multiple individual packages, as they are created by the [WiX Toolset](https://wixtoolset.org/).
4+
5+
This could also be done using a combination of a few scripts from the Windows Installer SDK. This combines that task into a single C++ command line tool using the Windows Installer database API.
6+
7+
## Usage
8+
9+
The tool takes 3 command line arguments:
10+
11+
```bat
12+
CreateEmbedLangTransform.exe <target-and-reference-msi> <source-msi> <language-identifier>
13+
```
14+
15+
Example:
16+
17+
To embed the German translation into an English installer, call the tool like this:
18+
19+
```bat
20+
CreateEmbedLangTransform.exe Setup.msi Setup_de-de.msi 1031
21+
```
22+
23+
For a WiX MSBuild project (.wixproj), the following can be added as post-build event:
24+
25+
```bat
26+
rem Copy the English installer into a language-neutral folder. It will become the multilingual one.
27+
copy en-us\$(TargetFileName) .
28+
29+
rem Create and embed the German transform into the final installer.
30+
CreateEmbedLangTransform.exe $(TargetFileName) de-de\$(TargetFileName) 1031
31+
32+
rem Other languages can be added by multiple invocations of CreateEmbedLangTransform.
33+
```
34+
35+
## What this does
36+
37+
1. The tool creates a Windows Installer transform as the difference between the first and second argument and stores it as a temporary file (equivalent to the `WiGenXfm.vbs` script from the Windows Installer SDK).
38+
1. It embeds the transform as a substorage under the name equal to the language ID (the third argument) (equivalent to the `WiSubStg.vbs` script).
39+
1. To support WiX v.4, the tool also adds the language ID to the Summary information property "Template" if it isn't already, so that the MSI package is recognized as multilingual by Windows Installer (equivalent to the `WiLangId.vbs` script).
40+
1. The temporary file created in step 1 is deleted again.
41+
42+
**Note:** This is an *undocumented* feature of Windows Installer. It is therefore not officially supported by Microsoft, and not supported by WiX!
43+
44+
## Building
45+
46+
The tool is currently built with Visual Studio 2022. It requires the "C++ Desktop" workload. It can probably be built with older versions as long as C++17 is supported.

0 commit comments

Comments
 (0)