Guys I hope you can help me as this is driving me mad.
I have written an installer. This installer installs a service.
If I release an upgrade to my app, the installer is meant to overwrite the existing files. What I have done is check to see if the 'service' file exists in the destination folder if it does it checks to see if the service is installed then uninstalls it before overwriting the 'service' file. Hope that isn't too confusing! The problem is this bit of code as far as I can tell:
using (installer = new System.Configuration.Install.AssemblyInstaller(wservice, new string[] { }))
{
installer.Uninstall(saveState);
}
When it returns to the 'copy' method, the lock on the 'service' file hasn't been released(even though the service has been uninstalled) and therefore when it tries to overwrite the file it fails saying that the file is being used by another process.
I forgot to mention that for this example project I create 2 folders a source and a destination. In the source I would put the ServiceTest and the WindowsServiceTest.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.