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.
Any help would be gratefully received.
Matt.