How to delete service while uninstallation of the msi in wix? - service

I have created one installer using wix toolset and wanted to delete service at the time of uninstallation of the msi, but service name will be create dynamically like if user will ente companyname at the time of installation then service name will be Servicename_companyname.
In my case service is getting stopped but not deleted at the time of uninstallation

Related

Rollback Service installation in unattended mode with install4j

I'm trying to create an Install4j updater in unattended mode using Stand Alone Update Downloader and invoke it using the api. (this is working)
The application is a Windows Service and it opens http ports.
I would like to be able to rollback to the previous installed service if the new installed version isn't working. There should be no user interaction to do it.
What I was planning to do is:
Install the service
Start the service
Call Wait for Http Server Action that calls an Url of the service to check if my new updated service is working as intended.
If it doesn't returns a 2xx it will initiate the rollback process
But what I'm seeing is that the rollback process starts but it stops and uninstalls the new service but the previous service is never reinstalled.
What I would want it to do when rollbacking is:
Stop the new service
Uninstall it
Rollback any other files added by the new version
Reinstall the previous service
Start the previous service
Is there any way to achieve it ?
Edit:
I have those actions in the installer:
In this version of Install4j (10.0.4) the rollback mechanism doesn't handle this scenario. As specified by the comment of Ingo Kegel this will be improved in further version.
What is working with this version is that:
Add the condition on Install service to not to run it when updating like this: !context.isUpdateInstallation(). There will no rollback of the service when updating.
To keep the service started, we added a Stop a Service at the beginning. This way if there's a rollback, the Stop a Service will be rollbacked, so it will restart the service.

How can I install multiple instances of a Windows Service from an MSI file?

Have an MSI file with multiple Windows Services. Running the MSI file creates an instance of each service. However, I am unable to install another instance of each service (or one of the contained services).
Have tried a few suggestions online but they seem more suited for EXE files. have tried MSINEWINSTANCE but from my understanding, this requires a .mst file which we don't have or know how to create.
Ideally, create each service with a "_#' at the end (where # is instance of the service.

Wix toolset - powershell script msi creation

I have a new project at work, for customer, that require me to do an OEM image creation.
The pre
The idea would be deploy OEM image, it will install, and deploy all software, and then shutdown. Once started back up it will prompt users to chose pc name, select Domain to join and regional settings.
I think i can do this by using a powershell script and wrapping it up in an msi and add it to MDT with no silent install switches (so that it prompts users to manually go through the steps)
Now my issue is how do i inject a powershell script as well as ensure that if this scipt has user input required, that it actually prompts the user to input the data (is this even possible with Wix?)
WiX is able to install files, configure Windows settings, interact with SQL Servers, and etc, but you are working with an installer file. It is not possible to receive input from the end user after a system reboot from WiX alone since you can run a PowerShell script while the system is active, but once it restarts, the process will get terminated and has to be restarted. Unless there is some way to schedule the PowerShell script in Windows such as running it from a service created in C#.

Install4j service not started on machine reboot for Suse Enterprise Linux

We have created an application using Install4j. This application has a service, created by using "Install a Service" action, with "auto start" attribute set.(The application launcher is a "Service" type with unix option "Auto-start service for Linux packages".)
For CentOS7, CentOS6, ,RHEL7, RHEL6 platforms the service starts automatically when the system is rebooted.
For Suse Enterprise Linux 12.x series, the service could not be started on system boot up. It is working fine, when invoked manually by command "/etc/init.d/{service-name} start".
When we check for the deployed files, the service file is copied to /etc/init.d/ folder and corresponding entries K50{service-name}, S50{service-name} files created at /etc/init.d/rc2.d/, /etc/init.d/rc3.d/, /etc/init.d/rc4.d/, /etc/init.d/rc5.d/. The service is turned on by chkconfig for 2,3,4,5 run levels. But when we reboot the machine, this particular service is not even attempted in the startup process.
Please suggest.

Start service after all install actions are complete

I have a complex WIX installer that does various tasks / MSIs. One of the MSIs installs a service after which a Database MSI runs and updates the app.config for that service to contains the correct connection strings.
Currently the service is started after it is installed (this is before the Database MSI runs) meaning it has incorrect connection strings. How can I make the service start as the very last item in the installer so that it has the correct connection strings.
I assume this could be in the Bundle of the Bootstrapper but I cannot get that to work. Here is the current code within the Product.wxs which starts the service.
<ServiceControl Id="StartEMService" Start="install" Name="EMService"/>
Bundles only operate on packages so things like controlling services aren't supported. Your database package should have a ServiceControl element to stop (just in case) and restart the service. Schedule the action that updates the config file to be before the StartServices standard action.