-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for Windows x64 builds (WiX Heat ATLHarvester support) #145
Open
N3X15
wants to merge
1
commit into
firebreath:master
Choose a base branch
from
N3X15:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ src/libs/openssl/openssl | |
.kdev* | ||
tags | ||
bin | ||
*.bak |
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:fn="http://www.w3.org/2005/xpath-functions" | ||
xmlns:w="http://schemas.microsoft.com/wix/2006/wi"> | ||
|
||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> | ||
|
||
<!-- Identity template --> | ||
<xsl:template match="@* | node()"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@* | node()" /> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<xsl:template match="/w:Wix" > | ||
<w:Wix> | ||
<xsl:apply-templates select="w:Fragment" /> | ||
</w:Wix> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:Fragment" > | ||
<w:Fragment> | ||
<xsl:apply-templates select="w:DirectoryRef" /> | ||
<xsl:apply-templates select="w:ComponentGroup"/> | ||
</w:Fragment> | ||
</xsl:template> | ||
|
||
<xsl:template match="/w:Wix/w:Fragment/w:DirectoryRef"> | ||
<w:DirectoryRef Id="{@Id}" /> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:Component"> | ||
<w:Component Id="{@Id}" Guid="{@Guid}" Directory="{@Directory}"> | ||
<!-- http://stackoverflow.com/questions/22932942/wix-heat-exe-win64-components-win64-yes --> | ||
<xsl:attribute name="Win64">yes</xsl:attribute> | ||
<xsl:apply-templates select="w:File" /> | ||
<xsl:apply-templates select="w:ProgId" /> | ||
<xsl:apply-templates select="w:RegistryValue" /> | ||
</w:Component> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:TypeLib"> | ||
<w:TypeLib Id="{@Id}" Description="{@Description}" HelpDirectory="{@HelpDirectory}" Language="{@Language}" MajorVersion="{@MajorVersion}" MinorVersion="{@MinorVersion}"> | ||
<xsl:apply-templates select="*" /> | ||
</w:TypeLib> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:File"> | ||
<w:File Id="{@Id}" Source="{@Source}"> | ||
<xsl:apply-templates select="w:TypeLib" /> | ||
</w:File> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:RegistryValue"> | ||
<w:RegistryValue Key="{@Key}" Value="{@Value}" Type="{@Type}" Action="{@Action}"> | ||
<xsl:if test="@Name != ''"> <xsl:attribute name="Name"> <xsl:value-of select="@Name" /> </xsl:attribute> </xsl:if> | ||
<xsl:if test="@Id != ''"> <xsl:attribute name="Id"> <xsl:value-of select="@Id" /> </xsl:attribute> </xsl:if> | ||
<xsl:choose> | ||
<xsl:when test="@Root='HKLM'"> | ||
<xsl:attribute name="Root">HKCU</xsl:attribute> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:attribute name="Root"><xsl:value-of select="@Root" /></xsl:attribute> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:if test="@Name = 'Path'"> | ||
<xsl:attribute name="KeyPath">yes</xsl:attribute> | ||
</xsl:if> | ||
</w:RegistryValue> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:ComponentGroup"> | ||
<w:ComponentGroup Id="{@Id}"> | ||
<xsl:apply-templates select="w:Component"/> | ||
<!-- Intersection in XSLT 1.0 (Michael Kay) --> | ||
</w:ComponentGroup> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:ComponentRef"> | ||
<w:ComponentRef Id="{@Id}"/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
0
cmake/FixFragment_HKCU.xslt → cmake/FixFragment_HKCU_x86.xslt
100755 → 100644
File renamed without changes.
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,85 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
xmlns:fn="http://www.w3.org/2005/xpath-functions" | ||
xmlns:w="http://schemas.microsoft.com/wix/2006/wi"> | ||
|
||
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> | ||
|
||
<!-- Identity template --> | ||
<xsl:template match="@* | node()"> | ||
<xsl:copy> | ||
<xsl:apply-templates select="@* | node()" /> | ||
</xsl:copy> | ||
</xsl:template> | ||
|
||
<xsl:template match="/w:Wix" > | ||
<w:Wix> | ||
<xsl:apply-templates select="w:Fragment" /> | ||
</w:Wix> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:Fragment" > | ||
<w:Fragment> | ||
<xsl:apply-templates select="w:DirectoryRef" /> | ||
<xsl:apply-templates select="w:ComponentGroup"/> | ||
</w:Fragment> | ||
</xsl:template> | ||
|
||
<xsl:template match="/w:Wix/w:Fragment/w:DirectoryRef"> | ||
<w:DirectoryRef Id="{@Id}" /> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:Component"> | ||
<w:Component Id="{@Id}" Guid="{@Guid}" Directory="{@Directory}"> | ||
<!-- http://stackoverflow.com/questions/22932942/wix-heat-exe-win64-components-win64-yes --> | ||
<xsl:attribute name="Win64">yes</xsl:attribute> | ||
<xsl:apply-templates select="w:File" /> | ||
<xsl:apply-templates select="w:ProgId" /> | ||
<xsl:apply-templates select="w:RegistryValue" /> | ||
</w:Component> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:TypeLib"> | ||
<w:TypeLib Id="{@Id}" Description="{@Description}" HelpDirectory="{@HelpDirectory}" Language="{@Language}" MajorVersion="{@MajorVersion}" MinorVersion="{@MinorVersion}"> | ||
<xsl:apply-templates select="*" /> | ||
</w:TypeLib> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:File"> | ||
<w:File Id="{@Id}" Source="{@Source}"> | ||
<xsl:apply-templates select="w:TypeLib" /> | ||
</w:File> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:RegistryValue"> | ||
<w:RegistryValue Key="{@Key}" Value="{@Value}" Type="{@Type}" Action="{@Action}"> | ||
<xsl:if test="@Name != ''"> <xsl:attribute name="Name"> <xsl:value-of select="@Name" /> </xsl:attribute> </xsl:if> | ||
<xsl:if test="@Id != ''"> <xsl:attribute name="Id"> <xsl:value-of select="@Id" /> </xsl:attribute> </xsl:if> | ||
<xsl:choose> | ||
<xsl:when test="@Root='HKCU'"> | ||
<xsl:attribute name="Root">HKLM</xsl:attribute> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:attribute name="Root"><xsl:value-of select="@Root" /></xsl:attribute> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
<xsl:if test="@Name = 'Path'"> | ||
<xsl:attribute name="KeyPath">yes</xsl:attribute> | ||
</xsl:if> | ||
</w:RegistryValue> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:ComponentGroup"> | ||
<w:ComponentGroup Id="{@Id}"> | ||
<xsl:apply-templates select="w:Component"/> | ||
<!-- Intersection in XSLT 1.0 (Michael Kay) --> | ||
</w:ComponentGroup> | ||
</xsl:template> | ||
|
||
<xsl:template match="w:ComponentRef"> | ||
<w:ComponentRef Id="{@Id}"/> | ||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
''' | ||
Fixes WiX installer files autogenerated by Heat in ATLCOM mode. | ||
|
||
@author: Rob "N3X15" Nelson <[email protected]> | ||
''' | ||
import argparse, re, sys, os | ||
|
||
from lxml import etree | ||
|
||
wix_xmlns = { | ||
'w':"http://schemas.microsoft.com/wix/2006/wi", | ||
'xs':"http://www.w3.org/2001/XMLSchema", | ||
'fn':"http://www.w3.org/2005/xpath-functions" | ||
} | ||
def FixWix(infile, outfile): | ||
tree = None | ||
with open(infile,'r') as f: | ||
tree = etree.parse(f) | ||
for wComponent in tree.xpath('//w:Component', namespaces=wix_xmlns): | ||
#Directory="dir99DE416F55C8960850D5A4FCA3758AD4" | ||
if wComponent.get("Directory").startswith("dir"): | ||
wComponent.set("Directory","TARGETDIR") | ||
print('>>> Fixed {}: Directory="TARGETDIR"'.format(tree.getpath(wComponent))) | ||
|
||
for wFile in tree.xpath('//w:File', namespaces=wix_xmlns): | ||
#Source="SourceDir\Release\npHWLink.dll" | ||
if wFile.get("Source").startswith("SourceDir"): | ||
source = wFile.get("Source") | ||
# Source="$(var.BINSRC)\npHWLink.dll" | ||
wFile.set("Source","$(var.BINSRC)\\" + source.split('\\')[-1]) | ||
print('>>> Fixed {}: Source="{}"'.format(tree.getpath(wFile),wFile.get("Source"))) | ||
|
||
with open(outfile,'w') as f: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please change it to 'wb' instead |
||
f.write(etree.tostring(tree,pretty_print=True)) | ||
if __name__ == '__main__': | ||
argp = argparse.ArgumentParser() | ||
argp.add_argument('input',type=str,help="Output WXS file.") | ||
argp.add_argument('output',type=str,help="Output WXS file.") | ||
args = argp.parse_args() | ||
FixWix(args.input, args.output) |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change it to 'rb' instead.