Upgrade/reinstall Elasticsearch as a service in W10 - elasticsearch

I have ES 7.10.2 installed as a service in W10.
Looking at some very cursory notes I seem to have made, I installed this by going
...\bin>elasticsearch-service.bat install
So I just downloaded the .zip for 7.16.3 (please don't ask why I don't yet want to move to 8!).
I stopped the existing 7.10.2 service, which is called "elasticsearch-service-x64"
In the unzipped 7.16.3 directory I went
...\bin> elasticsearch-service.bat install
I get a screen saying "do you want to do this as admin" --> Yes
I get the following failure:
D:\apps\ElasticSearch\elasticsearch-7.16.3\bin>elasticsearch-service.bat install Installing service : "elasticsearch-service-x64" Using ES_JAVA_HOME (64-bit): "D:\apps\ElasticSearch\elasticsearch-7.16.3\jdk" -Des.networkaddress.cache.ttl=60;-Des.networkaddress.cache.negative.ttl=10;-XX:+AlwaysPreTouch;-Xss1m;-Djava.awt.headless=true;-Dfile.encoding=UTF-8;-Djna.nosys=true;-XX:-OmitStackTraceInFastThrow;-XX:+ShowCodeDetailsInExceptionMessages;-Dio.netty.noUnsafe=true;-Dio.netty.noKeySetOptimization=true;-Dio.netty.recycler.maxCapacityPerThread=0;-Dio.netty.allocator.numDirectArenas=0;-Dlog4j.shutdownHookEnabled=false;-Dlog4j2.disable.jmx=true;-Dlog4j2.formatMsgNoLookups=true;-Djava.locale.providers=SPI,COMPAT;--add-opens=java.base/java.io=ALL-UNNAMED;-Xms1g;-Xmx1g;-XX:+UseG1GC;-XX:G1ReservePercent=25;-XX:InitiatingHeapOccupancyPercent=30;-Djava.io.tmpdir=C:\Users\Chris\AppData\Local\Temp\elasticsearch;-XX:+HeapDumpOnOutOfMemoryError;-XX:HeapDumpPath=data;-XX:ErrorFile=logs/hs_err_pid%p.log;-Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m;-XX:MaxDirectMemorySize=536870912;-XX:G1HeapRegionSize=4m
Failed installing 'elasticsearch-service-x64' service
yup, NOTHING ELSE. Spectacularly informative. To be fair, there may be some log output somewhere... But I have obviously have no idea where I might find that.
In a way I am not surprised that this failed to be installed, as there is already an existing service called "elasticsearch-service-x64", and just because it is stopped this wouldn't stop installing a new one with the same name being a problem. Can we install ES with a custom name??? (such as "elasticsearch-service-7.16.3"? Oh how helpful that might be).
But I am EXTREMELY nervous about, for example, uninstalling/deleting the present ES service 7.10.2, which does at least work. I am far from convinced that re-installing it would be trivial.
This time I intend to make many many more notes.
Has anyone had this experience? What do I do?

Anyone else ever wanting to upgrade this:
All the following was done in W10 as Admin:
I wondered if it was possible to change the path to the executable. Found this.
I stopped the ES service. Then I did this:
sc config elasticsearch-service-x64 binPath= "D:\...\elasticsearch-7.16.3\bin\bin\elasticsearch-service-x64.exe"
This said "success". The W10 "Services" dialog showed that the "path to executable" had indeed been changed.
But the service wouldn't start.
Then I tried to switch back to 7.10.2 using the above method. Again it wouldn't start. At least this meant I had no choice but to uninstall and reinstall, which is what I did:
sc delete elasticsearch-service-x64
In the 7.16.3 bin directory:
...>elasticsearch-service.bat install
... success! 7.16.3 installed as service elasticsearch-service-x64. Also starts.

Related

I install the Neo4j service. Which files are they exactly and where are they?

