Windows shell replacement in Rust: taskbar, file manager, NTFS search, task manager, disk cleaner. One installer exe.
Rust
Installer: shell switch (rust-explorer) in the topbar settings panel, gear available before install
Lemxyc255986b8348
diff --git a/README.md b/README.mdindex 776ec13..578ddd4 100644--- a/README.md+++ b/README.md@@ -14,7 +14,7 @@ English | [Русский](README.ru.md)1. Download `WinRust.exe` from the [latest release](https://github.com/Lemxy/WinRust/releases/latest) (Windows 10/11, x64).2. Run it as administrator.-3. Tick the components you want and press the install button. On a fresh install, `rust-explorer` is unchecked. Tick it to replace the Windows Explorer shell. They are installed in the right order; one that fails or is skipped does not stop the others, the window lists what went wrong.+3. Tick the components you want and press the install button. On a fresh install, `rust-explorer` is unchecked. Tick it to replace the Windows Explorer shell (or use the gear on the topbar row: the **Shell: rust-explorer** switch). They are installed in the right order; one that fails or is skipped does not stop the others, the window lists what went wrong.Windows Search is optional: on a stripped Windows (for example a debloated LTSC image without the Windows Search service) that step is skipped with a warning instead of failing the install.diff --git a/README.ru.md b/README.ru.mdindex 4f899a8..e6ac42e 100644--- a/README.ru.md+++ b/README.ru.md@@ -14,7 +14,7 @@1. Скачайте `WinRust.exe` из [последнего релиза](https://github.com/Lemxy/WinRust/releases/latest) (Windows 10/11, x64).2. Запустите от имени администратора.-3. Отметьте галочками нужные компоненты и нажмите кнопку установки. При первой установке `rust-explorer` не отмечен. Отметьте его, если хотите заменить оболочку Проводника Windows. Они ставятся в правильном порядке; упавший или пропущенный компонент не останавливает остальные, окно покажет, что пошло не так.+3. Отметьте галочками нужные компоненты и нажмите кнопку установки. При первой установке `rust-explorer` не отмечен. Отметьте его, если хотите заменить оболочку Проводника Windows (или переключатель **Оболочка: rust-explorer** в шестерёнке строки topbar). Они ставятся в правильном порядке; упавший или пропущенный компонент не останавливает остальные, окно покажет, что пошло не так.Поиск Windows необязателен: в урезанной Windows (например, LTSC-образ без службы Windows Search) этот шаг пропускается с предупреждением, а не ломает установку.diff --git a/src/ui.rs b/src/ui.rsindex 60aadbe..1cdf648 100644--- a/src/ui.rs+++ b/src/ui.rs@@ -114,6 +114,7 @@ pub(crate) const ID_CANCEL: usize = 3;pub(crate) const ID_SWITCH: usize = 4;pub(crate) const ID_GEAR: usize = 5;pub(crate) const ID_LANG: usize = 6; // EN / RU switch+pub(crate) const ID_SHELL: usize = 7; // settings panel: replace Explorer with rust-explorerpub(crate) const ID_CHECK: usize = 100; // + plugin index: the row's checkboxpub(crate) const STARTING: usize = usize::MAX - 1; // JOB before install_all picks its first component@@ -156,6 +157,17 @@ pub(crate) fn switch_box(w: f32) -> Box4 {[d[2] - 24.0 - 16.0 - 44.0, d[1] + 78.0 + 23.0, d[2] - 24.0 - 16.0, d[1] + 78.0 + 47.0]}+/// Second switch row of the settings panel: which shell to install.+pub(crate) fn shell_switch_box(w: f32) -> Box4 {+ let b = switch_box(w);+ [b[0], b[1] + 80.0, b[2], b[3] + 80.0]+}++/// Index of rust-explorer in PLUGINS.+fn explorer_idx() -> Option<usize> {+ PLUGINS.iter().position(|p| p.name == crate::selection::RUST_EXPLORER)+}+/// The EN / RU switch in the top right corner of the header.pub(crate) fn lang_box(w: f32) -> Box4 {[w - M - 96.0, 18.0, w - M, 18.0 + 30.0]@@ -279,7 +291,7 @@ pub(crate) unsafe fn paint(hwnd: HWND) {let short = desc.split(". ").next().unwrap_or(desc).trim_end_matches('.');ui.text(short, [nx, r[1] + 32.0, pb[0] - 10.0, r[3] - 10.0], 12.0, 400, DIM, DT_LEFT | DT_SINGLELINE | DT_END_ELLIPSIS);- if let Some((_, gb)) = gear.filter(|&(gi, _)| gi == i && installed) {+ if let Some((_, gb)) = gear.filter(|&(gi, _)| gi == i) {let h = hot(ID_GEAR) && !busy;ui.round(gb, 8.0, if h { lerp(PANEL, TEXT, 0.08) } else { PANEL }, BORDER);ui.text_in("\u{E713}", gb, 14.0, 400, if busy { DIM } else { TEXT }, DT_CENTER | DT_VCENTER | DT_SINGLELINE, winrust_common::style::icon_face());@@ -384,6 +396,16 @@ pub(crate) unsafe fn paint(hwnd: HWND) {ui.round(sw, 12.0, track, track);let kx = if hid { sw[2] - 12.0 } else { sw[0] + 12.0 };ui.round([kx - 8.0, sw[1] + 4.0, kx + 8.0, sw[3] - 4.0], 8.0, TEXT, TEXT);+ let row2 = [row[0], row[1] + 80.0, row[2], row[3] + 80.0];+ let on = explorer_idx().is_some_and(|e| SELECTED[e].load(Relaxed));+ ui.round(row2, 10.0, PANEL, BORDER);+ ui.text(t!("Оболочка: rust-explorer", "Shell: rust-explorer"), [row2[0] + 16.0, row2[1] + 10.0, row2[2] - 80.0, row2[1] + 32.0], 14.0, 600, TEXT, DT_LEFT | DT_SINGLELINE | DT_VCENTER);+ ui.text(t!("Включено: заменить Проводник. Выключено: остаётся стандартный Проводник Windows.", "On: replace Explorer. Off: the standard Windows Explorer stays."), [row2[0] + 16.0, row2[1] + 32.0, row2[2] - 80.0, row2[3] - 6.0], 12.0, 400, DIM, DT_LEFT | DT_WORDBREAK);+ let sw2 = shell_switch_box(w);+ let track2 = if on { ACCENT } else { off };+ ui.round(sw2, 12.0, track2, track2);+ let kx2 = if on { sw2[2] - 12.0 } else { sw2[0] + 12.0 };+ ui.round([kx2 - 8.0, sw2[1] + 4.0, kx2 + 8.0, sw2[3] - 4.0], 8.0, TEXT, TEXT);button(&ui, closeb, t!("Закрыть", "Close"), 1, hot(ID_CANCEL));}@@ -423,7 +445,7 @@ pub(crate) unsafe fn hit(hwnd: HWND, lp: isize) -> Option<usize> {let inside = |b: Box4| x >= b[0] * s && x <= b[2] * s && y >= b[1] * s && y <= b[3] * s;if SETTINGS.get().is_some() {let (_, _, closeb) = dialog_boxes(w);- return if inside(switch_box(w)) { Some(ID_SWITCH) } else if inside(closeb) { Some(ID_CANCEL) } else { None };+ return if inside(switch_box(w)) { Some(ID_SWITCH) } else if inside(shell_switch_box(w)) { Some(ID_SHELL) } else if inside(closeb) { Some(ID_CANCEL) } else { None };}if DIALOG.with_borrow(|d| d.is_some()) {let (_, cancel, ok) = dialog_boxes(w);@@ -432,7 +454,7 @@ pub(crate) unsafe fn hit(hwnd: HWND, lp: isize) -> Option<usize> {if BUSY.load(Relaxed) {return None;}- if gear_box(w).is_some_and(|(i, b)| INSTALLED[i].load(Relaxed) && inside(b)) {+ if gear_box(w).is_some_and(|(_, b)| inside(b)) {return Some(ID_GEAR);}if let Some(i) = ready().enumerate().find_map(|(k, i)| inside(check_box(k, w).1).then_some(i)) {@@ -519,6 +541,10 @@ pub(crate) unsafe fn click(hwnd: HWND, id: usize) {if let Err(e) = set_od_hidden(!od_hidden()) {*MSG.lock().unwrap() = (tf!("Ошибка: {e}", "Error: {e}"), false);}+ } else if id == ID_SHELL {+ if let Some(e) = explorer_idx() {+ SELECTED[e].fetch_xor(true, Relaxed);+ }} else if id == ID_CANCEL {SETTINGS.set(None);}