diff options
-rw-r--r-- | BuildTools/SCons/SConscript.boot | 3 | ||||
-rw-r--r-- | BuildTools/SCons/Tools/wix.py | 3 | ||||
-rw-r--r-- | DEVELOPMENT.md | 5 | ||||
-rw-r--r-- | Swift/Packaging/WiX/Swift.wxs | 143 | ||||
-rw-r--r-- | Swift/Packaging/WiX/Swift_en-us.wxl | 4 | ||||
-rw-r--r-- | Swift/QtUI/SConscript | 11 |
6 files changed, 154 insertions, 15 deletions
diff --git a/BuildTools/SCons/SConscript.boot b/BuildTools/SCons/SConscript.boot index fc943f7..c4728ff 100644 --- a/BuildTools/SCons/SConscript.boot +++ b/BuildTools/SCons/SConscript.boot @@ -10,61 +10,62 @@ vars.Add('cc', "C compiler") vars.Add('cxx', "C++ compiler") vars.Add('ccflags', "Extra C/C++/ObjC compiler flags") vars.Add('cxxflags', "Extra C++ compiler flags") vars.Add('link', "Linker") vars.Add('linkflags', "Extra linker flags") vars.Add('ar', "Archiver (ar or lib)") if os.name == "nt": vars.Add('mt', "manifest tool") vars.Add(BoolVariable("ccache", "Use CCache", "no")) vars.Add(BoolVariable("distcc", "Use distcc", "no")) vars.Add(EnumVariable("test", "Compile and run tests", "none", ["none", "all", "unit", "system"])) vars.Add(BoolVariable("optimize", "Compile with optimizations turned on", "no")) vars.Add(BoolVariable("debug", "Compile with debug information", "yes")) vars.Add(BoolVariable("allow_warnings", "Allow compilation warnings during compilation", "yes")) vars.Add(BoolVariable("assertions", "Compile with assertions", "yes")) vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no")) vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device", "xcode", "android"])) vars.Add('android_toolchain', "Path to Android toolchain") vars.Add('android_sdk_bin', "Path to Android SDK's tools directory") vars.Add(BoolVariable("swift_mobile", "Build mobile Swift", "no")) vars.Add(BoolVariable("swiften_dll", "Build Swiften as dynamically linked library", "no")) if os.name != "nt" : vars.Add(BoolVariable("coverage", "Compile with coverage information", "no")) if os.name == "posix" : vars.Add(BoolVariable("valgrind", "Run tests with valgrind", "no")) 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")) vars.Add(BoolVariable("mac106", "Link against the 10.6 frameworks", "no")) if os.name == "nt" : - vars.Add(PathVariable("vcredist", "MSVC redistributable dir", None, PathVariable.PathAccept)) + vars.Add(PathVariable("vcredist", "MSVC redistributable path", None, PathVariable.PathAccept)) + vars.Add(PathVariable("vcredistdir", "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" : vars.Add(PackageVariable("bonjour", "Bonjour SDK location", "yes")) vars.Add(EnumVariable("tls_backend", "Choose the TLS backend", "native", ["native", "openssl", "openssl_bundled"])) vars.Add(PackageVariable("openssl", "OpenSSL location", "yes")) vars.Add("openssl_libnames", "Comma-separated openssl library names to override defaults", None) vars.Add("openssl_include", "Location of OpenSSL include files (if not under (openssl)/include)", None) vars.Add("openssl_libdir", "Location of OpenSSL library files (if not under (openssl)/lib)", None) vars.Add(PackageVariable("hunspell_prefix", "Hunspell location", False)) vars.Add(BoolVariable("hunspell_enable", "Build with Hunspell support", True)) vars.Add(PathVariable("boost_includedir", "Boost headers location", None, PathVariable.PathAccept)) vars.Add(PathVariable("boost_libdir", "Boost library location", None, PathVariable.PathAccept)) vars.Add(BoolVariable("boost_bundled_enable", "Allow use of bundled Boost as last resort", "true")) vars.Add(BoolVariable("boost_force_bundled", "Force use of bundled Boost.", False)) vars.Add(PathVariable("zlib_includedir", "Zlib headers location", None, PathVariable.PathAccept)) vars.Add(PathVariable("zlib_libdir", "Zlib library location", None, PathVariable.PathAccept)) vars.Add(PathVariable("zlib_libfile", "Zlib library file (full path to file)", None, PathVariable.PathAccept)) vars.Add(BoolVariable("zlib_bundled_enable", "Allow use of bundled Zlib as last resort", "true")) vars.Add(BoolVariable("try_gconf", "Try configuring for GConf?", "true")) vars.Add(BoolVariable("try_libxml", "Try configuring for libXML?", "true")) vars.Add(BoolVariable("try_expat", "Try configuring for expat?", "true")) vars.Add(PathVariable("expat_includedir", "Expat headers location", None, PathVariable.PathAccept)) vars.Add(PathVariable("expat_libdir", "Expat library location", None, PathVariable.PathAccept)) vars.Add("expat_libname", "Expat library name", os.name == "nt" and "libexpat" or "expat") vars.Add(PackageVariable("icu", "ICU library location", "no")) vars.Add(BoolVariable("libidn_bundled_enable", "Allow use of bundled LibIDN", "true")) vars.Add(BoolVariable("try_libidn", "Try configuring for LibIDN?", "true")) vars.Add(PathVariable("libidn_includedir", "LibIDN headers location", None, PathVariable.PathAccept)) vars.Add(PathVariable("libidn_libdir", "LibIDN library location", None, PathVariable.PathAccept)) diff --git a/BuildTools/SCons/Tools/wix.py b/BuildTools/SCons/Tools/wix.py index 907b6d9..889afe4 100644 --- a/BuildTools/SCons/Tools/wix.py +++ b/BuildTools/SCons/Tools/wix.py @@ -11,41 +11,40 @@ def generate(env) : env['WIX_CANDLE'] = wixPath + 'candle.exe' env['WIX_CANDLE_OPTIONS'] = '-nologo' env['WIX_LIGHT'] = wixPath + 'light.exe' env['WIX_LIGHT_OPTIONS'] = '-nologo -ext WixUIExtension' def WiX_IncludeScanner(source, env, path, arg): wixIncludeRegexp = re.compile(r'^\s*\<\?include (\S+.wxs)\s*\?\>\S*', re.M) contents = source.get_contents() includes = wixIncludeRegexp.findall(contents) return [ "" + include for include in includes ] heat_builder = SCons.Builder.Builder( action = '"$WIX_HEAT" dir "$WIX_SOURCE_OBJECT_DIR" -cg Files $WIX_HEAT_OPTIONS -o ${TARGET} -t Swift\\Packaging\\WiX\\include.xslt', suffix = '.wxi') candle_scanner = env.Scanner(name = 'wixincludefile', function = WiX_IncludeScanner, argument = None, skeys = ['.wxs']) candle_builder = SCons.Builder.Builder( action = '"$WIX_CANDLE" $WIX_CANDLE_OPTIONS ${SOURCES} -o ${TARGET}', src_suffix = '.wxs', suffix = '.wixobj', source_scanner = candle_scanner, src_builder = heat_builder) light_builder = SCons.Builder.Builder( - action = '"$WIX_LIGHT" $WIX_LIGHT_OPTIONS -b "$WIX_SOURCE_OBJECT_DIR" ${SOURCES} -o ${TARGET}', + action = '"$WIX_LIGHT" $WIX_LIGHT_OPTIONS -b "$WIX_SOURCE_OBJECT_DIR" ${SOURCES} -loc Swift\\Packaging\\WiX\\Swift_en-us.wxl -o ${TARGET}', src_suffix = '.wixobj', src_builder = candle_builder) env['BUILDERS']['WiX_Heat'] = heat_builder env['BUILDERS']['WiX_Candle'] = candle_builder env['BUILDERS']['WiX_Light'] = light_builder def exists(env) : return True - diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 3e48510..5873300 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -19,64 +19,65 @@ Swift is written in cross-platform C++11. It is continuously tested with GCC, Cl ## Testing Swift has unit and integration tests. To run the unit tests, pass `test=unit`, and to run the integration tests, pass `test=system`, or pass `test=all` to run both. The integration tests require external setup and parameters to run. - `SWIFT_CLIENTTEST_JID=user@domain` - `SWIFT_CLIENTTEST_PASS=password` - `SWIFT_FILETRANSFERTEST_JID=user@domain` - `SWIFT_FILETRANSFERTEST_PASS=password` - `SWIFT_FILETRANSFERTEST2_JID=anotheruser@domain` - `SWIFT_FILETRANSFERTEST2_PASS=password` - `SWIFT_NETWORK_TEST_IPV4=0.0.0.0` Note: The unit and integration tests are build targets. When passing specific build targets to SCons the tests will not be build and run (even with `test=all`) unless the build targets for the tests are added as arguments to the `scons` call. ## Packaging ### Mac OS X The Mac OS X package consists of a disk image (.dmg) file containing an independently deployable **Swift.app** application bundle. For creating the Mac OS X package, i.e. the disk image, simply call `./scons.sh dist=1`. To additionally code sign the **Swift.app** application bundle, append `codesign_identity="Developer ID Application: Something here"` with your developer certificate identity to the `scons` command. **WARNING: Code signing has not been tested with third-party signed certificates yet!** ### Windows The Windows package consist of a Widnows Installer (.msi) file. This is generated using the Windows Installer XML Toolset. For packaging use: - Microsoft VS 2013 Express - WiX -- Download the C++ redistributable package from Microsoft and put it at `C:\Program Files (x86)\Common Files\Merge Modules\` +- Swift has a dependency on C++ redistributable package from Microsoft that needs to be deployed during install. If the common tools for Visual C++ is installed, then the installation file should be located under `C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\1033\` (for Visual Studio 2013). If not download from Microsoft and put it at `C:\Program Files (x86)\Common Files\Merge Modules\` - `config.py` should contain: qt = "c:\\qt\\5.4.2" - vcredist = "C:\\Program Files (x86)\\Common Files\\Merge Modules\\vcredist_x86.exe" + vcredist = "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\redist\\vcredist_x86.exe" + vcredistdir = "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\redist\\x86\Microsoft.VC120.CRT\\" debug = 1 optimize = 1 wix_bindir = "c:\\program files\\Windows Installer XML v3.5\\bin" - Run the following commands. Two scons runs are required as 'scons dist=1' requires the Swift.exe to be in place. ``` scons scons dist=1 ``` To sign the resulting MSI file, append the `signtool_key_pfx` and `signtool_timestamp_url` parameters to the `scons dist=1` programm call, e.g. `scons dist=1 signtool_key_pfx=C:\Users\Swift\SwiftSPC.pfx signtool_timestamp_url=http://timestamp.verisign.com/scripts/timstamp.dll`. Notes: - The settings `debug = 1` and `optimize = 1` are **strictly required** if you use a precompiled Qt release from the Qt Project; otherwise you will get linker errors - On 64-bit Windows it's "Program Files (x86)" instead of "Program Files" in the paths - Currently only 32-bit builds of the Swift client are supported ## Automatic Software Updates Automatic software updates allow distribution of updates directly to the end users. This is useful for general feature updates, bug fixes and especially for security updates. ### Automatic Software Updates for Mac OS X using Sparkle Swift supports integration with the software update framework [Sparkle](https://sparkle-project.org/) on OS X. For security reasons, Sparkle requires the application to be either code-signed or a bundled public DSA key. In case you do not code-sign, you can provide the path to the public DSA key to be bundled with the application bundle via the `sparkle_public_dsa_key` SCons argument. diff --git a/Swift/Packaging/WiX/Swift.wxs b/Swift/Packaging/WiX/Swift.wxs index 1e8d129..a2e8dd6 100644 --- a/Swift/Packaging/WiX/Swift.wxs +++ b/Swift/Packaging/WiX/Swift.wxs @@ -1,75 +1,202 @@ <?xml version='1.0' encoding='utf-8'?> <!-- For a sensible tutorial on WiX, see http://wix.tramontana.co.hu/tutorial --> <Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> - <?include variables.wxs ?> <Product Name='Swift' Id='*' UpgradeCode='D7F276D5-BA67-421E-817B-9E7AB4B7D2BF' Language='1033' Codepage='1252' Version='$(var.Version)' 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' InstallScope="perMachine"/> + <Package Id='*' Keywords='Installer' Description="Swift Installer" Comments="Swift is available under the GPL version 3" Manufacturer="Swift.im" InstallerVersion='500' Languages='1033' Compressed='yes' SummaryCodepage='1252' /> + <Property Id="ALLUSERS" Value="2" /> + <Property Id="MSIINSTALLPERUSER" Value="1" /> + <Property Id="WIXUIVCREDISTINSTALL" Value="0" /> + + <Property Id="VCREDISTINSTALLED"> + <RegistrySearch Id="VCREDISTINSTALLED" + Root="HKLM" + Key="SOFTWARE\Wow6432Node\Microsoft\VisualStudio\$(var.MsvcDotVersion)\VC\Runtimes\$(sys.BUILDARCH)" + Name="Installed" + Type="raw" /> + + </Property> <Media Id='1' Cabinet='Swift.cab' EmbedCab='yes'/> <!-- Schedule the upgrade to afterInstallExecute means that MSI will first install the new version over the existing version and run the uninstall of the old version afterwards. This way shortcuts are not recreated on every new installation and pinned shortcuts stay alive. However this requires that the components for installed files with the same filename will always - have the same GUID (do not run heat.exe with -gg flag) or else when MSI removes the components + have the same GUID (do not run heat.exe with -gg flag) or else when MSI removes the components of the old version with the same filename as components of the new version it will delete the files that belong to components of the new version.--> <MajorUpgrade Schedule="afterInstallExecute" DowngradeErrorMessage="A newer version is already installed. Remove this version if you wish to downgrade." /> <Directory Id='TARGETDIR' Name='SourceDir'> <!-- Disabling CRT merge module, because it's not working <Merge Id="CRT" DiskId="1" Language="0" SourceFile="$(var.VCCRTFile)"/> --> <Directory Id='ProgramFilesFolder' Name='PFiles'> + <Directory Id="APPLICATIONFOLDER" Name="Swift"> + </Directory> + <!--<Directory Id='INSTALLDIR' Name='Swift'> </Directory>--> </Directory> <Directory Id="ProgramMenuFolder" Name="Programs"> <Directory Id="ProgramMenuDir" Name="Swift"> <Component Id="Shortcuts" Guid="D3BB9B0A-5D14-4920-B127-7CCD2D57BFB0"> <RemoveFolder Id='ProgramMenuDir' On='uninstall' /> <RegistryValue Root='HKCU' Key='Software\Swift\Swift' Type='string' Value='' KeyPath='yes' /> <Shortcut Id='SwiftShortcut' Directory='ProgramMenuDir' Name='Swift' Target="[INSTALLDIR]\Swift.exe" Icon='Swift.exe'/> </Component> </Directory> </Directory> <Directory Id="DesktopFolder" Name="Desktop" /> </Directory> + <Property Id="WixAppFolder" Value="WixPerUserFolder" /> + <Feature Id='Core' Level='1' Title='Swift' Description='All necessary Swift files' Display='expand' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no' Absent='disallow'> <ComponentGroupRef Id='Files' /> + <ComponentGroupRef Id='VCFiles' /> <!--<ComponentRef Id='Manual' />--> </Feature> <Feature Id='Shortcut' Level='1' Title='Shortcut' Description='Start Menu Shortcut' Display='expand' ConfigurableDirectory='INSTALLDIR' AllowAdvertise='no'> <ComponentRef Id='Shortcuts' /> </Feature> <!--<UIRef Id='WixUI_Advanced'/>--> <!--<UIRef Id="WixUI_Minimal"/>--> - <UIRef Id="WixUI_Mondo"/> + <!--UIRef Id="WixUI_Mondo"/--> + <UIRef Id="WixUI_Swift"/> + <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 --> - <!-- - VC Redistributable + <!-- + VC Redistributable --> <Binary Id="CRTBinary" SourceFile="$(var.VCCRTFile)"/> <CustomAction Id="CRTAction" Impersonate="no" Return="asyncNoWait" Execute="deferred" BinaryKey="CRTBinary" ExeCommand="/passive"/> - + <InstallUISequence> + <!-- Suppress FindRelatedProducts untill the user selects the scope of the install --> + <FindRelatedProducts Suppress="yes" /> + </InstallUISequence> <InstallExecuteSequence> - <Custom Action='CRTAction' After='InstallInitialize'/> + <Custom Action='CRTAction' After='InstallInitialize'>(NOT VCREDISTINSTALLED AND ALLUSERS = 1) OR WIXUIVCREDISTINSTALL = 1</Custom> </InstallExecuteSequence> </Product> + <Fragment> + <DirectoryRef Id="INSTALLDIR"> + <Component Id="msvcp.dll" Guid="*"> + <Condition>(NOT (VCREDISTINSTALLED OR ALLUSERS = 1)) AND WIXUIVCREDISTINSTALL = 0 </Condition> + <File Id="msvcp$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\msvcp$(var.MsvcVersion).dll" /> + </Component> + <Component Id="vcruntime.dll" Guid="*"> + <Condition>(NOT (VCREDISTINSTALLED OR ALLUSERS = 1)) AND WIXUIVCREDISTINSTALL = 0 </Condition> + <?if $(var.MsvcVersion) > "120"?> + <File Id="vcruntime$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\vcruntime$(var.MsvcVersion).dll" /> + <?else?> + <File Id="msvcr$(var.MsvcVersion).dll" KeyPath="yes" Source="$(var.VCCRTPath)\msvcr$(var.MsvcVersion).dll" /> + <?endif?> + </Component> + </DirectoryRef> + </Fragment> + <Fragment> + <ComponentGroup Id="VCFiles"> + <ComponentRef Id="msvcp.dll" /> + <ComponentRef Id="vcruntime.dll" /> + </ComponentGroup> + </Fragment> + <Fragment> + + <WixVariable Id="WixUISupportPerUser" Value="1" Overridable="yes" /> + <WixVariable Id="WixUISupportPerMachine" Value="1" Overridable="yes" /> + + <!-- This is Based on WixUI_Mondo, but it adds an InstallScopeDlg dialog --> + <UI Id="WixUI_Swift"> + <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> + <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> + <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> + + <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> + <Property Id="WixUI_Mode" Value="Mondo" /> + + <DialogRef Id="ErrorDlg" /> + <DialogRef Id="FatalError" /> + <DialogRef Id="FilesInUse" /> + <DialogRef Id="MsiRMFilesInUse" /> + <DialogRef Id="PrepareDlg" /> + <DialogRef Id="ProgressDlg" /> + <DialogRef Id="ResumeDlg" /> + <DialogRef Id="UserExit" /> + + <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> + + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed AND NOT PATCH</Publish> + <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> + + <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> + <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="InstallScopeDlg" Order="2">LicenseAccepted = "1"</Publish> + + <Publish Dialog="InstallScopeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> + <!-- override default WixAppFolder of WixPerMachineFolder as standard user won't be shown the radio group to set WixAppFolder --> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="WixAppFolder" Value="WixPerUserFolder" Order="1">!(wix.WixUISupportPerUser) AND NOT Privileged</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="{}" Order="2">WixAppFolder = "WixPerUserFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="ALLUSERS" Value="1" Order="3">WixAppFolder = "WixPerMachineFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerUserFolder]" Order="4">WixAppFolder = "WixPerUserFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Property="APPLICATIONFOLDER" Value="[WixPerMachineFolder]" Order="5">WixAppFolder = "WixPerMachineFolder"</Publish> + <Publish Dialog="InstallScopeDlg" Control="Next" Event="NewDialog" Value="SetupTypeDlg">1</Publish> + <!-- After selecting the scope of the installation, run FindRelatedProducts to find previous versions that needs upgrading --> + <Publish Dialog="InstallScopeDlg" Control="Next" Event="DoAction" Value="FindRelatedProducts" Order="6">1</Publish> + + <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="InstallScopeDlg">1</Publish> + <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VCResdistDialog">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VCResdistDialog">NOT VCREDISTINSTALLED AND NOT ALLUSERS </Publish> + <Publish Dialog="SetupTypeDlg" Control="TypicalButton" Event="NewDialog" Value="VerifyReadyDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + <Publish Dialog="SetupTypeDlg" Control="CustomButton" Event="NewDialog" Value="CustomizeDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + <Publish Dialog="SetupTypeDlg" Control="CompleteButton" Event="NewDialog" Value="VerifyReadyDlg">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + + <Dialog Id="VCResdistDialog" Width="260" Height="85" Title="[ProductName] Setup"> + <Control Id="VcRredistNo" Type="PushButton" X="132" Y="57" Width="56" Height="17" Default="yes" Cancel="yes" Text="!(loc.WixUINo)"> + <Publish Property="WIXUIVCREDISTINSTALL" Value="0">1</Publish> + <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + </Control> + <Control Id="VcRredistYes" Type="PushButton" X="72" Y="57" Width="56" Height="17" Text="!(loc.WixUIYes)"> + <Publish Property="WIXUIVCREDISTINSTALL" Value="1">1</Publish> + <Publish Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + </Control> + <Control Id="Text" Type="Text" X="48" Y="15" Width="194" Height="30" NoPrefix="yes" Text="Visual Studio redistributables installation was not found on your computer. Would you like Swift to install them?" /> + <Control Id="Icon" Type="Icon" X="15" Y="15" Width="24" Height="24" ToolTip="!(loc.CancelDlgIconTooltip)" FixedSize="yes" IconSize="32" Text="!(loc.CancelDlgIcon)" /> + </Dialog> + + <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish> + <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VCResdistDialog" Order="1">NOT VCREDISTINSTALLED AND NOT ALLUSERS</Publish> + <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="2">VCREDISTINSTALLED OR ALLUSERS = 1</Publish> + + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "InstallCustom"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="3">WixUI_InstallMode = "Change"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> + <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">WixUI_InstallMode = "Update"</Publish> + + <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> + + <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> + <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> + </UI> + <UIRef Id="WixUI_Common" /> + </Fragment> </Wix> diff --git a/Swift/Packaging/WiX/Swift_en-us.wxl b/Swift/Packaging/WiX/Swift_en-us.wxl new file mode 100644 index 0000000..780b290 --- /dev/null +++ b/Swift/Packaging/WiX/Swift_en-us.wxl @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization"> + <String Id="InstallScopeDlgPerUserDescription">[ProductName] will be installed in a user folder and auto-updates will be enabled. The application be installed only for your user and you do not need to be an Administrator. </String> +</WixLocalization> diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript index ff97b42..77731df 100644 --- a/Swift/QtUI/SConscript +++ b/Swift/QtUI/SConscript @@ -30,61 +30,61 @@ myenv.UseFlags(env["SWIFT_CONTROLLERS_FLAGS"]) myenv.UseFlags(env["SWIFTOOLS_FLAGS"]) if myenv["HAVE_XSS"] : myenv.UseFlags(env["XSS_FLAGS"]) if env["PLATFORM"] == "posix" : myenv.Append(LIBS = ["X11"]) if myenv["HAVE_SPARKLE"] : myenv.UseFlags(env["SPARKLE_FLAGS"]) myenv.UseFlags(env["SWIFTEN_FLAGS"]) myenv.UseFlags(env["SWIFTEN_DEP_FLAGS"]) if myenv.get("HAVE_BREAKPAD") : myenv.UseFlags(env["BREAKPAD_FLAGS"]) if myenv.get("HAVE_GROWL", False) : myenv.UseFlags(myenv["GROWL_FLAGS"]) myenv.Append(CPPDEFINES = ["HAVE_GROWL"]) if myenv["swift_mobile"] : myenv.Append(CPPDEFINES = ["SWIFT_MOBILE"]) if myenv.get("HAVE_HUNSPELL", True): myenv.Append(CPPDEFINES = ["HAVE_HUNSPELL"]) myenv.UseFlags(myenv["HUNSPELL_FLAGS"]) if env["PLATFORM"] == "win32" : myenv.Append(LIBS = ["cryptui"]) myenv.UseFlags(myenv["PLATFORM_FLAGS"]) myenv.Tool("qt4", toolpath = ["#/BuildTools/SCons/Tools"]) myenv.Tool("nsis", toolpath = ["#/BuildTools/SCons/Tools"]) myenv.Tool("wix", toolpath = ["#/BuildTools/SCons/Tools"]) myenv.Tool("textfile", toolpath = ["#/BuildTools/SCons/Tools"]) qt4modules = ['QtCore', 'QtWebKit', 'QtGui'] if myenv["qt5"] : qt_version = '5' - # QtSvg is required so the image format plugin for SVG images is installed + # QtSvg is required so the image format plugin for SVG images is installed # correctly by Qt's deployment tools. qt4modules += ['QtWidgets', 'QtWebKitWidgets', 'QtMultimedia', 'QtSvg'] if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" : qt4modules += ['QtX11Extras'] else : qt_version = '4' if env["PLATFORM"] == "posix" : qt4modules += ["QtDBus"] if env["PLATFORM"] != "win32" and env["PLATFORM"] != "darwin" : qt4modules += ["QtNetwork"] myenv.EnableQt4Modules(qt4modules, debug = False, version = qt_version) ## Qt related unit tests testQtEnv = env.Clone(); testQtEnv.Tool("qt4", toolpath = ["#/BuildTools/SCons/Tools"]) testQtEnv.EnableQt4Modules(qt4modules, debug = False, version = qt_version) env["SWIFT_QTUI_TEST_FLAGS"] = {} for key in ["CCFLAGS", "CPPFLAGS", "CPPPATH", "CPPDEFINES", "LIBS", "LINKFLAGS", "LIBPATH"] : if key in testQtEnv: env["SWIFT_QTUI_TEST_FLAGS"][key] = testQtEnv[key] env.Append(UNITTEST_SOURCES = [ File("UnitTest/QtUtilitiesTest.cpp") ]) myenv.Append(CPPPATH = ["."]) # Qt requires applications to be build with the -fPIC flag on some 32-bit Linux distributions. @@ -451,52 +451,59 @@ if env["PLATFORM"] == "win32" : resources = commonResources, qtplugins = qtplugins, qtlibs = qtlibs, qtversion = qt_version) if env["DIST"] : #myenv.Append(NSIS_OPTIONS = [ # "/DmsvccRedistributableDir=\"" + env["vcredist"] + "\"", # "/DbuildVersion=" + myenv["SWIFT_VERSION"] # ]) #myenv.Nsis("../Packaging/nsis/swift.nsi") if env["SCONS_STAGE"] == "build" and env.get("wix_bindir", None): 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;}\\fs16\\f0\\pard\n') for line in infile: for char in line.decode("utf-8") : if ord(char) > 127 : # FIXME: This is incorrect, because it only works for latin1. # The correct way is \u<decimal utf16 point>? , but this is more # work outfile.write("\\'%X" % ord(char)) else : outfile.write(char) outfile.write('\\par ') outfile.write('}') outfile.close() infile.close() copying = env.Command(["Swift/COPYING.rtf"], ["COPYING"], convertToRTF) + if env.get("vcredistdir", "") : + vcredistdir = os.path.dirname(env["vcredistdir"]) + else: + vcredistdir = os.path.dirname(env["vcredist"])+"\\..\\" + ("x86" if env["win_target_arch"] == "x86" else "x64") + "\\Microsoft.VC"+env.get("MSVC_VERSION", "").replace(".","")[:3]+".CRT\\" wixvariables = { 'VCCRTFile': env["vcredist"], - 'Version': str(myenv["SWIFT_VERSION_MAJOR"]) + "." + str(myenv["SWIFT_VERSION_MINOR"]) + "." + str(myenv["SWIFT_VERSION_PATCH"]) + 'VCCRTPath': vcredistdir, + 'Version': str(myenv["SWIFT_VERSION_MAJOR"]) + "." + str(myenv["SWIFT_VERSION_MINOR"]) + "." + str(myenv["SWIFT_VERSION_PATCH"]), + 'MsvcVersion': str(env.get("MSVC_VERSION", "").replace(".","")[:3]), + 'MsvcDotVersion': str(env.get("MSVC_VERSION", "")[:4]) } wixincludecontent = "<Include>" for key in wixvariables: wixincludecontent += "<?define %s = \"%s\" ?>" % (key, wixvariables[key]) wixincludecontent += "</Include>" myenv.WriteVal("..\\Packaging\\Wix\\variables.wxs", env.Value(wixincludecontent)) myenv["WIX_SOURCE_OBJECT_DIR"] = "Swift\\QtUI\\Swift" myenv.WiX_Heat('..\\Packaging\\WiX\\gen_files.wxs', windowsBundleFiles + copying) myenv.WiX_Candle('..\\Packaging\\WiX\\Swift.wixobj', '..\\Packaging\\WiX\\Swift.wxs') myenv.WiX_Candle('..\\Packaging\\WiX\\gen_files.wixobj', '..\\Packaging\\WiX\\gen_files.wxs') lightTask = myenv.WiX_Light('#/Packages/Swift/Swift-' + myenv["SWIFT_VERSION"] + '.msi', ['..\\Packaging\\WiX\\gen_files.wixobj','..\\Packaging\\WiX\\Swift.wixobj']) if myenv.get("SIGNTOOL_KEY_PFX", None) and myenv.get("SIGNTOOL_TIMESTAMP_URL", None) : def signToolAction(target = None, source = None, env = None): env.Execute('signtool.exe sign /fd SHA256 /f "${SIGNTOOL_KEY_PFX}" /t "${SIGNTOOL_TIMESTAMP_URL}" ' + str(target[0])) myenv.AddPostAction(lightTask, signToolAction) if myenv["debug"] : myenv.InstallAs('#/Packages/Swift/Swift-' + myenv["SWIFT_VERSION"] + '.pdb', "Swift.pdb") |