Upgrade (unisntall/install) Windows Service using InstallShield Setup Project - windows-services

My question, is there a way to configure the InstallShield setup and deployment project so that when I attempt to install the service it will uninstall the previously installed version of the service.
I've created a Windows Service and an InstallShield setup and deployment project to be able to install it onto my machine. The process of installing and uninstalling the service all works fine. When I go to update the service, at the moment, I need to stop the service, uninstall the service manually, and then run the installer. What I am trying to get to is a point where I can run the installer and it will uninstall the previous version of the service before installing the current version.
I have seen this process of running the install and having the previous versions uninstalled work. Through creating a test project using a windows form application. I was able to install the application. Then I: incremented the product version, created a new product code, added a new upgrade entry in the upgrade path area, and configured that upgrade entry setting the min and max version. After doing this, I rebuilt the setup project and ran the installer and the upgrade from version A to version B was complete.
The only difference I believe from the original test project (where I saw the process work) and my Windows Service project is that my test project was a Windows Forms application versus a Windows Service. In all the research I have been doing I have seen people ask similar questions, but I have not seen any real suggestions on what actions to take. So if anyone knows if this is possible or has any suggestions that I could try to accomplish this task they would be greatly appreciated.

I was able to resolve this issue, so it is possible. The setting I mentioned above are the correct settings needed to allow the service to update. This was just a case of human error that was causing my problems.

Related

Upgrade Jenkins on CentOS

