Failed to install and start Windows services in WiX installer

前端 未结 5 1812
一向
一向 2021-01-01 19:43

I am creating an MSI package for installing and starting Windows services using WiX v3.8. The code as follows:



        
5条回答
  •  失恋的感觉
    2021-01-01 20:04

    When debugging a service startup issue, I always just use a simple if() statement that checks for the existence of a particular file in the installation directory. When the service fails, I open a command prompt (before dismissing the dialog indicating the failure) and use "echo >thatfile" to create the file that I am looking for in the if(). The object of the if() is the Debugger.Launch() invocation.

    Now, I can dismiss the dialog and rerun the installer and this time it will start the debugger and I can see what happens. I tend to use static class init as the moment to launch the debugger, but you can try to do it in "OnStart()", but if there are loading/binding issues, you probably won't get to that point before it dies. Whereas doing it during static class init will almost always tell you the things that you need to address as dependencies.

提交回复
热议问题