Skip to content

Remove MSI #1666

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,226 changes: 654 additions & 572 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ vendored-openssl = ['openssl/vendored']
# Include in the default set to disable self-update and uninstall.
no-self-update = []

# Used to change behavior of self-update and uninstall if installed via MSI
msi-installed = []

[dependencies]
rustup-dist = { path = "src/rustup-dist" }
rustup-utils = { path = "src/rustup-utils" }
Expand Down Expand Up @@ -65,7 +62,7 @@ rustup-mock = { path = "src/rustup-mock", version = "1.1.0" }
lazy_static = "1.0.0"

[workspace]
members = ["src/rustup-win-installer"]
members = ["src/download"]

[lib]
name = "rustup"
Expand Down
21 changes: 4 additions & 17 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ environment:
- TARGET: x86_64-pc-windows-msvc
ALLOW_PR: 1
- TARGET: i686-pc-windows-msvc
- TARGET: i686-pc-windows-msvc
BUILD_MSI: 1
- TARGET: i686-pc-windows-gnu
MINGW_DIR: mingw32
- TARGET: x86_64-pc-windows-gnu
MINGW_DIR: mingw64
- TARGET: i686-pc-windows-gnu
MINGW_DIR: mingw32
access_token:
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
branches:
Expand Down Expand Up @@ -47,8 +45,6 @@ install:
} else {
Write-Host "MSYS2 not required" -ForegroundColor Green
}
- pwsh: |
Install-Module Pester -Force

# Install rust, x86_64-pc-windows-msvc host
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
Expand All @@ -64,10 +60,6 @@ install:
# Add rustfmt support
- rustup component add rustfmt

# set cargo features for MSI if requested (otherwise empty string)
- set FEATURES=
- if defined BUILD_MSI set FEATURES=--features msi-installed

# let's see what we got
- where gcc rustc cargo
- rustc -vV
Expand All @@ -77,15 +69,10 @@ install:
build: false

test_script:
- cargo build --release --target %TARGET% %FEATURES% --locked
- cargo build --release --target %TARGET% --locked
- cargo test --release -p rustup-dist --target %TARGET%
- cargo test --release --target %TARGET% %FEATURES%
- if defined BUILD_MSI pushd src\rustup-win-installer && cargo build --release --target %TARGET% & popd
- if defined BUILD_MSI pushd src\rustup-win-installer\msi && powershell .\build.ps1 -Target %TARGET% & popd
- cargo test --release --target %TARGET%
- cargo fmt --all -- --check
- pwsh: |
$pesterOutputFile = 'src\rustup-win-installer\msi\PesterTestsResults.xml'
Invoke-Pester -OutputFormat NUnitXml -OutputFile $pesterOutputFile

notifications:
- provider: Webhook
Expand Down
9 changes: 2 additions & 7 deletions ci/prepare-deploy-appveyor.ps1
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
exit 0
exit 0
}

if ($env:APPVEYOR_REPO_BRANCH -eq "auto") {
exit 0
}

# Don't do anything for MSI (yet)
if ($env:BUILD_MSI) {
exit 0
exit 0
}

# Copy rustup-init to rustup-setup for backwards compatibility
Expand Down
34 changes: 0 additions & 34 deletions src/rustup-cli/self_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,18 +824,6 @@ pub fn uninstall(no_prompt: bool) -> Result<()> {
process::exit(1);
}

if cfg!(feature = "msi-installed") {
// Get the product code of the MSI installer from the registry
// and spawn `msiexec /x`, then exit immediately
let product_code = get_msi_product_code()?;
Command::new("msiexec")
.arg("/x")
.arg(product_code)
.spawn()
.chain_err(|| ErrorKind::WindowsUninstallMadness)?;
process::exit(0);
}

let ref cargo_home = utils::cargo_home()?;

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

#[cfg(not(feature = "msi-installed"))]
fn get_msi_product_code() -> Result<String> {
unreachable!()
}

#[cfg(feature = "msi-installed")]
fn get_msi_product_code() -> Result<String> {
use winreg::enums::{HKEY_CURRENT_USER, KEY_READ};
use winreg::RegKey;

let root = RegKey::predef(HKEY_CURRENT_USER);
let environment = root.open_subkey_with_flags("SOFTWARE\\rustup", KEY_READ);

match environment {
Ok(env) => match env.get_value("InstalledProductCode") {
Ok(val) => Ok(val),
Err(e) => Err(e).chain_err(|| ErrorKind::WindowsUninstallMadness),
},
Err(e) => Err(e).chain_err(|| ErrorKind::WindowsUninstallMadness),
}
}

#[cfg(unix)]
fn delete_rustup_and_cargo_home() -> Result<()> {
let ref cargo_home = utils::cargo_home()?;
Expand Down
20 changes: 0 additions & 20 deletions src/rustup-win-installer/Cargo.toml

This file was deleted.

11 changes: 0 additions & 11 deletions src/rustup-win-installer/README.md

This file was deleted.

46 changes: 0 additions & 46 deletions src/rustup-win-installer/build.rs

This file was deleted.

21 changes: 0 additions & 21 deletions src/rustup-win-installer/msi/Completion.Tests.ps1

This file was deleted.

Binary file removed src/rustup-win-installer/msi/banner.bmp
Binary file not shown.
Binary file removed src/rustup-win-installer/msi/banner.xcf
Binary file not shown.
25 changes: 0 additions & 25 deletions src/rustup-win-installer/msi/build.ps1

This file was deleted.

Binary file removed src/rustup-win-installer/msi/dialogbg.bmp
Binary file not shown.
Binary file removed src/rustup-win-installer/msi/dialogbg.xcf
Binary file not shown.
Binary file removed src/rustup-win-installer/msi/rust-logo.ico
Binary file not shown.
Loading