Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How to copy locked/in-use files and prompt reboot? (http://forums.winamp.com/showthread.php?t=264726)

Rentrick 31st January 2007 00:23

How to copy locked/in-use files and prompt reboot?
 
I know, I know... Kill me! I've read and read and searched and searched and looked in other scripts. My brain is not running optimally today. Not to mention I'm brand new to NSIS (I LOVE IT!) and I'm being pressed to write a pretty intensive install in the next two days.

I'm just trying to reinstall with a file that might possibly be open/locked (tray applet). I don't want the install to prompt for Abort/Retry/Ignore, but to flag and prompt for reboot so the file can be replaced upon rebooting.

I really would rather not kill the process either, if I don't have to.

Can someone assist with what to call to make this so? I know it's something simple I just missed.

Thanks in advance!

goldy1064 31st January 2007 00:27

Search for information regarding HKLM\SYSTEM\CurrentControlSet\Control\SessionManager [PendingFileRenameOperations].

kichik 1st February 2007 19:26

Use `SetOverwrite try` and after trying to write the file, check for errors using IfErrors. If errors exist, extract the file with a temporary name and rename it with the /REBOOTOK flag.

The UpgradeDLL is an example for this and so are the Library macros in Includes\Library.nsh.

Rentrick 1st February 2007 21:00

Perfect. Thanks. . . that's exactly what I was looking for!


All times are GMT. The time now is 04:18.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.