Skip to content
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

Reinstalling MSI does not create service #1368

Closed
jantari opened this issue Dec 22, 2023 · 4 comments
Closed

Reinstalling MSI does not create service #1368

jantari opened this issue Dec 22, 2023 · 4 comments
Labels
Milestone

Comments

@jantari
Copy link

jantari commented Dec 22, 2023

When the MSI installer is re-run to do an in-place reinstall or "repair", it does not recreate the windows_exporter service if missing.

Steps to reproduce:

# Perform initial install of the latest version
choco install prometheus-windows-exporter.install --version 0.24.0
# Confirm service is created and running
Get-Service -Name windows_exporter
# Stop and delete the service
sc.exe stop windows_exporter
sc.exe delete windows_exporter
# Oops! But no worries, perform a reinstall to fix it
choco install prometheus-windows-exporter.install --version 0.24.0 --force
# Check whether the service has been recreated - it will not be there!
Get-Service -Name windows_exporter

I have noticed that the service is recreated as expected when:

  • Performing an upgrade install, such as when installing 0.23.1, then deleting the service, then installing 0.24.0
  • Performing an explicit uninstall first, then an install again
Copy link

This issue has been marked as stale because it has been open for 90 days with no activity. This thread will be automatically closed in 30 days if no further activity occurs.

@github-actions github-actions bot added the Stale label Mar 22, 2024
@jtomkiew-mng
Copy link

Boop. Can confirm this is still a problem on version 0.25.1. Would be nice if service was re-registered on reinstall.

@jantari
Copy link
Author

jantari commented Mar 25, 2024

Yep, I reproduced with 0.25.1 as well. Here's a copy-paste repro without chocolatey, just using onboard windows stuff:

# Download windows_exporter 0.25.1
curl.exe -LO "https://github.com/prometheus-community/windows_exporter/releases/download/v0.25.1/windows_exporter-0.25.1-amd64.msi"

# Install it
cmd.exe /D /C start "" /wait /b msiexec.exe /i "windows_exporter-0.25.1-amd64.msi" /qn

# Confirm windows_exporter service exists
sc.exe queryex windows_exporter

# Remove windows_exporter service
sc.exe stop windows_exporter
sc.exe delete windows_exporter

# Reinstall windows_exporter to repair
cmd.exe /D /C start "" /wait /b msiexec.exe /i "windows_exporter-0.25.1-amd64.msi" /qn

# Confirm windows_exporter service exists
sc.exe queryex windows_exporter

# IT'S NOT THERE

Only way to bring the service back is to completely uninstall windows_exporter, and then reinstall.

@github-actions github-actions bot removed the Stale label Mar 26, 2024
@jkroepke jkroepke added this to the v0.26.0 milestone May 6, 2024
@jkroepke
Copy link
Member

jkroepke commented May 11, 2024

It seems like it worked as expected, because that an internal windows installer behavior.

Windows Installer mostly does nothing on reinstall. To restore an installation, you have to force a repair mode.

with

msiexec.exe /fa "windows_exporter-0.26.0-amd64.msi" /qn

the service is getting restored. I tested that on a windows server. Sadly, we are unable to change the windows installer behavior here.

@jkroepke jkroepke closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants