-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows installer: Generate WiX includes for bundled files.
- Loading branch information
1 parent
d20b704
commit afa8337
Showing
9 changed files
with
111 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
/target | ||
/tests/*/output.txt | ||
/tests/ui/*/output.txt | ||
/wix/full-licenses | ||
/wix/dll-components.wxi | ||
/wix/dll-references.wxi | ||
/wix/license-components.wxi | ||
/wix/license-references.wxi | ||
/wix/LICENSE-packetry.txt | ||
/wix/LICENSE-static-libraries.txt | ||
/wix/LICENSE-dynamic-libraries.txt | ||
/vcpkg |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from contextlib import redirect_stdout | ||
import os | ||
|
||
dll_components = open('wix/dll-components.wxi', 'w') | ||
dll_references = open('wix/dll-references.wxi', 'w') | ||
license_components = open('wix/license-components.wxi', 'w') | ||
license_references = open('wix/license-references.wxi', 'w') | ||
|
||
output_files = [ | ||
dll_components, | ||
dll_references, | ||
license_components, | ||
license_references | ||
] | ||
|
||
for file in output_files: | ||
print("<Include>", file=file) | ||
|
||
bin_dir = '$(env.VCPKG_INSTALLED_DIR)/x64-windows/bin' | ||
|
||
for line in open('wix/required-dlls.txt', 'r'): | ||
filename, guid = line.rstrip().split(' ') | ||
component = filename.replace('-', '_') | ||
with redirect_stdout(dll_components): | ||
print(f" <Component Id='{component}' Guid='{guid}'>") | ||
print(f" <File Id='{component}'") | ||
print(f" Name='{filename}'") | ||
print(f" DiskId='1'") | ||
print(f" Source='{bin_dir}/{filename}'/>") | ||
print(f" </Component>") | ||
with redirect_stdout(dll_references): | ||
print(f" <ComponentRef Id='{component}'/>") | ||
|
||
for filename in os.listdir('wix/full-licenses'): | ||
component = filename.replace('-', '_') | ||
with redirect_stdout(license_components): | ||
print(f" <Component Id='{component}' Guid='*'>") | ||
print(f" <File Id='{component}'") | ||
print(f" Name='{filename}'") | ||
print(f" DiskId='1'") | ||
print(f" Source='wix/full-licenses/{filename}'/>") | ||
print(f" </Component>") | ||
with redirect_stdout(license_references): | ||
print(f" <ComponentRef Id='{component}'/>") | ||
|
||
for file in output_files: | ||
print("</Include>", file=file) |
Oops, something went wrong.