From 2fb37ba9d088e0027560a7d4b2b0617043569d55 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be>
Date: Tue, 24 Apr 2012 19:47:32 +0200
Subject: WiX updates.

Show icon in Add/Remove programs dialog.
Support upgrading.
Render COPYING file correctly.

Resolves: #1096, #1094, #1093

diff --git a/.gitignore b/.gitignore
index a2d377d..821abf0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -46,3 +46,8 @@ cppcheck.log
 *.sublime-workspace
 /xmppbench
 /.metadata
+/Swift/Packaging/WiX/*.msi
+/Swift/Packaging/WiX/*.wixpdb
+/Swift/Packaging/WiX/*.wixobj
+/Swift/Packaging/WiX/gen_files.wxs
+/Swift/Packaging/WiX/variables.wxs
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot
index f7956b5..a3a5c6d 100644
--- a/BuildTools/SCons/SConscript.boot
+++ b/BuildTools/SCons/SConscript.boot
@@ -30,7 +30,7 @@ if os.name == "mac" or (os.name == "posix" and os.uname()[0] == "Darwin"):
 	vars.Add(BoolVariable("universal", "Create universal binaries", "no"))
 	vars.Add(BoolVariable("mac105", "Link against the 10.5 frameworks", "no"))
 if os.name == "nt" :
-	vars.Add(PathVariable("vcredist", "MSVC redistributable dir", "", PathVariable.PathAccept))
+	vars.Add(PathVariable("vcredist", "MSVC redistributable dir", None, PathVariable.PathAccept))
 if os.name == "nt" :
 	vars.Add(PathVariable("wix_bindir", "Path to WiX binaries", "", PathVariable.PathAccept))
 if os.name == "nt" :
diff --git a/Swift/Packaging/WiX/Swift.wxs b/Swift/Packaging/WiX/Swift.wxs
index 7ac96d5..e811746 100644
--- a/Swift/Packaging/WiX/Swift.wxs
+++ b/Swift/Packaging/WiX/Swift.wxs
@@ -6,10 +6,11 @@
 
 	<?include variables.wxs ?>
 
-	<Product Name='Swift' Id='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF' UpgradeCode='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF' Language='1033' Codepage='1252' Version='0.0.1' Manufacturer='Swift.im'>
+	<Product Name='Swift' Id='*' UpgradeCode='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF' Language='1033' Codepage='1252' Version='0.0.1' Manufacturer='Swift.im'>
 		<Package Id='*' Keywords='Installer' Description="Swift Installer" Comments="Swift is available under the GPL version 3" Manufacturer="Swift.im" InstallerVersion='300' Languages='1033' Compressed='yes' SummaryCodepage='1252'/>
 		<Media Id='1' Cabinet='Swift.cab' EmbedCab='yes'/>
 
+		<MajorUpgrade DowngradeErrorMessage="A newer version is already installed. Remove this version if you wish to downgrade." />
 		<!--<Upgrade Id='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF'>
 			<UpgradeVersion OnlyDetect='no' Property='PREVIOUSFOUND' 
 				Minimum='0.0.1' IncludeMinimum='yes'
@@ -60,7 +61,6 @@
 	    <WixVariable Id='WixUILicenseRtf' Value='COPYING.rtf'/>
 
 	    <Icon Id="Swift.exe" SourceFile="Swift.exe" />
-
-	    
+			<Property Id="ARPPRODUCTICON" Value="Swift.exe"/> <!-- The icon in the "Programs" dialog -->
 	</Product>
-</Wix>
\ No newline at end of file
+</Wix>
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 0313f1e..ea13b8d 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -285,7 +285,7 @@ if env["PLATFORM"] == "win32" :
       def convertToRTF(env, target, source) :
         infile = open(source[0].abspath, 'r')
         outfile = open(target[0].abspath, 'w')
-        outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\f0\\pard\n')
+        outfile.write('{\\rtf1\\ansi{\\fonttbl\\f0\\fswiss Helvetica;}\\fs16\\f0\\pard\n')
         for line in infile:
           for char in line.decode("utf-8") :
             if ord(char) > 127 :
@@ -295,7 +295,7 @@ if env["PLATFORM"] == "win32" :
               outfile.write("\\'%X" % ord(char)) 
             else :
               outfile.write(char)
-          outfile.write('\\par')
+          outfile.write('\\par ')
         outfile.write('}')
         outfile.close()
         infile.close()
-- 
cgit v0.10.2-6-g49f6