Archive: Inform user about application using dll


Inform user about application using dll
Hi All,

Is it possible in NSIS to infom user during installation or uninstallation what application is using dll which this installer want to update or remove?

tnx,
Roman


If you are trying to upgrade system DLLs you should use the InstallLib macro (B.2 Library Installation in the manual), which has REBOOT_PROTECTED and REBOOT_NOTPROTECTED methods. You don't have to worry about whether these files are in use as they will be updated on reboot if they are in use.

For your own files, you can use the FindProcDLL plug-in to check one at a time if any of your executables are in use and display a message if they are:

Function CheckRunning
check_running:
FindProcDll::FindProc "MyProgram.exe"
${If} $R0 == 1
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION "Setup has detected a running instance of \
MyProgram. Please close MyProgram and click OK to continue." IDOK +2
Abort
Goto check_running
${EndIf}
FunctionEnd

I'm using InstallLib macro for instalation of my dll files but I would like to avoid rebooting. My software doesn't need it.
I run InstallLib macro with NOTSHARED NOREBOOT_PROTECTED flags and when dll is used by another process message box appears saying some dll is busy. This is enough informaiton for me as for developer but I afraid common user won't understand it. I prefer to show message box like
"Internet Explorer is using some components. Close this application to continue installation"

I don't know for sure if IE the only application which could use my dll files so it's not so easy to use
FindProcDll::FindProc function

Any ideas how can I help end-user to understand what application is blocking installation?


I think the easiest solution is to ask the user to close all programs before continuing.

Stu


Originally posted by Afrow UK
I think the easiest solution is to ask the user to close all programs before continuing.

I don't think it will be really user friendly. InstallShield can do it so I hope NSIS can do it too.

Doesn't anybody has written such plugin yet?

There is WhoUses.exe but I do not think it will work on Windows 9x.
http://www.codeguru.com/cpp/w-p/syst...cle.php/c2827/

Stu


Originally posted by Afrow UK
There is WhoUses.exe but I do not think it will work on Windows 9x.
http://www.codeguru.com/cpp/w-p/syst...cle.php/c2827/

Stu
Well, win9x is not target system for me.

Thank you for advise.