Skip to content
⌘ NSIS Forum Archive

How do we overwrite a running file

7 posts

seckg#

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
Ivan Andreevich#
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}
seckg#
It seems that /REBOOTOK only works with
Delete command, doesn't work with File command.

-Seckg
Red Wine#
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.
Afrow UK#
See the macro on this page:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


Stu