This would be an interesting one to profile.  I stand by my assertion that 
installutil CA's to create and start services is an antipattern.  
ServiceInstall and ServiceControl should always be comparable.  The problem 
is what else is in the InstallUtil CA?  I've seen people doing things such 
as tweak config files, copy files, extract resources, create event logs, 
write to the registry and so on.  Any of those missing dependencies and 
BOOM it will seem that ServiceInstall /  ServiceControl doesn't work.

Do you have experience profiling a machine?  You can use a program like 
InstallWatcher PRO to capture the disk and registry before and after the 
installutil.  Do somethig like:

1) Run the MSI.  Wait for it to give the Abort | Retry | Cancel  screen.
2) Snapshot the state of the machine using said tool.
3) Run the install util command.
4) run the snapshot | compare functionality to see what changed.
5) read through the installer class for clues on what it's doing.

Here's a thread on some of the things that can cause that exception.
 
http://stackoverflow.com/questions/4142853/cannot-install-windows-service

 If you can share the MSI, I could throw it on a VM and look at it for/with 
you.

----------------------------------------
 From: "Andrew Jones" <andrew.jo...@alquist.co.uk>
Sent: Wednesday, July 03, 2013 4:27 PM
To: "wix-users@lists.sourceforge.net" <wix-users@lists.sourceforge.net>
Subject: [WiX-users] ServiceInstall fails when installing service 
containing a Mixed Mode dll

I have a .NET 4 Windows Service that references a Mixed Mode .NET2.0/3.5 
dll. In my Windows Service application I've had to alter app.config to add 
a useLegacyV2RuntimeActivationPolicy="true" to allow use of the legacy 
dll.

<startup useLegacyV2RuntimeActivationPolicy="true">

I can install and start this service manually from a command prompt using 
the .NET 4.0 "InstallUtil filename.exe". However the Wix ServiceInstall 
element fails to install the service resulting in an Event Log entry saying 
" Service cannot be started. System.IO.FileLoadException: Mixed mode 
assembly is built against version 'v2.0.50727' of the runtime and cannot be 
loaded in the 4.0 runtime without additional configuration information."

If I remove the reference to the .NET 2.0/3.5 Mixed mode dll from my 
service everything installs with WIX just fine.

Any idea how I can get the Wix ServiceInstall to work?

Regards,

Andrew Jones, 

----------------------------------------------------------------------------
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to