Hello,
I seem to have some sort of a ordering problem.
My installer has components that are windows services.
The update instruction say:
Stop the service, delete all files, copy over new version, start service, done.
My problem: I can't figure out how to do that in this order, without a lot of very ugly custom code. The service creates some files in some other directories which aren't installed, so the installer doesn't know them, still I have to delete them on update.
[InstallDelete] seems too early, as the Windows Service is still running at this point. I can't delete files that are still being accessed.
BeforeInstall seems too late as we're already copying the files here, and I can't make sure I only delete the things on the first file except for a global variable... Don't really like that approach.
I could configure a DummyFile before my Directory with a BeforeInstall (for the same component) that would use the file system API to enumerate through all directories I also have listed in [Source] (I don't know how to access these, so I would need to duplicate that information, which I don't really like), to delete these, before I start processing the File entries for the actual service.
I also thought about using PrepareToInstall, but I don't know how to figure out if my component is checked (or: was checked at the initial installation run), as I have multiple services in my installer as separate components and I only should touch the services that my installer is actually processing (maybe one service was installed manually, then I should not stop that).
Did I miss something?
Thanks a lot,
Sebastian