Old 14th January 2009, 18:40   #1
seckg
Junior Member
 
Join Date: Jan 2009
Location: Seattle
Posts: 3
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
seckg is offline   Reply With Quote
Old 14th January 2009, 19:49   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
See /rebootok for the File instruction.

Stu
Afrow UK is offline   Reply With Quote
Old 14th January 2009, 19:54   #3
Ivan Andreevich
Junior Member
 
Join Date: Nov 2003
Location: Vancouver, BC
Posts: 48
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:
code:
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}
Ivan Andreevich is offline   Reply With Quote
Old 19th January 2009, 22:01   #4
seckg
Junior Member
 
Join Date: Jan 2009
Location: Seattle
Posts: 3
It seems that /REBOOTOK only works with
Delete command, doesn't work with File command.

-Seckg
seckg is offline   Reply With Quote
Old 20th January 2009, 04:32   #5
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
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.

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 20th January 2009, 14:36   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
See the macro on this page:
http://forums.winamp.com/showthread.php?threadid=293513

Stu
Afrow UK is offline   Reply With Quote
Old 20th January 2009, 17:20   #7
seckg
Junior Member
 
Join Date: Jan 2009
Location: Seattle
Posts: 3
Smile That works

Thank you very much, it helps.

-Seckg
seckg is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump