├── .gitignore ├── .gitmodules ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── etc └── README.md ├── exe ├── modpath.iss ├── rust-old.iss ├── rust.iss └── upgrade.iss ├── fetch-inputs.py ├── gfx ├── banner.bmp ├── banner.xcf ├── dialogbg.bmp ├── dialogbg.xcf ├── rust-logo.ico └── rust-logo.png ├── msi ├── Makefile ├── Makefile-old ├── remove-duplicates.xsl ├── rust-old.wxs ├── rust.wxs ├── rustwelcomedlg.wxs ├── squash-components.xsl └── ui.wxs ├── package-rust.py └── pkg ├── Distribution-old.xml ├── Distribution.xml └── postinstall /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | in/ 3 | out/ 4 | tmp/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "rust-installer"] 2 | path = rust-installer 3 | url = https://github.com/rust-lang/rust-installer 4 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 The Rust Project Developers 2 | 3 | Permission is hereby granted, free of charge, to any 4 | person obtaining a copy of this software and associated 5 | documentation files (the "Software"), to deal in the 6 | Software without restriction, including without 7 | limitation the rights to use, copy, modify, merge, 8 | publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software 10 | is furnished to do so, subject to the following 11 | conditions: 12 | 13 | The above copyright notice and this permission notice 14 | shall be included in all copies or substantial portions 15 | of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF 18 | ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 19 | TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 20 | PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT 21 | SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR 24 | IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 | DEALINGS IN THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is the project that packages Rust in various formats. Currently 2 | its job is to combine the outputs of the Rust build with that of the 3 | Cargo build, both in [rust-installer] format, and produce installers 4 | in a variety of formats. 5 | 6 | [rust-installer]: https://github.com/rust-lang/rust-installer 7 | 8 | # Usage 9 | 10 | First you need to acquire the components that make up the Rust 11 | installation, rustc, cargo, rust-docs, and - on Windows - rust-mingw, 12 | containing portions of the mingw toolchain necessary to make Rust 13 | work, as well as the corresponding source tarball (which is used to 14 | fish out some version information, yech). *Note: neither the OS X nor 15 | Windows builds actually produce source tarballs at the moment. It 16 | would be much better for the binary tarballs to [include the 17 | information](https://github.com/rust-lang/rust/pull/20388) the build 18 | wants (but also would be good for those builds to produce source 19 | tarballs).* 20 | 21 | The easiest way to do this is just: 22 | 23 | ``` 24 | $ ./fetch-inputs.py --target=x86_64-unknown-linux-gnu --channel=nightly 25 | ``` 26 | 27 | Which will fetch the official binaries that correspond to the given 28 | channel and put them in the `./in` directory. 29 | 30 | To package from locally-built Rust and Cargo, just copy the tarballs 31 | into `./in`. 32 | 33 | Then to package, e.g.: 34 | 35 | ``` 36 | $ ./package-rust.py --target=x86_64-unknown-linux-gnu 37 | $ ./package-rust.py --target=x86_64-apple-darwin --pkg 38 | $ ./package-rust.py --target=x86_64-pc-windows-gnu --exe --msi 39 | ``` 40 | 41 | `--pkg`, `--exe`, and `--msi` are optional, producing 42 | platform-specific installers *in addition* to the tarball 43 | installer. These only work when run on OS X or Windows. 44 | 45 | # License 46 | 47 | This software is distributed under the terms of both the MIT license 48 | and/or the Apache License (Version 2.0), at your option. 49 | 50 | See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details. 51 | -------------------------------------------------------------------------------- /etc/README.md: -------------------------------------------------------------------------------- 1 | # The Rust Programming Language 2 | 3 | This is a compiler for Rust, including standard libraries, tools and 4 | documentation. Rust is a systems programming language that is fast, 5 | memory safe and multithreaded, but does not employ a garbage collector 6 | or otherwise impose significant runtime overhead. 7 | 8 | To install to /usr/local (the default), run the included `install.sh` script: 9 | 10 | $ sudo ./install.sh 11 | 12 | To uninstall: 13 | 14 | $ sudo /usr/local/lib/rustlib/uninstall.sh 15 | 16 | `install.sh` has a few options, including the possibility to set an installation 17 | prefix. You can display these options by running: 18 | 19 | $ sudo ./install.sh --help 20 | 21 | Read [The Book](http://doc.rust-lang.org/book/index.html) to learn how 22 | to use Rust. 23 | 24 | Rust is primarily distributed under the terms of both the MIT license 25 | and the Apache License (Version 2.0), with portions covered by various 26 | BSD-like licenses. 27 | 28 | See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details. 29 | -------------------------------------------------------------------------------- /exe/modpath.iss: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // 3 | // Inno Setup Ver: 5.4.2 4 | // Script Version: 1.4.1 5 | // Author: Jared Breland 6 | // Homepage: http://www.legroom.net/software 7 | // License: GNU Lesser General Public License (LGPL), version 3 8 | // http://www.gnu.org/licenses/lgpl.html 9 | // 10 | // Script Function: 11 | // Allow modification of environmental path directly from Inno Setup installers 12 | // 13 | // Instructions: 14 | // Copy modpath.iss to the same directory as your setup script 15 | // 16 | // Add this statement to your [Setup] section 17 | // ChangesEnvironment=true 18 | // 19 | // Add this statement to your [Tasks] section 20 | // You can change the Description or Flags 21 | // You can change the Name, but it must match the ModPathName setting below 22 | // Name: modifypath; Description: &Add application directory to your environmental path; Flags: unchecked 23 | // 24 | // Add the following to the end of your [Code] section 25 | // ModPathName defines the name of the task defined above 26 | // ModPathType defines whether the 'user' or 'system' path will be modified; 27 | // this will default to user if anything other than system is set 28 | // setArrayLength must specify the total number of dirs to be added 29 | // Result[0] contains first directory, Result[1] contains second, etc. 30 | // const 31 | // ModPathName = 'modifypath'; 32 | // ModPathType = 'user'; 33 | // 34 | // function ModPathDir(): TArrayOfString; 35 | // begin 36 | // setArrayLength(Result, 1); 37 | // Result[0] := ExpandConstant('{app}'); 38 | // end; 39 | // #include "modpath.iss" 40 | // ---------------------------------------------------------------------------- 41 | 42 | procedure ModPath(); 43 | var 44 | oldpath: String; 45 | newpath: String; 46 | updatepath: Boolean; 47 | pathArr: TArrayOfString; 48 | aExecFile: String; 49 | aExecArr: TArrayOfString; 50 | i, d: Integer; 51 | pathdir: TArrayOfString; 52 | regroot: Integer; 53 | regpath: String; 54 | 55 | begin 56 | // Get constants from main script and adjust behavior accordingly 57 | // ModPathType MUST be 'system' or 'user'; force 'user' if invalid 58 | if ModPathType = 'system' then begin 59 | regroot := HKEY_LOCAL_MACHINE; 60 | regpath := 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'; 61 | end else begin 62 | regroot := HKEY_CURRENT_USER; 63 | regpath := 'Environment'; 64 | end; 65 | 66 | // Get array of new directories and act on each individually 67 | pathdir := ModPathDir(); 68 | for d := 0 to GetArrayLength(pathdir)-1 do begin 69 | updatepath := true; 70 | 71 | // Modify WinNT path 72 | if UsingWinNT() = true then begin 73 | 74 | // Get current path, split into an array 75 | RegQueryStringValue(regroot, regpath, 'Path', oldpath); 76 | oldpath := oldpath + ';'; 77 | i := 0; 78 | 79 | while (Pos(';', oldpath) > 0) do begin 80 | SetArrayLength(pathArr, i+1); 81 | pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1); 82 | oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath)); 83 | i := i + 1; 84 | 85 | // Check if current directory matches app dir 86 | if pathdir[d] = pathArr[i-1] then begin 87 | // if uninstalling, remove dir from path 88 | if IsUninstaller() = true then begin 89 | continue; 90 | // if installing, flag that dir already exists in path 91 | end else begin 92 | updatepath := false; 93 | end; 94 | end; 95 | 96 | // Add current directory to new path 97 | if i = 1 then begin 98 | newpath := pathArr[i-1]; 99 | end else begin 100 | newpath := newpath + ';' + pathArr[i-1]; 101 | end; 102 | end; 103 | 104 | // Append app dir to path if not already included 105 | if (IsUninstaller() = false) AND (updatepath = true) then 106 | newpath := newpath + ';' + pathdir[d]; 107 | 108 | // Write new path 109 | RegWriteStringValue(regroot, regpath, 'Path', newpath); 110 | 111 | // Modify Win9x path 112 | end else begin 113 | 114 | // Convert to shortened dirname 115 | pathdir[d] := GetShortName(pathdir[d]); 116 | 117 | // If autoexec.bat exists, check if app dir already exists in path 118 | aExecFile := 'C:\AUTOEXEC.BAT'; 119 | if FileExists(aExecFile) then begin 120 | LoadStringsFromFile(aExecFile, aExecArr); 121 | for i := 0 to GetArrayLength(aExecArr)-1 do begin 122 | if IsUninstaller() = false then begin 123 | // If app dir already exists while installing, skip add 124 | if (Pos(pathdir[d], aExecArr[i]) > 0) then 125 | updatepath := false; 126 | break; 127 | end else begin 128 | // If app dir exists and = what we originally set, then delete at uninstall 129 | if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then 130 | aExecArr[i] := ''; 131 | end; 132 | end; 133 | end; 134 | 135 | // If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path 136 | if (IsUninstaller() = false) AND (updatepath = true) then begin 137 | SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True); 138 | 139 | // If uninstalling, write the full autoexec out 140 | end else begin 141 | SaveStringsToFile(aExecFile, aExecArr, False); 142 | end; 143 | end; 144 | end; 145 | end; 146 | 147 | // Split a string into an array using passed delimeter 148 | procedure Explode(var Dest: TArrayOfString; Text: String; Separator: String); 149 | var 150 | i: Integer; 151 | begin 152 | i := 0; 153 | repeat 154 | SetArrayLength(Dest, i+1); 155 | if Pos(Separator,Text) > 0 then begin 156 | Dest[i] := Copy(Text, 1, Pos(Separator, Text)-1); 157 | Text := Copy(Text, Pos(Separator,Text) + Length(Separator), Length(Text)); 158 | i := i + 1; 159 | end else begin 160 | Dest[i] := Text; 161 | Text := ''; 162 | end; 163 | until Length(Text)=0; 164 | end; 165 | 166 | 167 | procedure ModPathCurStepChanged(CurStep: TSetupStep); 168 | var 169 | taskname: String; 170 | begin 171 | taskname := ModPathName; 172 | if CurStep = ssPostInstall then 173 | if IsTaskSelected(taskname) then 174 | ModPath(); 175 | end; 176 | 177 | procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); 178 | var 179 | aSelectedTasks: TArrayOfString; 180 | i: Integer; 181 | taskname: String; 182 | regpath: String; 183 | regstring: String; 184 | appid: String; 185 | begin 186 | // only run during actual uninstall 187 | if CurUninstallStep = usUninstall then begin 188 | // get list of selected tasks saved in registry at install time 189 | appid := '{#emit SetupSetting("AppId")}'; 190 | if appid = '' then appid := '{#emit SetupSetting("AppName")}'; 191 | regpath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\'+appid+'_is1'); 192 | RegQueryStringValue(HKLM, regpath, 'Inno Setup: Selected Tasks', regstring); 193 | if regstring = '' then RegQueryStringValue(HKCU, regpath, 'Inno Setup: Selected Tasks', regstring); 194 | 195 | // check each task; if matches modpath taskname, trigger patch removal 196 | if regstring <> '' then begin 197 | taskname := ModPathName; 198 | Explode(aSelectedTasks, regstring, ','); 199 | if GetArrayLength(aSelectedTasks) > 0 then begin 200 | for i := 0 to GetArrayLength(aSelectedTasks)-1 do begin 201 | if comparetext(aSelectedTasks[i], taskname) = 0 then 202 | ModPath(); 203 | end; 204 | end; 205 | end; 206 | end; 207 | end; 208 | 209 | function NeedRestart(): Boolean; 210 | var 211 | taskname: String; 212 | begin 213 | taskname := ModPathName; 214 | if IsTaskSelected(taskname) and not UsingWinNT() then begin 215 | Result := True; 216 | end else begin 217 | Result := False; 218 | end; 219 | end; 220 | -------------------------------------------------------------------------------- /exe/rust-old.iss: -------------------------------------------------------------------------------- 1 | #define CFG_RELEASE_NUM GetEnv("CFG_RELEASE_NUM") 2 | #define CFG_RELEASE GetEnv("CFG_RELEASE") 3 | #define CFG_PACKAGE_NAME GetEnv("CFG_PACKAGE_NAME") 4 | #define CFG_BUILD GetEnv("CFG_BUILD") 5 | 6 | [Setup] 7 | 8 | SetupIconFile=rust-logo.ico 9 | AppName=Rust 10 | AppVersion={#CFG_RELEASE} 11 | AppCopyright=Copyright (C) 2006-2014 Mozilla Foundation, MIT license 12 | AppPublisher=Mozilla Foundation 13 | AppPublisherURL=http://www.rust-lang.org 14 | VersionInfoVersion={#CFG_RELEASE_NUM} 15 | LicenseFile=LICENSE.txt 16 | 17 | PrivilegesRequired=lowest 18 | DisableWelcomePage=true 19 | DisableProgramGroupPage=true 20 | DisableReadyPage=true 21 | DisableStartupPrompt=true 22 | 23 | OutputDir=.\ 24 | SourceDir=.\ 25 | OutputBaseFilename={#CFG_PACKAGE_NAME}-{#CFG_BUILD} 26 | DefaultDirName={sd}\Rust 27 | 28 | Compression=lzma2/ultra 29 | InternalCompressLevel=ultra 30 | SolidCompression=true 31 | 32 | ChangesEnvironment=true 33 | ChangesAssociations=no 34 | AllowUNCPath=false 35 | AllowNoIcons=true 36 | Uninstallable=yes 37 | 38 | [Tasks] 39 | Name: modifypath; Description: &Add {app}\bin to your PATH (recommended) 40 | 41 | [Components] 42 | Name: rust; Description: "Rust compiler and standard crates"; Types: full compact custom; Flags: fixed 43 | #ifdef MINGW 44 | Name: gcc; Description: "Linker and platform libraries"; Types: full 45 | #endif 46 | Name: docs; Description: "HTML documentation"; Types: full 47 | Name: cargo; Description: "Cargo, the Rust package manager"; Types: full 48 | 49 | [Files] 50 | Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust 51 | #ifdef MINGW 52 | Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: gcc 53 | #endif 54 | Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs 55 | Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo 56 | 57 | [Code] 58 | const 59 | ModPathName = 'modifypath'; 60 | ModPathType = 'user'; 61 | 62 | function ModPathDir(): TArrayOfString; 63 | begin 64 | setArrayLength(Result, 1) 65 | Result[0] := ExpandConstant('{app}\bin'); 66 | end; 67 | 68 | #include "modpath.iss" 69 | #include "upgrade.iss" 70 | 71 | // Both modpath.iss and upgrade.iss want to overload CurStepChanged. 72 | // This version does the overload then delegates to each. 73 | 74 | procedure CurStepChanged(CurStep: TSetupStep); 75 | begin 76 | UpgradeCurStepChanged(CurStep); 77 | ModPathCurStepChanged(CurStep); 78 | end; 79 | -------------------------------------------------------------------------------- /exe/rust.iss: -------------------------------------------------------------------------------- 1 | #define CFG_RELEASE_NUM GetEnv("CFG_RELEASE_NUM") 2 | #define CFG_RELEASE GetEnv("CFG_RELEASE") 3 | #define CFG_PACKAGE_NAME GetEnv("CFG_PACKAGE_NAME") 4 | #define CFG_BUILD GetEnv("CFG_BUILD") 5 | 6 | [Setup] 7 | 8 | SetupIconFile=rust-logo.ico 9 | AppName=Rust 10 | AppVersion={#CFG_RELEASE} 11 | AppCopyright=Copyright (C) 2006-2014 Mozilla Foundation, MIT license 12 | AppPublisher=Mozilla Foundation 13 | AppPublisherURL=http://www.rust-lang.org 14 | VersionInfoVersion={#CFG_RELEASE_NUM} 15 | LicenseFile=LICENSE.txt 16 | 17 | PrivilegesRequired=lowest 18 | DisableWelcomePage=true 19 | DisableProgramGroupPage=true 20 | DisableReadyPage=true 21 | DisableStartupPrompt=true 22 | 23 | OutputDir=.\ 24 | SourceDir=.\ 25 | OutputBaseFilename={#CFG_PACKAGE_NAME}-{#CFG_BUILD} 26 | DefaultDirName={sd}\Rust 27 | 28 | Compression=lzma2/ultra 29 | InternalCompressLevel=ultra 30 | SolidCompression=true 31 | 32 | ChangesEnvironment=true 33 | ChangesAssociations=no 34 | AllowUNCPath=false 35 | AllowNoIcons=true 36 | Uninstallable=yes 37 | 38 | [Tasks] 39 | Name: modifypath; Description: &Add {app}\bin to your PATH (recommended) 40 | 41 | [Components] 42 | Name: rust; Description: "Rust compiler and standard crates"; Types: full compact custom; Flags: fixed 43 | #ifdef MINGW 44 | Name: gcc; Description: "Linker and platform libraries"; Types: full 45 | #endif 46 | Name: docs; Description: "HTML documentation"; Types: full 47 | Name: cargo; Description: "Cargo, the Rust package manager"; Types: full 48 | Name: std; Description: "The Rust Standard Library"; Types: full 49 | 50 | [Files] 51 | Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust 52 | #ifdef MINGW 53 | Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: gcc 54 | #endif 55 | Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs 56 | Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo 57 | Source: "rust-std/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: std 58 | 59 | [Code] 60 | const 61 | ModPathName = 'modifypath'; 62 | ModPathType = 'user'; 63 | 64 | function ModPathDir(): TArrayOfString; 65 | begin 66 | setArrayLength(Result, 1) 67 | Result[0] := ExpandConstant('{app}\bin'); 68 | end; 69 | 70 | #include "modpath.iss" 71 | #include "upgrade.iss" 72 | 73 | // Both modpath.iss and upgrade.iss want to overload CurStepChanged. 74 | // This version does the overload then delegates to each. 75 | 76 | procedure CurStepChanged(CurStep: TSetupStep); 77 | begin 78 | UpgradeCurStepChanged(CurStep); 79 | ModPathCurStepChanged(CurStep); 80 | end; 81 | -------------------------------------------------------------------------------- /exe/upgrade.iss: -------------------------------------------------------------------------------- 1 | // The following code taken from https://stackoverflow.com/questions/2000296/innosetup-how-to-automatically-uninstall-previous-installed-version 2 | // It performs upgrades by running the uninstaller before the install 3 | 4 | ///////////////////////////////////////////////////////////////////// 5 | function GetUninstallString(): String; 6 | var 7 | sUnInstPath: String; 8 | sUnInstallString: String; 9 | begin 10 | sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\Rust_is1'); 11 | sUnInstallString := ''; 12 | if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then 13 | RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString); 14 | Result := sUnInstallString; 15 | end; 16 | 17 | 18 | ///////////////////////////////////////////////////////////////////// 19 | function IsUpgrade(): Boolean; 20 | begin 21 | Result := (GetUninstallString() <> ''); 22 | end; 23 | 24 | 25 | ///////////////////////////////////////////////////////////////////// 26 | function UnInstallOldVersion(): Integer; 27 | var 28 | sUnInstallString: String; 29 | iResultCode: Integer; 30 | begin 31 | // Return Values: 32 | // 1 - uninstall string is empty 33 | // 2 - error executing the UnInstallString 34 | // 3 - successfully executed the UnInstallString 35 | 36 | // default return value 37 | Result := 0; 38 | 39 | // get the uninstall string of the old app 40 | sUnInstallString := GetUninstallString(); 41 | if sUnInstallString <> '' then begin 42 | sUnInstallString := RemoveQuotes(sUnInstallString); 43 | if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then 44 | Result := 3 45 | else 46 | Result := 2; 47 | end else 48 | Result := 1; 49 | end; 50 | 51 | ///////////////////////////////////////////////////////////////////// 52 | procedure UpgradeCurStepChanged(CurStep: TSetupStep); 53 | begin 54 | if (CurStep=ssInstall) then 55 | begin 56 | if (IsUpgrade()) then 57 | begin 58 | UnInstallOldVersion(); 59 | end; 60 | end; 61 | end; 62 | -------------------------------------------------------------------------------- /fetch-inputs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | # Copyright 2015 The Rust Project Developers. See the COPYRIGHT 3 | # file at the top-level directory of this distribution and at 4 | # http://rust-lang.org/COPYRIGHT. 5 | # 6 | # Licensed under the Apache License, Version 2.0 or the MIT license 8 | # , at your 9 | # option. This file may not be copied, modified, or distributed 10 | # except according to those terms. 11 | 12 | import sys, os, subprocess, shutil 13 | 14 | target = None 15 | channel = None 16 | 17 | for arg in sys.argv: 18 | if "--channel" in arg: 19 | channel = arg.split("=")[1] 20 | elif "--target" in arg: 21 | target = arg.split("=")[1] 22 | 23 | print 24 | print "target: " + str(target) 25 | print "channel: " + str(channel) 26 | print 27 | 28 | if channel is None: 29 | print "specify --channel" 30 | sys.exit(1) 31 | if target is None: 32 | print "specify --target" 33 | sys.exit(1) 34 | 35 | SERVER_ADDRESS = os.getenv("RUST_DIST_SERVER", "https://static.rust-lang.org") 36 | CARGO_SERVER_ADDRESS = os.getenv("CARGO_DIST_SERVER", 37 | "https://s3.amazonaws.com/rust-lang-ci/cargo-builds") 38 | RUST_DIST_FOLDER = "dist" 39 | TEMP_DIR = "./tmp" 40 | IN_DIR = "./in" 41 | 42 | # Create the temp directory 43 | if os.path.isdir(TEMP_DIR): 44 | shutil.rmtree(TEMP_DIR) 45 | os.mkdir(TEMP_DIR) 46 | 47 | # Create the in directory 48 | if os.path.isdir(IN_DIR): 49 | shutil.rmtree(IN_DIR) 50 | os.mkdir(IN_DIR) 51 | 52 | # Download rust manifest 53 | rust_manifest_name = "channel-rustc-" + channel 54 | remote_rust_dir = SERVER_ADDRESS + "/" + RUST_DIST_FOLDER 55 | remote_rust_manifest = remote_rust_dir + "/" + rust_manifest_name 56 | print "rust manifest: " + remote_rust_manifest 57 | cwd = os.getcwd() 58 | os.chdir(TEMP_DIR) 59 | retval = subprocess.call(["curl", "-f", "-O", remote_rust_manifest]) 60 | if retval != 0: 61 | print "downlading rust manifest failed" 62 | sys.exit(1) 63 | os.chdir(cwd) 64 | 65 | # Get list of rust artifacts for target 66 | rust_artifacts = [] 67 | rustc_installer = None 68 | for line in open(os.path.join(TEMP_DIR, rust_manifest_name)): 69 | if target in line and ".tar.gz" in line: 70 | rust_artifacts.append(line.rstrip()) 71 | if line.startswith("rustc-") and "-src" not in line: 72 | rustc_installer = line.rstrip() 73 | assert len(rust_artifacts) > 0 74 | print "rust artifacts: " + str(rust_artifacts) 75 | 76 | assert rustc_installer is not None 77 | 78 | # We'll use the source checksum as a fingerprint for synchronizing 79 | # dist builds across platforms on the buildbot prior to uploading. 80 | # FIXME: Would be nice to get this fingerprint from the 'version' file 81 | # but that requires some buildbot changes. 82 | rust_source = None 83 | for line in open(os.path.join(TEMP_DIR, rust_manifest_name)): 84 | if "-src" in line: 85 | rust_source = line.rstrip() 86 | assert rust_source is not None 87 | print "rust source: " + rust_source 88 | 89 | # Download the source 90 | cwd = os.getcwd() 91 | os.chdir(IN_DIR) 92 | full_rust_source = remote_rust_dir + "/" + rust_source 93 | retval = subprocess.call(["curl", "-f", "-O", full_rust_source]) 94 | if retval != 0: 95 | print "downloading source failed" 96 | sys.exit(1) 97 | os.chdir(cwd) 98 | 99 | # Download the rust artifacts 100 | full_rust_artifacts = [remote_rust_dir + "/" + x for x in rust_artifacts] 101 | for artifact in full_rust_artifacts: 102 | cwd = os.getcwd() 103 | os.chdir(IN_DIR) 104 | retval = subprocess.call(["curl", "-f", "-O", artifact]) 105 | if retval != 0: 106 | print "downlading " + artifact + " failed" 107 | sys.exit(1) 108 | os.chdir(cwd) 109 | 110 | 111 | cargo_branch = 'master' 112 | if channel != "nightly": 113 | retval = subprocess.call(["tar", "xzf", IN_DIR + "/" + rustc_installer, "-C", TEMP_DIR]) 114 | if retval != 0: 115 | print "untarring source failed" 116 | sys.exit(1) 117 | rustc_installer_dir = os.path.join(TEMP_DIR, rustc_installer.replace(".tar.gz", "")) 118 | 119 | # Pull the version number out of the version file 120 | version = None 121 | for line in open(os.path.join(rustc_installer_dir, "version")): 122 | print "reported version: " + line 123 | version = line.split(" ")[0].split("-")[0] 124 | 125 | assert version is not None 126 | print "cargo version key: " + version 127 | cargo_branch = 'rust-' + version 128 | 129 | proc = subprocess.Popen(["curl", 130 | "-H", "Accept: application/vnd.github.3.sha", 131 | "-sSf", 132 | "https://api.github.com/repos/rust-lang/cargo/commits/" + cargo_branch], 133 | stdout=subprocess.PIPE) 134 | (cargo_rev, err) = proc.communicate() 135 | exit_code = proc.wait() 136 | if exit_code != 0: 137 | print "failed to fetch most recent commit: " + err 138 | print "cargo rev: " + str(cargo_rev) 139 | 140 | # Download cargo 141 | artifact_name = "cargo-nightly-" + target + ".tar.gz" 142 | artifact = CARGO_SERVER_ADDRESS + "/" + cargo_rev + "/" + artifact_name 143 | cwd = os.getcwd() 144 | os.chdir(IN_DIR) 145 | retval = subprocess.call(["curl", "-f", "-O", artifact]) 146 | if retval != 0: 147 | print "downlading " + artifact + " failed" 148 | sys.exit(1) 149 | os.chdir(cwd) 150 | -------------------------------------------------------------------------------- /gfx/banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/banner.bmp -------------------------------------------------------------------------------- /gfx/banner.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/banner.xcf -------------------------------------------------------------------------------- /gfx/dialogbg.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/dialogbg.bmp -------------------------------------------------------------------------------- /gfx/dialogbg.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/dialogbg.xcf -------------------------------------------------------------------------------- /gfx/rust-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/rust-logo.ico -------------------------------------------------------------------------------- /gfx/rust-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rust-lang-deprecated/rust-packaging/2100aa63f1cfae3ce0bd38e503bd8bf36f5687cb/gfx/rust-logo.png -------------------------------------------------------------------------------- /msi/Makefile: -------------------------------------------------------------------------------- 1 | ifdef CFG_PACKAGE_NAME 2 | MSI = $(CFG_PACKAGE_NAME)-$(CFG_BUILD) 3 | else 4 | MSI = rust 5 | endif 6 | 7 | FILEGROUPS=RustcGroup.wxs DocsGroup.wxs CargoGroup.wxs StdGroup.wxs 8 | ifeq ($(CFG_MINGW),1) 9 | FILEGROUPS += GccGroup.wxs 10 | endif 11 | SRCS=rust.wxs ui.wxs rustwelcomedlg.wxs $(FILEGROUPS) 12 | 13 | RUSTCDIR ?= rustc 14 | GCCDIR ?= rust-mingw 15 | DOCSDIR ?= rust-docs 16 | CARGODIR ?= cargo 17 | STDDIR ?= rust-std 18 | 19 | OBJS=$(SRCS:.wxs=.wixobj) 20 | # %WIX% variable contains path to WIX installdir (with trailing backslash) and is set by WiX installer 21 | # heat.exe colects files info from directory recursively 22 | HEAT="$(WIX)bin\heat.exe" 23 | # candle.exe compiles wxs source file into wixobj file 24 | CANDLE="$(WIX)bin\candle.exe" 25 | # light.exe links wixobj files and creates msi 26 | LIGHT="$(WIX)bin\light.exe" 27 | RM ?= del 28 | 29 | HEAT_FLAGS= -nologo -gg -sfrag -srd -sreg 30 | CANDLE_FLAGS= -nologo -dRustcDir=$(RUSTCDIR) -dDocsDir=$(DOCSDIR) -dCargoDir=$(CARGODIR) -dStdDir=$(STDDIR) -arch $(CFG_PLATFORM) 31 | ifeq ($(CFG_MINGW),1) 32 | CANDLE_FLAGS += -dGccDir=$(GCCDIR) 33 | endif 34 | LIGHT_FLAGS= -nologo -ext WixUIExtension -ext WixUtilExtension 35 | ifeq ($(SVAL),1) 36 | LIGHT_FLAGS += -sval 37 | endif 38 | 39 | .SUFFIXES: .wxs .wixobj 40 | 41 | all: $(MSI).msi 42 | 43 | $(MSI).msi: $(OBJS) 44 | $(LIGHT) $(LIGHT_FLAGS) -out $@ $(OBJS) -sice:ICE57 45 | # ICE57 wrongly complains about the shortcuts 46 | 47 | .wxs.wixobj: 48 | $(CANDLE) $(CANDLE_FLAGS) -out $@ $^ 49 | 50 | RustcGroup.wxs: 51 | $(HEAT) dir $(RUSTCDIR) $(HEAT_FLAGS) -cg RustcGroup -dr Rustc -var var.RustcDir -out $@ 52 | 53 | GccGroup.wxs: 54 | $(HEAT) dir $(GCCDIR) $(HEAT_FLAGS) -cg GccGroup -dr Gcc -var var.GccDir -out $@ 55 | 56 | DocsGroup.wxs: 57 | $(HEAT) dir $(DOCSDIR) $(HEAT_FLAGS) -cg DocsGroup -dr Docs -var var.DocsDir -out $@ -t squash-components.xsl 58 | 59 | CargoGroup.wxs: 60 | $(HEAT) dir $(CARGODIR) $(HEAT_FLAGS) -cg CargoGroup -dr Cargo -var var.CargoDir -out $@ -t remove-duplicates.xsl 61 | 62 | StdGroup.wxs: 63 | $(HEAT) dir $(STDDIR) $(HEAT_FLAGS) -cg StdGroup -dr Std -var var.StdDir -out $@ 64 | 65 | clean: 66 | $(RM) $(MSI).msi $(OBJS) $(FILEGROUPS) 67 | -------------------------------------------------------------------------------- /msi/Makefile-old: -------------------------------------------------------------------------------- 1 | ifdef CFG_PACKAGE_NAME 2 | MSI = $(CFG_PACKAGE_NAME)-$(CFG_BUILD) 3 | else 4 | MSI = rust 5 | endif 6 | 7 | FILEGROUPS=RustcGroup.wxs DocsGroup.wxs CargoGroup.wxs 8 | ifeq ($(CFG_MINGW),1) 9 | FILEGROUPS += GccGroup.wxs 10 | endif 11 | SRCS=rust-old.wxs ui.wxs rustwelcomedlg.wxs $(FILEGROUPS) 12 | 13 | RUSTCDIR ?= rustc 14 | GCCDIR ?= rust-mingw 15 | DOCSDIR ?= rust-docs 16 | CARGODIR ?= cargo 17 | 18 | OBJS=$(SRCS:.wxs=.wixobj) 19 | # %WIX% variable contains path to WIX installdir (with trailing backslash) and is set by WiX installer 20 | # heat.exe colects files info from directory recursively 21 | HEAT="$(WIX)bin\heat.exe" 22 | # candle.exe compiles wxs source file into wixobj file 23 | CANDLE="$(WIX)bin\candle.exe" 24 | # light.exe links wixobj files and creates msi 25 | LIGHT="$(WIX)bin\light.exe" 26 | RM ?= del 27 | 28 | HEAT_FLAGS= -nologo -gg -sfrag -srd -sreg 29 | CANDLE_FLAGS= -nologo -dRustcDir=$(RUSTCDIR) -dDocsDir=$(DOCSDIR) -dCargoDir=$(CARGODIR) -arch $(CFG_PLATFORM) 30 | ifeq ($(CFG_MINGW),1) 31 | CANDLE_FLAGS += -dGccDir=$(GCCDIR) 32 | endif 33 | LIGHT_FLAGS= -nologo -ext WixUIExtension 34 | ifeq ($(SVAL),1) 35 | LIGHT_FLAGS += -sval 36 | endif 37 | 38 | .SUFFIXES: .wxs .wixobj 39 | 40 | all: $(MSI).msi 41 | 42 | $(MSI).msi: $(OBJS) 43 | $(LIGHT) $(LIGHT_FLAGS) -out $@ $(OBJS) -sice:ICE57 44 | # ICE57 wrongly complains about the shortcuts 45 | 46 | .wxs.wixobj: 47 | $(CANDLE) $(CANDLE_FLAGS) -out $@ $^ 48 | 49 | RustcGroup.wxs: 50 | $(HEAT) dir $(RUSTCDIR) $(HEAT_FLAGS) -cg RustcGroup -dr Rustc -var var.RustcDir -out $@ 51 | 52 | GccGroup.wxs: 53 | $(HEAT) dir $(GCCDIR) $(HEAT_FLAGS) -cg GccGroup -dr Gcc -var var.GccDir -out $@ 54 | 55 | DocsGroup.wxs: 56 | $(HEAT) dir $(DOCSDIR) $(HEAT_FLAGS) -cg DocsGroup -dr Docs -var var.DocsDir -out $@ -t squash-components.xsl 57 | 58 | CargoGroup.wxs: 59 | $(HEAT) dir $(CARGODIR) $(HEAT_FLAGS) -cg CargoGroup -dr Cargo -var var.CargoDir -out $@ -t remove-duplicates.xsl 60 | 61 | clean: 62 | $(RM) $(MSI).msi $(OBJS) $(FILEGROUPS) 63 | -------------------------------------------------------------------------------- /msi/remove-duplicates.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | README-CARGO.md 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /msi/rust-old.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 52 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 80 | INSTALLDIR_USER 82 | 83 | 84 | NOT INSTALLDIR_USER 86 | NOT INSTALLDIR_MACHINE 88 | 89 | 90 | NOT INSTALLDIR AND NOT ALLUSERS 92 | NOT INSTALLDIR AND ALLUSERS 94 | 95 | NOT ALLUSERS 97 | 98 | 99 | NOT ALLUSERS 101 | 102 | 103 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 148 | 149 | 150 | 151 | 152 | ALLUSERS=1 OR (ALLUSERS=2 AND Privileged) 153 | 154 | 155 | 156 | 157 | 158 | ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)) 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 199 | 200 | 201 | 202 | 203 | 208 | 209 | 210 | 211 | 217 | 218 | 219 | 220 | 225 | 226 | 227 | 228 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | -------------------------------------------------------------------------------- /msi/rust.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 76 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 104 | INSTALLDIR_USER 106 | 107 | 108 | NOT INSTALLDIR_USER 110 | NOT INSTALLDIR_MACHINE 112 | 113 | 114 | NOT INSTALLDIR AND NOT ALLUSERS 116 | NOT INSTALLDIR AND ALLUSERS 118 | 119 | NOT ALLUSERS 121 | 122 | 123 | NOT ALLUSERS 125 | 126 | 127 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 152 | 153 | 154 | 155 | 156 | 157 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 182 | 183 | 184 | 185 | 186 | ALLUSERS=1 OR (ALLUSERS=2 AND Privileged) 187 | 188 | 189 | 190 | 191 | 192 | ALLUSERS="" OR (ALLUSERS=2 AND (NOT Privileged)) 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 231 | 232 | 233 | 234 | 235 | 240 | 241 | 242 | 247 | 248 | 249 | 250 | 256 | 257 | 258 | 259 | 264 | 265 | 266 | 267 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | -------------------------------------------------------------------------------- /msi/rustwelcomedlg.wxs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 15 | 19 | 22 | 23 | 1 24 | 25 | 26 | 35 | 44 | 45 | 1 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | NOT Installed 55 | 56 | 57 | -------------------------------------------------------------------------------- /msi/squash-components.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /msi/ui.wxs: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 1 36 | 37 | 1 38 | "1"]]> 39 | 40 | 41 | 42 | 1 43 | 44 | !(wix.WixUISupportPerUser) AND NOT Privileged 45 | WixAppFolder = "WixPerUserFolder" 46 | WixAppFolder = "WixPerMachineFolder" 47 | WixAppFolder = "WixPerUserFolder" 48 | WixAppFolder = "WixPerMachineFolder" 49 | 1 50 | 51 | 52 | 1 53 | NOT WIXUI_DONTVALIDATEPATH 54 | "1"]]> 55 | WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1" 56 | 1 57 | 1 58 | 59 | NOT Installed AND WixAppFolder = "WixPerUserFolder" 60 | NOT Installed AND WixAppFolder = "WixPerMachineFolder" 61 | Installed 62 | 63 | 1 64 | 65 | 1 66 | 1 67 | 1 68 | 1 69 | 70 | Installed AND NOT PATCH 71 | Installed AND PATCH 72 | 73 | Installed AND PATCH 74 | 75 | 76 | 77 | Installed AND PATCH 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /package-rust.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | # Copyright 2015 The Rust Project Developers. See the COPYRIGHT 3 | # file at the top-level directory of this distribution and at 4 | # http://rust-lang.org/COPYRIGHT. 5 | # 6 | # Licensed under the Apache License, Version 2.0 or the MIT license 8 | # , at your 9 | # option. This file may not be copied, modified, or distributed 10 | # except according to those terms. 11 | 12 | import sys, os, subprocess, shutil, datetime, glob 13 | 14 | # Parse configuration 15 | 16 | make_comb = True 17 | make_exe = False 18 | make_pkg = False 19 | make_msi = False 20 | msi_sval = False # skip msi validation 21 | target = None 22 | 23 | for arg in sys.argv: 24 | if arg == "--no-combined": 25 | make_comb = False 26 | elif arg == "--exe": 27 | make_exe = True 28 | elif arg == "--pkg": 29 | make_pkg = True 30 | elif arg == "--msi": 31 | make_msi = True 32 | elif arg == "--msi-sval": 33 | msi_sval = True 34 | elif "--target" in arg: 35 | target = arg.split("=")[1] 36 | 37 | print 38 | print "target: " + str(target) 39 | print "combined: " + str(make_comb) 40 | print "exe: " + str(make_exe) 41 | print "pkg: " + str(make_pkg) 42 | print "msi: " + str(make_msi) 43 | print 44 | 45 | if target is None: 46 | print "specify --target" 47 | sys.exit(1) 48 | 49 | def run(args): 50 | print ' '.join(args) 51 | retval = subprocess.call(args) 52 | if retval != 0: 53 | print "call failed: " + str(args) 54 | sys.exit(1) 55 | 56 | # Move file with target overwrite 57 | def move_file(source, target): 58 | try: os.remove(target) 59 | except OSError: pass 60 | shutil.move(source, target) 61 | 62 | INPUT_DIR = "./in" 63 | OUTPUT_DIR = "./out" 64 | TEMP_DIR = "./tmp" 65 | RUSTC_PACKAGE_NAME = "rustc" 66 | COMBINED_PACKAGE_NAME = "rust" 67 | 68 | # Create the temp directory 69 | if os.path.isdir(TEMP_DIR): 70 | print "Removing old temp..." 71 | shutil.rmtree(TEMP_DIR) 72 | os.mkdir(TEMP_DIR) 73 | 74 | if not os.path.isdir(OUTPUT_DIR): 75 | os.mkdir(OUTPUT_DIR) 76 | 77 | # The names of the packages that need to be combined via rust-installer 78 | # NB: rust-std was recently separated from rustc. Not all channels will actually have rust-std yet 79 | components = [RUSTC_PACKAGE_NAME, "cargo", "rust-docs", "rust-std"] 80 | if "pc-windows-gnu" in target: 81 | components.append("rust-mingw") 82 | 83 | # Now find the names of the tarballs that belong to those components 84 | inputs = [] 85 | package_version = None 86 | rustc_installer = None 87 | cargo_installer = None 88 | docs_installer = None 89 | mingw_installer = None 90 | std_installer = None 91 | for component in components: 92 | component_installer = None 93 | for filename in os.listdir(INPUT_DIR): 94 | if target in filename and component in filename: 95 | # Hack: several components contain 'rust' in the name 96 | # FIXME: Does this even do anything? 'rust' is not in the components list. 97 | if not (component == "rust" and ("rust-docs" in filename or "rust-mingw" in filename or "rust-std" in filename)): 98 | component_installer = filename 99 | 100 | # FIXME coping with missing rust-std 101 | if not component_installer and component != "rust-std": 102 | print "unable to find installer for component " + component + ", target " + target 103 | sys.exit(1) 104 | # FIXME coping with missing rust-std 105 | if component_installer: 106 | inputs.append(INPUT_DIR + "/" + component_installer) 107 | 108 | # Extract the version from the filename 109 | if component == RUSTC_PACKAGE_NAME: 110 | s = component_installer[len(RUSTC_PACKAGE_NAME) + 1:] 111 | p = s.find(target) 112 | package_version = s[:p - 1] 113 | rustc_installer = component_installer 114 | if component == "cargo": 115 | cargo_installer = component_installer 116 | if component == "rust-docs": 117 | docs_installer = component_installer 118 | if component == "rust-mingw": 119 | mingw_installer = component_installer 120 | if component == "rust-std": 121 | std_installer = component_installer 122 | 123 | # HACK: When the rust-std package split from rustc, we needed to ensure 124 | # that during upgrades rustc was upgraded before rust-std, to avoid 125 | # rustc clobbering the std files during uninstall. This sort serves 126 | # to put rustc before rust-std in the component list. 127 | inputs.sort(reverse = True) 128 | 129 | assert package_version is not None 130 | assert rustc_installer is not None 131 | 132 | # Set up the overlay of license info 133 | run(["tar", "xzf", INPUT_DIR + "/" + rustc_installer, "-C", TEMP_DIR, ]) 134 | 135 | rustc_dir = TEMP_DIR + "/" + rustc_installer[:len(rustc_installer) - len(".tar.gz")] 136 | 137 | overlay_dir = TEMP_DIR + "/overlay" 138 | os.mkdir(overlay_dir) 139 | shutil.copyfile(rustc_dir + "/COPYRIGHT", overlay_dir + "/COPYRIGHT") 140 | shutil.copyfile(rustc_dir + "/LICENSE-APACHE", overlay_dir + "/LICENSE-APACHE") 141 | shutil.copyfile(rustc_dir + "/LICENSE-MIT", overlay_dir + "/LICENSE-MIT") 142 | shutil.copyfile(rustc_dir + "/version", overlay_dir + "/version") 143 | 144 | # Use a custom README that explains how to install 145 | shutil.copyfile("./etc/README.md", overlay_dir + "/README.md") 146 | 147 | if make_comb: 148 | # Combine the installers 149 | tarball_list=",".join(inputs) 150 | package_name=COMBINED_PACKAGE_NAME + "-" + package_version + "-" + target 151 | run(["sh", "./rust-installer/combine-installers.sh", 152 | "--product-name=Rust", 153 | "--rel-manifest-dir=rustlib", 154 | "--success-message=Rust-is-ready-to-roll.", 155 | "--work-dir=" + TEMP_DIR + "/work", 156 | "--output-dir=" + OUTPUT_DIR, 157 | "--package-name=" + package_name, 158 | "--legacy-manifest-dirs=rustlib,cargo", 159 | "--input-tarballs=" + tarball_list, 160 | "--non-installed-overlay=" + overlay_dir 161 | ]) 162 | 163 | # Everything below here is used for producing non-rust-installer packaging 164 | 165 | # Create the LICENSE.txt file used in some GUI installers 166 | license_file = TEMP_DIR + "/LICENSE.txt" 167 | cmd = "cat {0}/COPYRIGHT {0}/LICENSE-APACHE {0}/LICENSE-MIT > {1}".format(rustc_dir, license_file) 168 | run(["sh", "-c", cmd]) 169 | if make_msi: 170 | license_rtf = TEMP_DIR + "/LICENSE.rtf" 171 | # Convert plain text to RTF 172 | with open(license_file, "rt") as input: 173 | with open(license_rtf, "wt") as output: 174 | output.write(r"{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}\nowwrap\fs18"+"\n") 175 | for line in input.readlines(): 176 | output.write(line) 177 | output.write(r"\line ") 178 | output.write("}") 179 | 180 | # Reconstruct the following variables from the Rust makefile from the version number. 181 | # Currently these are needed by the Windows installer. 182 | CFG_RELEASE_NUM = None 183 | CFG_PRERELEASE_VERSION = None 184 | CFG_RELEASE = None 185 | CFG_PACKAGE_NAME = None 186 | CFG_BUILD = None 187 | CFG_PACKAGE_VERS = None 188 | 189 | # Pull the version number out of the version file 190 | # Examples: 191 | # 1.0.0-alpha.2 (522d09dfe 2015-02-19) (built 2015-02-19) 192 | # 1.0.0-nightly (b0746ff19 2015-03-05) (built 2015-03-06) 193 | 194 | CFG_RELEASE_INFO = None 195 | full_version = None 196 | for line in open(os.path.join(rustc_dir, "version")): 197 | print "reported version: " + line 198 | full_version = line.split(" ")[0] 199 | CFG_RELEASE_INFO = line.strip() 200 | 201 | assert full_version is not None 202 | version_number = full_version.split("-")[0] 203 | prerelease_version = "" 204 | if "beta." in full_version or "alpha." in full_version: 205 | prerelease_version = "." + full_version.split(".")[-1] 206 | 207 | # Guess the channel from the version 208 | channel = None 209 | if "nightly" in full_version: 210 | channel = "nightly" 211 | elif "beta" in full_version or "alpha" in full_version: 212 | channel = "beta" 213 | elif "dev" in full_version: 214 | channel = "dev" 215 | else: 216 | channel = "stable" 217 | 218 | CFG_RELEASE_NUM=version_number 219 | CFG_RELEASE=full_version 220 | CFG_PRERELEASE_VERSION=prerelease_version 221 | 222 | CFG_VER_MAJOR, CFG_VER_MINOR, CFG_VER_PATCH = version_number.split('.') 223 | CFG_VER_BUILD = str((datetime.date.today() - datetime.date(2000,1,1)).days) # days since Y2K 224 | 225 | # Logic reproduced from main.mk 226 | if channel == "stable": 227 | CFG_PACKAGE_VERS=CFG_RELEASE_NUM 228 | elif channel == "beta": 229 | CFG_PACKAGE_VERS="beta" 230 | elif channel == "nightly": 231 | CFG_PACKAGE_VERS="nightly" 232 | elif channel == "dev": 233 | CFG_PACKAGE_VERS=CFG_RELEASE_NUM + "-dev" 234 | else: 235 | print "unknown release channel" 236 | sys.exit(1) 237 | 238 | # This should be the same as the name on the tarballs 239 | CFG_PACKAGE_NAME=COMBINED_PACKAGE_NAME + "-" + CFG_PACKAGE_VERS 240 | CFG_BUILD=target 241 | CFG_CHANNEL=channel 242 | 243 | if "pc-windows-gnu" in target: 244 | CFG_MINGW="1" 245 | CFG_ABI="GNU" 246 | else: 247 | CFG_MINGW="0" 248 | if "pc-windows-msvc" in target: 249 | CFG_ABI="MSVC" 250 | 251 | if "x86_64" in target: 252 | CFG_PLATFORM = "x64" 253 | elif "i686": 254 | CFG_PLATFORM = "x86" 255 | 256 | # Export all vars starting with CFG_ 257 | cfgs = [pair for pair in locals().items() if pair[0].startswith("CFG_")] 258 | cfgs.sort() 259 | for k,v in cfgs: 260 | print k,"=",v 261 | os.environ[k] = v 262 | 263 | if make_pkg: 264 | print "creating .pkg" 265 | 266 | assert docs_installer is not None 267 | assert cargo_installer is not None 268 | 269 | rustc_package_name = rustc_installer.replace(".tar.gz", "") 270 | docs_package_name = docs_installer.replace(".tar.gz", "") 271 | cargo_package_name = cargo_installer.replace(".tar.gz", "") 272 | if std_installer: 273 | std_package_name = std_installer.replace(".tar.gz", "") 274 | else: 275 | std_package_name = None 276 | 277 | os.mkdir(TEMP_DIR + "/pkg") 278 | 279 | shutil.copytree(TEMP_DIR + "/work/" + rustc_package_name, TEMP_DIR + "/pkg/rustc") 280 | shutil.copytree(TEMP_DIR + "/work/" + cargo_package_name, TEMP_DIR + "/pkg/cargo") 281 | shutil.copytree(TEMP_DIR + "/work/" + docs_package_name, TEMP_DIR + "/pkg/rust-docs") 282 | if std_installer: 283 | shutil.copytree(TEMP_DIR + "/work/" + std_package_name, TEMP_DIR + "/pkg/rust-std") 284 | 285 | # The package root, extracted from a tarball has entirely wrong permissions. 286 | # This goes over everything and fixes them. 287 | run(["chmod", "-R", "u+rwX,go+rX,go-w", TEMP_DIR + "/pkg"]) 288 | for filename in os.listdir(TEMP_DIR + "/pkg/rustc/rustc/bin"): 289 | run(["chmod", "0755", TEMP_DIR + "/pkg/rustc/rustc/bin/" + filename]) 290 | for filename in os.listdir(TEMP_DIR + "/pkg/cargo/cargo/bin"): 291 | run(["chmod", "0755", TEMP_DIR + "/pkg/cargo/cargo/bin/" + filename]) 292 | 293 | # Copy the postinstall script that will execute install.sh 294 | shutil.copyfile("./pkg/postinstall", TEMP_DIR + "/pkg/rustc/postinstall") 295 | run(["chmod", "a+x", TEMP_DIR + "/pkg/rustc/postinstall"]) 296 | shutil.copyfile("./pkg/postinstall", TEMP_DIR + "/pkg/cargo/postinstall") 297 | run(["chmod", "a+x", TEMP_DIR + "/pkg/cargo/postinstall"]) 298 | shutil.copyfile("./pkg/postinstall", TEMP_DIR + "/pkg/rust-docs/postinstall") 299 | run(["chmod", "a+x", TEMP_DIR + "/pkg/rust-docs/postinstall"]) 300 | if std_installer: 301 | shutil.copyfile("./pkg/postinstall", TEMP_DIR + "/pkg/rust-std/postinstall") 302 | run(["chmod", "a+x", TEMP_DIR + "/pkg/rust-std/postinstall"]) 303 | 304 | pkgbuild_cmd = "pkgbuild --identifier org.rust-lang.rustc " + \ 305 | "--scripts " + TEMP_DIR + "/pkg/rustc --nopayload " + TEMP_DIR + "/pkg/rustc.pkg" 306 | run(["sh", "-c", pkgbuild_cmd]) 307 | pkgbuild_cmd = "pkgbuild --identifier org.rust-lang.cargo " + \ 308 | "--scripts " + TEMP_DIR + "/pkg/cargo --nopayload " + TEMP_DIR + "/pkg/cargo.pkg" 309 | run(["sh", "-c", pkgbuild_cmd]) 310 | pkgbuild_cmd = "pkgbuild --identifier org.rust-lang.rust-docs " + \ 311 | "--scripts " + TEMP_DIR + "/pkg/rust-docs --nopayload " + TEMP_DIR + "/pkg/rust-docs.pkg" 312 | run(["sh", "-c", pkgbuild_cmd]) 313 | if std_installer: 314 | pkgbuild_cmd = "pkgbuild --identifier org.rust-lang.rust-std " + \ 315 | "--scripts " + TEMP_DIR + "/pkg/rust-std --nopayload " + TEMP_DIR + "/pkg/rust-std.pkg" 316 | run(["sh", "-c", pkgbuild_cmd]) 317 | 318 | # Also create an 'uninstall' package 319 | os.mkdir(TEMP_DIR + "/pkg/uninstall") 320 | shutil.copyfile("./pkg/postinstall", TEMP_DIR + "/pkg/uninstall/postinstall") 321 | run(["chmod", "a+x", TEMP_DIR + "/pkg/uninstall/postinstall"]) 322 | pkgbuild_cmd = "pkgbuild --identifier org.rust-lang.uninstall " + \ 323 | "--scripts " + TEMP_DIR + "/pkg/uninstall --nopayload " + TEMP_DIR + "/pkg/uninstall.pkg" 324 | run(["sh", "-c", pkgbuild_cmd]) 325 | 326 | os.mkdir(TEMP_DIR + "/pkg/res") 327 | shutil.copyfile(TEMP_DIR + "/LICENSE.txt", TEMP_DIR + "/pkg/res/LICENSE.txt") 328 | shutil.copyfile("./gfx/rust-logo.png", TEMP_DIR + "/pkg/res/rust-logo.png") 329 | if std_installer: 330 | productbuild_cmd = "productbuild --distribution ./pkg/Distribution.xml " + \ 331 | "--resources " + TEMP_DIR + "/pkg/res " + OUTPUT_DIR + "/" + package_name + ".pkg " + \ 332 | "--package-path " + TEMP_DIR + "/pkg" 333 | else: 334 | productbuild_cmd = "productbuild --distribution ./pkg/Distribution-old.xml " + \ 335 | "--resources " + TEMP_DIR + "/pkg/res " + OUTPUT_DIR + "/" + package_name + ".pkg " + \ 336 | "--package-path " + TEMP_DIR + "/pkg" 337 | run(["sh", "-c", productbuild_cmd]) 338 | 339 | if make_exe or make_msi: 340 | if make_exe: 341 | print "creating .exe" 342 | if make_msi: 343 | print "creating .msi" 344 | 345 | assert docs_installer is not None 346 | assert cargo_installer is not None 347 | 348 | exe_temp_dir = TEMP_DIR + "/exe" 349 | os.mkdir(exe_temp_dir) 350 | run(["tar", "xzf", INPUT_DIR + "/" + rustc_installer, "-C", exe_temp_dir]) 351 | run(["tar", "xzf", INPUT_DIR + "/" + docs_installer, "-C", exe_temp_dir]) 352 | run(["tar", "xzf", INPUT_DIR + "/" + cargo_installer, "-C", exe_temp_dir]) 353 | if std_installer: 354 | run(["tar", "xzf", INPUT_DIR + "/" + std_installer, "-C", exe_temp_dir]) 355 | orig_rustc_dir = exe_temp_dir + "/" + rustc_installer.replace(".tar.gz", "") + "/rustc" 356 | orig_docs_dir = exe_temp_dir + "/" + docs_installer.replace(".tar.gz", "") + "/rust-docs" 357 | orig_cargo_dir = exe_temp_dir + "/" + cargo_installer.replace(".tar.gz", "") + "/cargo" 358 | if std_installer: 359 | orig_std_dir = exe_temp_dir + "/" + std_installer.replace(".tar.gz", "") + "/rust-std-" + target 360 | else: 361 | orig_std_dir = None 362 | 363 | # Move these to locations needed by the iscc script and wix sources 364 | rustc_dir = exe_temp_dir + "/rustc" 365 | docs_dir = exe_temp_dir + "/rust-docs" 366 | cargo_dir = exe_temp_dir + "/cargo" 367 | std_dir = exe_temp_dir + "/rust-std" 368 | os.rename(orig_rustc_dir, rustc_dir) 369 | os.rename(orig_docs_dir, docs_dir) 370 | os.rename(orig_cargo_dir, cargo_dir) 371 | if std_installer: 372 | os.rename(orig_std_dir, std_dir) 373 | 374 | if mingw_installer is not None: 375 | run(["tar", "xzf", INPUT_DIR + "/" + mingw_installer, "-C", exe_temp_dir]) 376 | orig_mingw_dir = exe_temp_dir + "/" + mingw_installer.replace(".tar.gz", "") + "/rust-mingw" 377 | mingw_dir = exe_temp_dir + "/rust-mingw" 378 | os.rename(orig_mingw_dir, mingw_dir) 379 | else: 380 | assert "pc-windows-gnu" not in target 381 | 382 | # Remove the installer files we don't need 383 | dir_comp_pairs = [(rustc_dir, "rustc"), (docs_dir, "rust-docs"), 384 | (cargo_dir, "cargo")] 385 | if std_installer: 386 | dir_comp_pairs += [(std_dir, "rust-std")] 387 | if mingw_installer is not None: 388 | dir_comp_pairs += [(mingw_dir, "rust-mingw")] 389 | for dir_and_component in dir_comp_pairs: 390 | dir_ = dir_and_component[0] 391 | component = dir_and_component[1] 392 | os.remove(dir_ + "/manifest.in") 393 | 394 | if make_exe: 395 | # Copy installer files, etc. 396 | shutil.copyfile("./exe/rust.iss", exe_temp_dir + "/rust.iss") 397 | shutil.copyfile("./exe/rust-old.iss", exe_temp_dir + "/rust-old.iss") 398 | shutil.copyfile("./exe/modpath.iss", exe_temp_dir + "/modpath.iss") 399 | shutil.copyfile("./exe/upgrade.iss", exe_temp_dir + "/upgrade.iss") 400 | shutil.copyfile("./gfx/rust-logo.ico", exe_temp_dir + "/rust-logo.ico") 401 | shutil.copyfile(TEMP_DIR + "/LICENSE.txt", exe_temp_dir + "/LICENSE.txt") 402 | 403 | cwd=os.getcwd() 404 | os.chdir(exe_temp_dir) 405 | if std_installer: 406 | args = ["iscc", "rust.iss"] 407 | else: 408 | args = ["iscc", "rust-old.iss"] 409 | if "windows-gnu" in target: 410 | args += ["/dMINGW"] 411 | run(args) 412 | os.chdir(cwd) 413 | 414 | exefile = CFG_PACKAGE_NAME + "-" + CFG_BUILD + ".exe" 415 | move_file(exe_temp_dir + "/" + exefile, OUTPUT_DIR + "/" + exefile) 416 | 417 | if make_msi: 418 | # Copy installer files, etc. 419 | for f in glob.glob("./msi/*"): 420 | shutil.copy(f, exe_temp_dir) 421 | for f in glob.glob("./gfx/*"): 422 | shutil.copy(f, exe_temp_dir) 423 | shutil.copy(TEMP_DIR + "/LICENSE.rtf", exe_temp_dir) 424 | 425 | cwd=os.getcwd() 426 | os.chdir(exe_temp_dir) 427 | if std_installer: 428 | run(["make", "SVAL=%i" % msi_sval]) 429 | else: 430 | run(["make", "SVAL=%i" % msi_sval, "-f", "Makefile-old"]) 431 | os.chdir(cwd) 432 | 433 | msifile = CFG_PACKAGE_NAME + "-" + CFG_BUILD + ".msi" 434 | move_file(exe_temp_dir + "/" + msifile, OUTPUT_DIR + "/" + msifile) 435 | -------------------------------------------------------------------------------- /pkg/Distribution-old.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Rust Compiler 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 31 | 37 | 38 | 39 | 43 | 44 | 45 | 49 | 50 | 51 | 55 | 56 | 57 | rustc.pkg 58 | cargo.pkg 59 | rust-docs.pkg 60 | uninstall.pkg 61 | 63 | 64 | -------------------------------------------------------------------------------- /pkg/Distribution.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | The Rust Compiler 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 27 | 32 | 38 | 39 | 40 | 44 | 45 | 46 | 50 | 51 | 52 | 56 | 57 | 58 | 62 | 63 | 64 | rustc.pkg 65 | cargo.pkg 66 | rust-docs.pkg 67 | rust-std.pkg 68 | uninstall.pkg 69 | 71 | 72 | -------------------------------------------------------------------------------- /pkg/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | source_dir="$(dirname "$0")" 4 | dest_dir="$2" 5 | package_id="$INSTALL_PKG_SESSION_ID" 6 | 7 | if [ -z "$source_dir" ]; then 8 | exit 1 9 | fi 10 | if [ -z "$dest_dir" ]; then 11 | exit 1 12 | fi 13 | if [ -z "$package_id" ]; then 14 | exit 1 15 | fi 16 | 17 | if [ "$package_id" = "org.rust-lang.uninstall" ]; then 18 | if [ ! -e "$dest_dir/lib/rustlib/uninstall.sh" ]; then 19 | exit 1 20 | fi 21 | sh "$dest_dir/lib/rustlib/uninstall.sh" 22 | else 23 | sh "$source_dir/install.sh" --prefix="$dest_dir" 24 | fi 25 | 26 | exit 0 27 | --------------------------------------------------------------------------------