Change installation path for .NET Service Installer

I have two projects: a service project and a service installer project. There is assembly information in the service design that is suitable for my product. It includes company information and the correct service name. All this seems to be ignored as soon as the service is actually installed. When a service is installed, it uses the properties set in the initializeComponent Service Installer method. It took me a while, but I managed to find it.

Unfortunately, the created MSI is still created with the name of the company "Microsoft", the name is "Service", and therefore the installer by default installs the installation on "C: \ Program Files (x86) \ Microsoft \ Service", which does not seem to be a good location default.

The service project does not have any configuration files that I can change that will affect the default installation path or build information for the generated setup.exe and ServiceInstaller.msi file.

And, as with most .NET things, Googling produced very little useful information. Any thoughts or suggestions are welcome!

tl; dr: How to influence the assembly information and the default installation path in the Service Installer project.

+4
source share
2 answers

It seems that right-clicking on a project and choosing Properties is different from choosing Project and opening the Properties panel. From there, you can configure various properties that are copied to the MSI output. Thanks for watching.

+2
source

What version is VS? Regardless of the version, however, what I would like to do is recreate the service and add the service installer and transfer my code to the newly created one. This is relatively easy to do in a Windows Service project.

Follow somethign's instructions like this to make sure you go through the right steps.

You can also simply follow these steps without moving the code, and then make sure the sample is installed correctly before moving the code.

I have never seen the problem you mention, so I think that maybe some kind of auto-generated source file was corrupted along the way. It is usually easier to generate than to fix it.

0
source

Source: https://habr.com/ru/post/1340037/


All Articles