I am trying to upgrade Jenkins from version 2.176.1 to 2.375.2. I tried two methods and both of them failed.
Method-1: Download the jenkins.war and copy it into /usr/lib/jenkins/ directory by replacing the original one. After copying, when I restart Jenkins, it simply fails to restart.
Method-2: Upgrade Jenkins' RPM using yum update jenkins. This command runs successfully and process exists without any error. But, again when I restart Jenkins, it fails to start.
CentOS version: CentOS-7
First of all - I can only support opinion of Dmitriy Tarasevich about reading upgrade guides. You can find theme here: https://www.jenkins.io/doc/upgrade-guide/
Then - stick to the version upgrade process that you've used previously (or for the first time with installation). If you did install it via .*war, don¨t worry and use your Method-1. On the other hand, if you used yum, stick to that method-2.
Then - such a "big" upgrade at once from 2.176.1 to 2.375.1 is, I'd say, the reason it's failing for you as the version in between contain several major/breaking changes (our team has faced the same problem (we "just" wanted to bump the versions too much after a long time of no upgrading and we've faced several problems we weren't able to solve together). So it was necessary to split it into several independent upgrades which appeared to be doable and we managed to get to LTS 2.375).
To summarize recommended steps - I'd you need to:
1/ Split your upgrade into several steps and upgrade LTS more gradually: try to upgrade to first to some not-current LTS version. I believe something less than or precisely 2.303.3 could work and see if you can start it.
then actually run Jenkins and check administration page,
upgrade your plugins (if you want). FYI: this is recommended officially in Jenkins docs after every Jenkins core upgrade.
check Jenkins administration page and apply necessary changes / manage necessary decision that might appear there (if applicable).
2/ Try to upgrade to a higher LTS version (repeat step 1 with its sub-steps)
To be a very specific and give some examples (although I don't remember everything by hearth):
you skipped a gradually upgrade to version 2.319 LTS that brings a major change of working with master node --> built-in node that needs to be applied (confirmed) from within the administration section of Jenkins (see docs: https://www.jenkins.io/doc/book/managing/built-in-node-migration/ )
version 2.332.1 LTS brings an important change. I would say that you've hit exactly this issue (covered here): https://community.jenkins.io/t/jenkins-cant-find-java-after-update-running-on-centos-7/3615 - exact steps and more resources are within that thread and also here: https://www.jenkins.io/doc/upgrade-guide/2.332/#upgrading-to-jenkins-lts-2-332-1
from version 2.361 LTS Jenkins requires Java 11 or higher (see docs https://www.jenkins.io/doc/upgrade-guide/2.361/ ). So - you will need to ensure that you have a proper Java installed (you already might have it though). Including your agents!. Otherwise you would start your Jenkins but it would not connect any agent (usually undesired state).
Please, try to make some gradual progress and let us know where you managed to get

Updating Ranorex Licence Server

We need to update Ranorex licence server from version 5.1 to version 5.3.
What is the proper approach to not break the running tests?
I searched on the Ranorex homepage for this issue yet, without finding anything.
Normally, a simple upgrade should work, but wouldn't it be safer to upgrade the license server when no tests are running?
The best way in order to upgrade the license server is uninstalling the old version, restart the machine and install the new version. Usually, it also works if you just run the setup file without uninstalling the old version, but I prefer the uninstall - restart - install approach.
The answer of user1982826 is good. As in meantime the official Ranorex Support has answered my request, I want share their answer:
Generally with the server upgrade the service will be reinstalled and restarted. Depending on how long that lasts (e.g. dependant on the computer), the connection on the client may time out and the test will break. So it would be safer to update the server, when no test is running.

Re-install Windows Service - Fail

I developed a Windows Service project, then I installed.
Then I made some changes in the project, and tried to re-build, but it didn't apply the changes. So, I tried to uninstall and install again, but appears an error: "The service already exists". I try to delete, reboot, but I'm still unable to re-install the service (The same error is showed).
Does anybody know how to fix it?
And when I make changes in the project, I need only stop the service and build the project, that the changes are applied?
Thanks
If the Windows service is merely installed, you should be able to rebuild it without issue. Running it after a re-build will then pick up any changes you've made. However, if the service is running when you attempt to rebuild, you'll run into build issues because the assemblies are in use and cannot be changed. Thus, you have to stop the service first, rebuild, and then re-run the service.
As far as dealing with the install/uninstall issue, you should find everything you need to address the issue here.

MSI Installer fails during uninstall when serivce was already removed

I've an Installer with some custom actions & the designer fancy to install a windows service.
From times to times, when I made a mistake in my custom actions (or in the MSI configuration) the upgrade process may fail. Solution is to uninstall the Application and do a fresh installation.
But sometimes I'm ending in the situation, where I can't uninstall the Application because the "custom actions" for the service claims, that the service is not registered in the system. OK, maybe, no problem. I'm uninstalling the App. The problem: my app don't get uninstalled. It remains. I have to manually add the service to the registry again and restart the uninstall process.
Question: What do I have to configure/develop/program/etc. to tell the service (un)installer not to fail during uninstall when the service is already removed.
BTW: My custom actions do NOTHING during uninstallation. Only during installation/upgrade, I'm asking the user for some configuration and do some custom config stuff - only related to my app. Not related to the service.
EDIT: forgot to mention: VS 2008, default installer project, no fancy stuff, target machine is Windows XP
Yeah, that's one of the many reasons I say not to use VDPROJ and InstallUtil custom actions. You need to put a try catch block in your uninstall custom action and handle that scenario.
Hopefully you are testing on a VM and can just revert but in case this is your dev box use the Windows SC command to recreate the service so you can get the uninstall to work for now.
If you really want to do this right, you want to do something like this:
Augmenting InstallShield using Windows Installer XML - Windows Services
The same concept applies you'll just be adding the WiX merge module to your VDPROJ installer.

Uninstall before installing a windows service

I am reading about how you can create an .exe that will install a windows service to the server.
Say I already have the windows service installed and I want to perform an update. Is there a way for the installer to uninstall (stop the service, delete it, uninstall it) the currently running service and then install the updated version?
Don't be that drastic -- if possible, just stop the service, replace the files you need to, and then (optionally) restart the service.
If you delete the service from the SCM, you lose any post-install configuration done by the user -- custom logon credentials, the settings that dictate what to do when the service crashes, etc.
You shouldn't need to create an exe to do this, the "sc" command can uninstall, update, and install services on Windows for you. See:
Using SC.EXE to Develop Windows NT Services
How to create a Windows service by using Sc.exe
If you still really want to do this by creating your own executable you certainly can, if you can let us know what language you're working in code samples can be provided.

Resources