Skip to content

Commit

Permalink
Simplified the discovery of the WiX path.
Browse files Browse the repository at this point in the history
Thanks to @denfromufa for the tip.
  • Loading branch information
freakboy3742 committed Jun 25, 2017
1 parent 0d92dfa commit 5e45795
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions briefcase/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,35 +110,29 @@ def walk_dir(path, depth=0):
template.write('%s\n' % line)

print(" * Looking for WiX Toolset...")
candidates = []
for pfile in ['C:/Program Files', 'C:/Program Files (x86)']:
for dirname in os.listdir(pfile):
full_path = os.path.abspath(os.path.join(pfile, dirname))
if os.path.isdir(full_path) and dirname.startswith('WiX Toolset'):
candidates.append(full_path)
try:
wix_path = sorted(candidates)[-1]
except IndexError:
wix_path = os.getenv('WIX')
if not wix_path:
print("Couldn't find WiX Toolset. Please visit:")
print()
print(" http://wixtoolset.org/releases/")
print()
print("and install the latest stable release.")
sys.exit(-2)
else:
print(" - Using %s" % wix_path)

print(" - Using %s" % full_path)
print(" * Compiling application installer...")
subprocess.Popen(
[
"%s/bin/candle" % wix_path,
os.path.join(wix_path, 'bin', 'candle'),
"briefcase.wxs"
],
cwd=os.path.abspath(self.dir)
).wait()
print(" * Linking application installer...")
subprocess.Popen(
[
"%s/bin/light" % wix_path,
os.path.join(wix_path, 'bin', 'light'),
"-ext", "WixUIExtension",
"-o", "%s-%s.msi" % (self.formal_name, self.version),
"briefcase.wixobj"
Expand Down

0 comments on commit 5e45795

Please sign in to comment.