microsoft / ebpf-for-windows

eBPF implementation that runs on top of Windows
MIT License
2.85k stars 217 forks source link

`setup-ebpf.ps1 -Uninstall` fails after recompilation #3760

Open lmb opened 1 month ago

lmb commented 1 month ago

Describe the bug

setup-ebpf.ps1 is not able to uninstall arbitrary efW .msi package. It can only uninstall the identical .msi.

OS information

No response

Steps taken to reproduce bug

  1. Compile, install via setup-ebpf.ps1
  2. Recompile
  3. Executing setup-ebpf.ps1 -Uninstall

Expected behavior

setup-ebpf.ps1 -Uninstall should succeed even if the source code was recompiled.

Actual outcome

setup-ebpf.ps1 -Uninstall fails with:

.\x64\Debug\setup-ebpf.ps1 -Uninstall
PSScriptRoot is C:\Users\lmbauer\ebpf-for-windows\x64\Debug
WorkingDirectory is C:\Users\lmbauer\ebpf-for-windows\x64\Debug
Uninstalling eBPF MSI package at 'msiexec.exe /x C:\Users\lmbauer\ebpf-for-windows\x64\Debug\ebpf-for-windows.msi /qn /norestart /l*v msi-uninstall.log'...
Uninstallation FAILED. Exit code: 1638
MSI uninstallation FAILED. Exit code: 1638.
At C:\Users\lmbauer\ebpf-for-windows\x64\Debug\setup-ebpf.ps1:45 char:9
+         throw ("MSI uninstallation FAILED. Exit code: $($process.Exit ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (MSI uninstallat...xit code: 1638.:String) [], RuntimeException
    + FullyQualifiedErrorId : MSI uninstallation FAILED. Exit code: 1638.

Additional details

No response

shankarseal commented 1 month ago

The setup script should try to uninstall using the cached MSI.