Shared files

Got a problem you cannot solve? Try here.
Post Reply
khalprin
Posts: 51
Joined: Fri Aug 25, 2006 2:02 pm

Shared files

Post by khalprin »

My company has applications that share a few files. One of the shared files is a service with COM interfaces. During an install, I use the Run Program command to run the service with a "/service" command line to install it as a servce (in the scm) and to register the COM interfaces.

How can I determine when it is OK to remove this file? I don't want to uninstall (use a Run Program command with "/ungregserver", or stop/remove the service from the scm) until the last program sharing the file is being uninstalled?

Thanks
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

I would install the file as a shared file. That way, Windows keeps in its registry a reference count for each time the file has been installed (the location where it keeps this should be easy to find with a quick Google search).

Then, you may easily go ahead and check that count, and if it indicates that you are the last copy installed, unregister the file using Run Program as you have described.
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
khalprin
Posts: 51
Joined: Fri Aug 25, 2006 2:02 pm

Post by khalprin »

Thanks for the response. Do I install the file as shared by checking the option that says 'Shared DLL file' (even though it's an exe)?

Thanks.
MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Post by MichaelNesmith »

Yes, exactly. That option is not limited just to DLLs even though it certainly sounds like it is :D
Michael Nesmith
Install[b]Aware[/b]
[i]Home of The Next Generation MSI Installer[/i]
Get your free copy today - http://www.installaware.com/
Post Reply