You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Update status from "Draft" to "Implemented"
- Fix Code Sharing table: all install functions are in vite_setup::install,
not separate submodules
- Fix Dependency Graph: remove junction (indirect via vite_setup), add
actual deps (vite_path, owo-colors)
- Fix Customization submenu to match code (numbered items, no install dir)
- Replace winreg code sample with raw FFI description (matches implementation)
- Replace windows_sys DLL sample with raw FFI (matches implementation)
- Remove winreg from Binary Size Budget, add raw FFI note
- Fix Alternatives #4: raw FFI, not winreg
- Fix CI snippets: rename vite-init to vp-setup, update test workflow
to match actual test-vp-setup-exe job
- Mark Implementation Phases 1-3 as done, Phase 4 as future
// Broadcast WM_SETTINGCHANGE so other processes pick up the change
324
-
broadcast_settings_change();
325
-
}
326
-
Ok(())
327
-
}
328
-
```
308
+
1. Read current `HKCU\Environment\Path` via `RegQueryValueExW`
309
+
2. Check if bin dir is already present (case-insensitive, handles trailing backslash)
310
+
3. Prepend `%VP_HOME%\bin` if not present, write back via `RegSetValueExW` as `REG_EXPAND_SZ`
311
+
4. Broadcast `WM_SETTINGCHANGE` via `SendMessageTimeoutW` so other processes pick up the change
312
+
313
+
See `crates/vite_installer/src/windows_path.rs` for the full implementation.
329
314
330
315
### DLL Security (for download-folder execution)
331
316
332
-
Following rustup's approach — when the `.exe` is downloaded to `Downloads/` and double-clicked, malicious DLLs in the same folder could be loaded. Mitigations:
317
+
Following rustup's approach — when the `.exe` is downloaded to `Downloads/` and double-clicked, malicious DLLs in the same folder could be loaded. Two mitigations, both using raw FFI (no `windows-sys` crate):
333
318
334
319
```rust
335
-
//In build.rs — linker flags
320
+
// build.rs — linker-time: restrict DLL search at load time
Extend `test-standalone-install.yml` with new jobs:
415
+
`test-standalone-install.yml` includes a `test-vp-setup-exe` job that builds the installer from source and tests silent installation across three shells:
424
416
425
417
```yaml
426
-
test-init-exe:
418
+
test-vp-setup-exe:
419
+
name: Test vp-setup.exe (${{ matrix.shell }})
420
+
runs-on: windows-latest
427
421
strategy:
428
422
matrix:
429
-
shell: [cmd, pwsh, powershell, bash]
430
-
runs-on: windows-latest
423
+
shell: [cmd, pwsh, bash]
431
424
steps:
432
-
- name: Download vp-setup.exe
433
-
run: # download from artifacts or latest release
434
-
- name: Install (silent)
435
-
run: vp-setup.exe -y
425
+
- uses: actions/checkout@v4
426
+
- uses: oxc-project/setup-rust@v1
427
+
- name: Build vp-setup.exe
428
+
run: cargo build --release -p vite_installer
429
+
- name: Install via vp-setup.exe (silent)
430
+
run: ./target/release/vp-setup.exe -y
431
+
env:
432
+
VP_VERSION: alpha
436
433
- name: Verify installation
437
434
run: |
438
435
vp --version
439
436
vp --help
440
437
```
441
438
439
+
The workflow triggers on changes to `crates/vite_installer/**` and `crates/vite_setup/**`.
440
+
442
441
## Code Signing
443
442
444
443
Windows Defender SmartScreen flags unsigned executables downloaded from the internet. This is a significant UX problem for a download-and-run installer.
@@ -462,9 +461,10 @@ Key dependencies and their approximate contribution:
Note: Windows registry access uses raw FFI (~0 KB overhead) instead of the `winreg` crate, following the same zero-dependency pattern as `vite_trampoline`.
467
+
468
468
Use `opt-level = "z"` (optimize for size) in package profile override, matching the trampoline approach.
469
469
470
470
## Alternatives Considered
@@ -490,42 +490,44 @@ Like rustup, make `vp.exe` detect when called as `vp-setup.exe` and switch to in
490
490
491
491
Embed the PowerShell script in a self-extracting exe. Fragile, still requires PowerShell runtime.
492
492
493
-
### 4. Use `winreg` vs PowerShell for PATH (Decision: `winreg`)
493
+
### 4. Use `winreg` Crate vs Raw FFI for PATH (Decision: Raw FFI)
494
494
495
-
- `winreg` crate: Direct registry API, no subprocess, reliable
- Raw Win32 FFI: Zero external dependencies, matches `vite_trampoline` pattern, slightly more code
496
497
- PowerShell subprocess: Proven in `install.ps1` but adds process spawn overhead and PowerShell dependency
497
-
- Decision: Use `winreg` for direct registry access — the whole point of the exe installer is to not depend on PowerShell
498
+
- Decision: Use raw FFI for direct registry access — keeps the installer dependency-free for Win32 operations, consistent with the trampoline's approach
498
499
499
500
## Implementation Phases
500
501
501
-
### Phase 1: Extract `vite_setup` Library
502
+
### Phase 1: Extract `vite_setup` Library (done)
502
503
503
-
- Create `crates/vite_setup/Cargo.toml`
504
-
- Move shared code from `vite_global_cli/src/commands/upgrade/` into `vite_setup`
505
-
- Update `vite_global_cli` to import from `vite_setup`
506
-
- Run existing tests to verify no regressions
504
+
- Created `crates/vite_setup/` with `platform`, `registry`, `integrity`, `install` modules
505
+
- Moved shared code from `vite_global_cli/src/commands/upgrade/` into `vite_setup`
506
+
- Updated `vite_global_cli` to import from `vite_setup`
0 commit comments