Can't reinstall Jenkins after uninstall on Windows 10

I had an issue downloading plugins for Jenkins, so I uninstalled Jenkins to reinstall it. During the 2nd install, the msi fails when trying to start the service. I’m using the same user from when I installed the first time when the service started properly. I’m not sure why it fails trying to install this time around.

Hi Byron,

I think we are going to need a bit more information. Are you saying its not installing? or that its not clearing your data when you reinstall?

The data gets persisted to %JENKINS_HOME% (I’m not familiar with windows, but I think that’s c:\jenkins?), and would survive an uninstall. Easiest way is to stop the service, delete that directory, and start the service, that’ll give you a brand new install to work with.

Hi Gavin,

Thanks for the reply! I’m trying to do a reinstall. I uninstalled Jenkins and deleted that folder (c:\jenkins). The service is no longer installed as well. When I go to reinstall Jenkins, the installer tries to start the service (installer displays “Starting service…”) then fails. The user I’m using to start the service previously started the service, so I know that user has permission to start services. Not sure what I’m missing.

Hey Byron C. I’m kind of a noob with Jenkins but have you thought about instead of running the installer, maybe executing the .war file from command line.

I believe the command is:
java -jar “.\jenkins.war” --httpPort=8080

I ended up making a batch file that executes this and I run that batch file as an administrator.

Launching from tbe command line is a pain since the cmd window must remain open or Jenkins dies.

Going from.memory…

On top of the directory with the binary in it, Jenkins from the command line, will install the configuration, jobs, etc. into C:\Users\Owner\.jenkins. If installed as a System User, it will go in C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins, and if installed under another Privileged User, then I believe it’s in C:\Users\Service_Acct\AppData\Local\Jenkins\.jenkins. It’s this directory it keeps redetecting.

To uninstall, you need to stop the service, delete the service (SC DELETE jenkins) (make sure it’s gone), uninstall the app and delete the above data directory (you may wish to preserve your jobs sub-dir).

Then you should be able to reinstall.

I haven’t tried installing from the cmd line. However, I have tried to install with the LocalSystem instead of a local user. The installer still isn’t able to start the service. I know I have permission to start & stop services on my laptop because I’ve done multiple times before. I attached the screenshot of the error I get when I try to install. Before I tried the last install, I made sure to delete all the Jenkins folders I could find to make sure there was no remnants of the previous install.