Reputation: 2436
I have an application that is a not so simple Windows service (C#). I created an installer using Visual Studio 2008, which did the job of installing the service on the clients machine, but using the Visual Studio deployment project has 2 drawbacks:
What is nice about VS2008's deployment project is that I created a custom action that shows a form that gets some info from the user, connects to a WCF service, which retrieves data and stores it in an encrypted data store on their local machine for use by the service.
Now, I have looked high and low, and I don't see this being possible with WiX. Running an EXE after the program has installed isn't 'nice'. I'd like to be able to call a method in my Custom Action DLL that displays the form, and does the processing it needs to. Is there any way of doing this with WiX? -- or even, create a custom GUI in WiX that gets the values and passes these values to a method for processing
So, questions:
Many thanks
Upvotes: 3
Views: 2793
Reputation: 1211
Note about the WiX Service control node:
If you service relies on assemblies that your installer is putting in the GAC then it will fail to start. For some reason WiX schedules the StartService action BEFORE it publishes assemblies to the GAC, so if this is the case you will need to write a custom action to start the service.
Upvotes: 1
Reputation: 755321
You can definitely install and start services with WiX - I'm doing that all day, every day :-)
Check out the ServiceInstall
and ServiceControl
elements (there are even more, if you need to specify even more).
Basically, you need to first define your service file (YourService.exe) as a file in a component, and then you need to specify the ServiceInstall (and possibly ServiecControl) elements in addition to that.
<Component Id='YourServiceComponent' Guid='.....' DiskId='1'>
<File Id='YourServiceEXEFile' Name='YourService.exe'
src='(path to your EXE)/YourService.exe' KeyPath='yes'/>
<ServiceInstall Id='YourServiceInstall' Name='YourServiceName'
Description='.....' ErrorControl='normal'
Start='auto' Type='ownProcess' Vital='yes' />
<ServiceControl Id='UninstallYourService' Name='YourServiceName'
Remove='uninstall' Wait='yes' />
</Component>
Then you need to add this component to one of the features in your install that's being installed - and that's about it!
Marc
Upvotes: 1
Reputation: 1325
The answer to your question #1 is yes, but it's a little involved. You can define dialogs to collect info from the user with the UI element and store it session properties. You can insert these dialogs into the flow with the Publish element. You can then create a vb script CustomAction and do just about anything with those session properties. Check out this tutorial for more.
Upvotes: 1