From Windows installation - Operations Manual:
Neo4j can also be run as a Windows service. Install the service with bin\neo4j install-service, and start it with bin\neo4j start.
But where is the service installed? Googling with the query where is neo4j service installed doesn't give any meaningful result.
This question is about installing Neo4j as windows service in Windows OS. What you missed is the first step in installing Neo4j. In step 3 of topic 1 of Windows Installation, it says;
Right-click the downloaded file, click Extract All.
So when you do that step, it will prompt you where you would want the installation will be. It is not that clear where the location of the installation because you have to go thru the entire installation process to see it.

Restarting windows service during WIX upgrade

We have a windows service installed as a part of our msi WIX installer . During upgrade we are trying to just restart service instead of doing complete reinstall to safe guard the service user creds.
A lot of posts discussed in this regard but nothing is conclusive.
Tried out disabling DeleteServices during upgrade by doing below,
<InstallExecuteSequence>
<DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices>
</InstallExecuteSequence>
Note: The above code is in old MSI as well
But still saw service getting actually deleted and reinstalled. Tried disabling installservice during upgrade as below
<InstallServices>NOT WIX_UPGRADE_DETECTED</InstallServices>
But service is in stopped state and installer fails in action, ExecServiceConfig with code 1603 since service is not in running state.
Any pointers on this will be helpful
I wrote an answer for something similar (I think) a while back: Wix: Windows Service sometimes uninstalled when upgrading. Please read that link for several, different suggestions.
Minor Upgrade: In addition to the options in the linked answer, you can use a minor upgrade as well - if that is at all a viable option. In a minor upgrade the product is not uninstalled and then reinstalled, but rather upgraded "in-place". For minor upgrades to work you need to follow the component rules to the letter - which can be hard to do, but you can then definitely upgrade without losing your service creds. See bottom here for how a minor upgrade is applied. And I will just link to an answer with a little bit of info on late REP.
Permanent Component: As the linked answer above states, you can set the component with the service configuration settings to be permanent. In this case it will never be uninstalled during upgrade, but not during a real uninstall either. Accordingly you have to manually clean out the service installation and file installation on "real" uninstall (as opposed to a major upgrade initiated uninstall which sets UPGRADINGPRODUCTCODE). Sort of an easy approach that I don't really like that much.
(Managed) Service Accounts: Not something I have used, but the newer concept of managed service accounts as described in the above, linked answer could be investigated? Step-by-step.
Late REP / Service MSI: Scheduling RemoveExistingProducts correctly late means your service should not be uninstalled during upgrade scenarios (see the linked answer for details). It can be hard to follow all component rules to the letter, but you can ease that by putting your service in its own, minimal service installation MSI, and then installing via a WiX Burn bundle (installing MSI files in sequence).
As stated several times, please do read this similar answer: Wix: Windows Service sometimes uninstalled when upgrading.

Why won't neo4j CE 3.0.3 start a second time on Windows 7?

This is incredibly strange to me. Neo4j won't start a second time unless I restart Windows.
I installed neo4j Community Edition 3.0.3 on 64-bit Windows 7 and followed this youtube tutorial https://www.youtube.com/watch?v=Foj2tzq84DY. The tutorial was embedded in neo4j's site https://neo4j.com/download-thanks/?edition=community&flavour=winstall64&release=3.0.3&_ga=1.203356307.385208157.1468345542. Even thought the video lists 2.3 it's linked by Neo4j 3.0.3 download and worked fine for 3.0.3.
Everything worked like a charm. I played around with it for a while and things worked fine. I then shut it down, by clicking on stop in the little gui launcher. When I tried to start it up again, through the start menu, nothing seems to happen at all. I went into the Neo4j CE 3.0.3\bin directory and tried running from there, but I see no error messages, no log directory, no error dialog. I just seems to do nothing. I've also tried "neo4j-ce.exe start" and "neo4j-ce.exe restart". Nothing seems to work.
I checked windows services and didn't see any services starting with neo4j. Don't know if default setup runs it as a service, but if so, maybe it's under something else?
I have been able to get things to start up if I restart Windows, but that's a royal pain and cannot imagine that's intentional.
I do see that there's a jar in the bin directory, so I imagine I could start it with a java command, but I don't know the specifics. However, it's most disconcerting that there is no error message at all. I imagine that something didn't shut down properly, but at this point I have no idea what might be going wrong.
Any help is greatly appreciated.
I don't know if this is a bug with the launcher for the community edition of neo4j on windows 7 or not, but what I've found is that when you close the launcher dialog, it does not kill the neo4j-ce process. Thus, since the process is already running, albeit in a stopped state, it won't start again. The challenge there is, of course, that the dialog is gone and you can't click the start button to essentially connect to a database.
The solution is to go into Task Manager and end the "neo4j-ce.exe" process.
Once that is done you can start Neo4j normally.

