Archive: How do we overwrite a running file


How do we overwrite a running file
Hi All,
My install script (NSI)already set SetOverwrite on
but when the file (dll or exe) is running, NSI setup
just ignore it, and it will not be upgraded even
restart the computer.

Section "-Compsect" SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File ..\ty.ocx
File ..\logo.gif
File ..\tty.dll
File ..\vcredist_x86.exe

Is there any solution for this?
BTW, I want to conditional install vcredist_x86.exe if it
is not installed, I can check registry, how do i implement
it in NSI script

Best Regards
Seckg


See /rebootok for the File instruction.

Stu


DLL/exe setup (including rebooting if needed): http://nsis.sourceforge.net/Docs/AppendixB.html
Check if exe is running: http://nsis.sourceforge.net/FindProcDLL_plug-in
Kill exe: http://nsis.sourceforge.net/KillProcDLL_plug-in


Conditional installation of VC++ 2005 redist SP1:

ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{7299052b-02a4-4627-81f2-1818da5d550d}" DisplayName
${If} $R0 == ""
;extract the file
ExecWait '"msiexec" /i "path/to/msi" /quiet'
${EndIf}


Non-SP1 is here HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{A49F249F-0C91-497F-86DF-B2585E8E76B7}

It seems that /REBOOTOK only works with
Delete command, doesn't work with File command.

-Seckg


That could be done by examining the target system for certain running processes before the actual installer/uninstaller loads as already suggested above by Ivan.


See the macro on this page:
http://forums.winamp.com/showthread.php?threadid=293513

Stu


That works
Thank you very much, it helps.

-Seckg