jonnyo
Posts: 10
Joined: Tue Dec 10, 2019 9:26 am

Setup runs without error, even if a service is not installed successfully

Tue Apr 27, 2021 4:44 pm

Hi,

This week we had a situation where our setup did not install our necessary windows services on an upgrade execution, because the ourservice.exe file behind the service had a lower version than the old uninstalled one, and was not installed. That is a expected behavoiur. What we did not expect was, that the setup has not thrown any error during execution because of a failed service installation action.

So we digged a little bit deeper into that issue.
We found out that the option "the service is vital for installation" was not active on this service, so we activated it.
In our expectation the setup should throw an error now, during service installation.
But that is not the case. The setup still runs successfully and the file and the service is missing.

Within the msi log we can see, that ServiceInstall(name=ourservice.exe) is not called. For all our other services it is called.
Could it be that msi does not run the ourservice.exe service install step, because the file behind is missing, and so it does not even matter if we activate the vital option or not? Or do we misunderstand how this option should work?

Is there potentially any other possibilty to produce a setup error if a service cannot be installed? Or is there even a AI problem?

Many questions sorry. I hope you can help.

Thanks
Frank

Catalin
Posts: 4340
Joined: Wed Jun 13, 2018 7:49 am

Re: Setup runs without error, even if a service is not installed successfully

Thu Apr 29, 2021 6:56 pm

Hello Frank,

I have run a few tests on my end and I was indeed able to reproduce this behavior.

As you have mentioned, the installation of the service not performing in this case is normal, since the upgraded version of your setup contains an older version of your service executable.
Could it be that msi does not run the ourservice.exe service install step, because the file behind is missing, and so it does not even matter if we activate the vital option or not? Or do we misunderstand how this option should work?
This is exactly what happens.

After the older setup is removed, at the start of the installation of the newer version, the setup will detect that the service executable has a lower version and therefore disallow its' installation:
MSI (c) (30:7C) [10:31:29:012]: Disallowing installation of component: {B44AD9DF-4DF2-4601-AF4A-6E4078A7809A} since the same component with higher versioned keyfile exists
(the above is from the log created on my machine)

Since the executable is missing, all the operations related to that service will not be executed.

Regarding the "Service is vital for installation" option, to be fully honest with you, I can not say for sure whether this is the expected behavior or not.

Judging by the documentation:
The package installation is aborted if the service cannot be installed.
the setup should fail. However, I believe that by "cannot be installed" we actually mean the service being created (e.g. in Service Manager).

If that is the case, then the behavior would be normal, because the executable does not exist on the disk thefore the create operation is not even triggered.

I will have to check this with my colleagues / the dev team and I will update this thread as soon as I will have more information about this.

Please note that the answer might be a little bit delayed due to Orthodox Easter (Friday and Monday will become non-working days).

One last note: Even though the behavior (your service executable not being installed) is normal, I'm assuming that you would like to install it even if the version is lower in the upgraded setup (please correct me if I'm wrong). If that is the case, you could set the "Always overwrite existing file" option for your service's executable in the "Files and Folders" page. This way, all of the above would be avoided.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jonnyo
Posts: 10
Joined: Tue Dec 10, 2019 9:26 am

Re: Setup runs without error, even if a service is not installed successfully

Mon May 03, 2021 9:20 am

Hi Catalin,

thank you for your detailed analysis.
MSI (c) (30:7C) [10:31:29:012]: Disallowing installation of component: {B44AD9DF-4DF2-4601-AF4A-6E4078A7809A} since the same component with higher versioned keyfile exis
This will help us the next time we have such an issue. I have not seen it myself, but it explains all of the other behaviour. Thanks a lot.

The lower file version was a misconfiguration of our build pipeline and the setup could have been the last instance to detect such a missconfigured build.
Of course we could flag the file to get always overwritten, but in the past we wanted to use this flag explicitly where neccessary.
Now i discussed it internally with our developers and we would like to try to overwrite everything during upgrade.
Is it possible to activavte the overwrite option globally for the complete setup or do we have to activate it on each single file?

I also have seen that i can activate it on the complete folder like Applicaton Folder. Does this flag inherit over all subfolders of applicaction Folder?

Thanks
Frank

Catalin
Posts: 4340
Joined: Wed Jun 13, 2018 7:49 am

Re: Setup runs without error, even if a service is not installed successfully

Tue May 04, 2021 2:03 pm

Hello Frank,

It looks like the behavior I expected was indeed the correct one:
However, I believe that by "cannot be installed" we actually mean the service being created (e.g. in Service Manager).

If that is the case, then the behavior would be normal, because the executable does not exist on the disk thefore the create operation is not even triggered.
This will help us the next time we have such an issue. I have not seen it myself, but it explains all of the other behaviour. Thanks a lot.
You are always welcome! I'm glad this was of help for you.
Now i discussed it internally with our developers and we would like to try to overwrite everything during upgrade.
Is it possible to activavte the overwrite option globally for the complete setup or do we have to activate it on each single file?

I also have seen that i can activate it on the complete folder like Applicaton Folder. Does this flag inherit over all subfolders of applicaction Folder?
Yes, if you will check the "Always overwrite existing file" for the APPDIR folder, the files from under that folder will inherit the option. This also applies to the subfolders.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

jonnyo
Posts: 10
Joined: Tue Dec 10, 2019 9:26 am

Re: Setup runs without error, even if a service is not installed successfully

Wed May 12, 2021 3:06 pm

Hi Catalin,
Sorry for our late response. We will give it a try to overrite all files during upgrade by using the global flag.

Thanks
Frank

Catalin
Posts: 4340
Joined: Wed Jun 13, 2018 7:49 am

Re: Setup runs without error, even if a service is not installed successfully

Wed May 12, 2021 3:44 pm

Hello Frank,

No worries about the delayed reply.

I hope everything will work as expected after the change!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”