I have a wpf desktop application (ERP) system
Application is using setup and deployment to create the .exe file
Now, i want to create a window service for my application to do some background check ups , synchronizations with my database etc.
I know how to create a service in.net and how manually to install it following the examples online.
My question is how i can install (or include let's say) this service within my .exe setup.
I don't want the user to be responsible to install the service.
Neither me to login every time someone pc to install the service
Not sure if i misunderstood the purpose of service but i found nothing online related to my question.
You can use Microsoft Visual Studio Installer Projects and include your service/main project at the same time
https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2017InstallerProjects
Related
I developed C# wpf application using 3rd party SDK now i want to deploy application. i want to create exe which is download and install application directly from web with minimal user interaction.
i also want to install .net framework silently on client machine without user interaction. for example like zoom meeting windows application.
Thank You.
you say download and install but how?
if you want to install like msi setup i'm suggest you to try squirrel
which is like clickonce but it works.
But you can also check: Installshield or Advanced Installer which it can let you create an update windows service. With windows service privileges, you can do your job without user interaction.
Also the other way which i prefered 2 months ago is your own application. You can create an updater windows service application. I've developed an updater software which checks an url for the version, if the version higher then download and update the application. Also check if application is running if app is not running then run it. i'm starting processes with an 3rd party tool which you can find it here you will need it if you want to develop your own application which is windows service. Because of windows service isolated "session 0"
I think best way will be your own development.
i am new to windows services. please help me to know is Project installer Mandatory for Windows service or why do we need project installer. can we create and install windows service into system without project installer.
thanks,
If you're talking about the ProjectInstaller.cs file that's added to your service project if you're looking at the Service and choose "Add Installer...", then yes, it's required.
It creates two components - a ServiceProcessInstaller and a ServiceInstaller. Together, these components contain important information that is required to install a service - such as what account the service should run under (such as Local System, Local Service, Network Service or an actual user account), metadata about the service, and information about how the service should be started.
I think that DinosaurTom's answer was assuming you were talking about an installer project, a separate project in the solution that would create a setup/MSI file. It is exactly the two above mentioned components that tools such as InstallUtil or a Setup Project actually interact with to perform installation.
No, it is not mandatory. However it could be useful when installing on many maschines.
We can create a Windows Service without Project Installer. For example, like in this post Install a Windows Service using a Windows Command Prompt
I am creating a setup project for my application in vs12, my application has a windows form and a windows service, how can I add a service in installer using inno setup Compiler? or any other setup creator?
I used Install shield limited version before but i am unable to create app folder in program data with that.
You can do this by creating a Custom Action in your Setup Project and then you install the User Service silently by modifying registries. There are some example that you can find on the internet. One of the good examples i have found from Code Project site.
Install Windows Service using Custom Actions
I currently have a windows service that needs to run in the background while a main application I have written handles UI and other tasks. I install and maintain the GUI application using ClickOnce Deployment and would like to find a way to bundle my Windows Service in as well.
They are in separate projects at the moment since I was still learning how to use the Windows Service.
My question is, is it possible given MyService.exe that I install and start MyService.exe from MyApp.exe? I can assume that I have access to InstallUtil.exe and could write a script to install and run it manually, but I would like a cleaner solution if there is one.
The only resources I've found all seem to assume I want to have the Service install itself, which is not the case.
In general, ClickOnce can't be used to install services. There is typically a lack of permissions, but also the location is incorrect, etc. For details, see MSDN on Choosing Between ClickOnce and Windows Installer for more details.
If you want to install a service, you should do a traditional installation.
I currently have a VS Solution with 2 projects: a WPF application and a Windows Service.
Now, I have managed to get ClickOnce working in installing my WPF application, but I also want a Windows Service to be installed (the one in the project) during this installation.
I have found ways how to programmatically start a windows service with C# code, but is there any way to incorporate this in my ClickOnce installation (because I need ClickOnce's benefit of automatic updates and such)?
I don't think you can deploy a windows service via ClickOnce in a normal fashion.
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1bb64760-9622-4ca6-a1a6-3ce53e641f21
ClickOnce deploy a Windows Service?
Please check DDay Update library it might give you ClickOnce stuff for updates, but first install you've got to do using another too.
Can you execute a process during the ClickOnce install? You might be able to write the service using Topshelf and then execute MyService.exe /install from ClickOnce.