Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   Detect skipped file (http://forums.winamp.com/showthread.php?t=296264)

BrettR 21st August 2008 08:19

Detect skipped file
 
In one of my patch installers, using NSIS 2.9, I need to copy in an updated file and then execute that file. I would like to skip the execution if the file replacement was skipped (already up-to-date). I found a mention in the forum that the error flag would be set if the file was skipped. My code fragment is as follows:

SetOverwrite ifnewer
ClearErrors
File "SETUPEX.EXE"
IfErrors +4 0
ExecWait "$INSTDIR\SETUPEX.EXE"
IfErrors 0 +2
SetRebootFlag true

I find however that ExecWait is always being called, even when the file has been skipped, so I am assuming that the error flag is not being set. Is there any other way to determine if the file was skipped so I can skip the execution ?

BrettR 10th September 2008 11:49

Bump

kichik 10th September 2008 20:38

The error flag is only set for the "try" mode. If you want to use ifnewer and know when the file is not overwritten, you'd have to compare dates yourself. Use GetFileTime and GetFileTimeLocal to do so.

BrettR 11th September 2008 07:17

Thanks for the help, will see what I can do with those two functions.

Cheers,
Brett


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

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.