Skip to content

Commit 64c8cbf

Browse files
authored
Merge pull request #1666 from emanuelbutacu/remove-msi
Remove MSI
2 parents 66563e7 + e40e42a commit 64c8cbf

21 files changed

+661
-1101
lines changed

Cargo.lock

+654-572
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ vendored-openssl = ['openssl/vendored']
2929
# Include in the default set to disable self-update and uninstall.
3030
no-self-update = []
3131

32-
# Used to change behavior of self-update and uninstall if installed via MSI
33-
msi-installed = []
34-
3532
[dependencies]
3633
rustup-dist = { path = "src/rustup-dist" }
3734
rustup-utils = { path = "src/rustup-utils" }
@@ -65,7 +62,7 @@ rustup-mock = { path = "src/rustup-mock", version = "1.1.0" }
6562
lazy_static = "1.0.0"
6663

6764
[workspace]
68-
members = ["src/rustup-win-installer"]
65+
members = ["src/download"]
6966

7067
[lib]
7168
name = "rustup"

appveyor.yml

+4-17
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ environment:
55
- TARGET: x86_64-pc-windows-msvc
66
ALLOW_PR: 1
77
- TARGET: i686-pc-windows-msvc
8-
- TARGET: i686-pc-windows-msvc
9-
BUILD_MSI: 1
10-
- TARGET: i686-pc-windows-gnu
11-
MINGW_DIR: mingw32
128
- TARGET: x86_64-pc-windows-gnu
139
MINGW_DIR: mingw64
10+
- TARGET: i686-pc-windows-gnu
11+
MINGW_DIR: mingw32
1412
access_token:
1513
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
1614
branches:
@@ -47,8 +45,6 @@ install:
4745
} else {
4846
Write-Host "MSYS2 not required" -ForegroundColor Green
4947
}
50-
- pwsh: |
51-
Install-Module Pester -Force
5248
5349
# Install rust, x86_64-pc-windows-msvc host
5450
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
@@ -64,10 +60,6 @@ install:
6460
# Add rustfmt support
6561
- rustup component add rustfmt
6662

67-
# set cargo features for MSI if requested (otherwise empty string)
68-
- set FEATURES=
69-
- if defined BUILD_MSI set FEATURES=--features msi-installed
70-
7163
# let's see what we got
7264
- where gcc rustc cargo
7365
- rustc -vV
@@ -77,15 +69,10 @@ install:
7769
build: false
7870

7971
test_script:
80-
- cargo build --release --target %TARGET% %FEATURES% --locked
72+
- cargo build --release --target %TARGET% --locked
8173
- cargo test --release -p rustup-dist --target %TARGET%
82-
- cargo test --release --target %TARGET% %FEATURES%
83-
- if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
84-
- if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd
74+
- cargo test --release --target %TARGET%
8575
- cargo fmt --all -- --check
86-
- pwsh: |
87-
$pesterOutputFile = 'src\rustup-win-installer\msi\PesterTestsResults.xml'
88-
Invoke-Pester -OutputFormat NUnitXml -OutputFile $pesterOutputFile
8976

9077
notifications:
9178
- provider: Webhook

ci/prepare-deploy-appveyor.ps1

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
2-
exit 0
2+
exit 0
33
}
44

55
if ($env:APPVEYOR_REPO_BRANCH -eq "auto") {
6-
exit 0
7-
}
8-
9-
# Don't do anything for MSI (yet)
10-
if ($env:BUILD_MSI) {
11-
exit 0
6+
exit 0
127
}
138

149
# Copy rustup-init to rustup-setup for backwards compatibility

src/rustup-cli/self_update.rs

-34
Original file line numberDiff line numberDiff line change
@@ -824,18 +824,6 @@ pub fn uninstall(no_prompt: bool) -> Result<()> {
824824
process::exit(1);
825825
}
826826

827-
if cfg!(feature = "msi-installed") {
828-
// Get the product code of the MSI installer from the registry
829-
// and spawn `msiexec /x`, then exit immediately
830-
let product_code = get_msi_product_code()?;
831-
Command::new("msiexec")
832-
.arg("/x")
833-
.arg(product_code)
834-
.spawn()
835-
.chain_err(|| ErrorKind::WindowsUninstallMadness)?;
836-
process::exit(0);
837-
}
838-
839827
let ref cargo_home = utils::cargo_home()?;
840828

841829
if !cargo_home
@@ -919,28 +907,6 @@ pub fn uninstall(no_prompt: bool) -> Result<()> {
919907
process::exit(0);
920908
}
921909

922-
#[cfg(not(feature = "msi-installed"))]
923-
fn get_msi_product_code() -> Result<String> {
924-
unreachable!()
925-
}
926-
927-
#[cfg(feature = "msi-installed")]
928-
fn get_msi_product_code() -> Result<String> {
929-
use winreg::enums::{HKEY_CURRENT_USER, KEY_READ};
930-
use winreg::RegKey;
931-
932-
let root = RegKey::predef(HKEY_CURRENT_USER);
933-
let environment = root.open_subkey_with_flags("SOFTWARE\\rustup", KEY_READ);
934-
935-
match environment {
936-
Ok(env) => match env.get_value("InstalledProductCode") {
937-
Ok(val) => Ok(val),
938-
Err(e) => Err(e).chain_err(|| ErrorKind::WindowsUninstallMadness),
939-
},
940-
Err(e) => Err(e).chain_err(|| ErrorKind::WindowsUninstallMadness),
941-
}
942-
}
943-
944910
#[cfg(unix)]
945911
fn delete_rustup_and_cargo_home() -> Result<()> {
946912
let ref cargo_home = utils::cargo_home()?;

src/rustup-win-installer/Cargo.toml

-20
This file was deleted.

src/rustup-win-installer/README.md

-11
This file was deleted.

src/rustup-win-installer/build.rs

-46
This file was deleted.

src/rustup-win-installer/msi/Completion.Tests.ps1

-21
This file was deleted.
-112 KB
Binary file not shown.
-145 KB
Binary file not shown.

src/rustup-win-installer/msi/build.ps1

-25
This file was deleted.
-601 KB
Binary file not shown.
-211 KB
Binary file not shown.
-361 KB
Binary file not shown.

0 commit comments

Comments
 (0)