Microsoft Fix It Registry issue

I had a program that starts up a Windows Service when installed and deleted that Windows Service when uninstalled. However it refused to uninstall after I modified the installer by accident (my fault!). I couldn't even remove it from Programs and Features as it kept throwing an error 2715. I found this article that had a FixIt program: https://support.microsoft.com/en-us/mats/program_install_and_uninstall
Using that, I managed to finally remove the program itself. Now however, when I try installing and uninstalling it again (to test my changes), the Windows Service that's attached doesn't get removed. In fact, it continues running. I checked the registry and indeed the key for the service is still there after the uninstall. I would need to manually stop it and do a sc delete to get rid of it. Any idea on how I can solve this?
Edit: I am able to replicate the issue on another computer. What I do is, I install the program there, and use the Fix It tool to remove it. Once this is done, I can easily replicate the issue as the service is never deleted after uninstalling. It works fine prior to this.
Some guesswork here because there's not enough info....
Eroor 2715 is a Windows Installer error, and I suspect it's related to you running a program (as you describe it) to start and stop services. I'm guessing that you run it as a cuatom action, and on uninstall you attempt to run it but it's missing because it's been uininstalled.
So:
That fixit cure is not for a broken MSI (which yours is) - it's for fixing corrupt registry data that prevents uninstall, not fixing a broken MSI uninstall.
You don't need to run code to start and stop and delete services. Most MSI-building tools have support to the the Windows Installer functionalty that does this for you, so stop doing it!
A more specific answer is difficult without knowing what you are using to build your MSI with, and how you're running your program, but the signs point to you running the program after it's been removed, and even if you get the program running properly there's no way to tell whether it is correct without seeing the code. But 2 is what you should be doing anyway.

Detect if MongoDB is installed on windows

I need to detect if MongoDB is installed on a Windows machine in my app installer.
Does anyone know what I can look for in the registry to be sure it is installed?
I've searched the entire registry and researched on SO and google for hours. Mongo registry entries are using GUID keys, so these change per install and I don't think I can find it this way in innosetup.
I'm hoping someone has already solved this problem and can help me so I don't have to spend more hours reinventing the wheel. Thanks to anyone with useful information.
The default installation directory for MongoDB on Windows would be: C:\Program Files\MongoDB
Reference: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
Also, Detecting installed programs via registry for the registry angle!
For more information, google!
Open the command prompt and type "cd c:\program files\mongodb\server\your version\bin". After you enter the bin folder type "mongo start". If you get either a successful connection or failed one it means it's installed at least.
The problem is that the user could have installed MongoDB via a zip file -- so there wont be any trace of the installation in the registry at all. You could go the extra mile and try to connect to the standard 27017 port and try to get a status, but what if mongodb is not running at the moment? There is no good answer here -- simply ask the user if he has MongoDB installed and whats the directory. Its not very "automated" but in this case, it is more reliable and less problematic.
Searching for the file mongod.exe in all the files might work in this case, if user has installed from zip file still this method will work.

Resources