View Full Version : setoverwrite by version
25th January 2005, 15:50
In the past, I have used InstallShield and it had a way to specify file overwrite by (VERSION | DATE) where a file would be overwritten if the new file had a greater version than the old file, independent of the date/time stamp. I assumed, wrongly I believe, that the 'SetOverwrite ifnewer' would take file version (if avaible) into account. Is there a simple way to ensure that a file is overwritten if the source file has a newer version than the destination?
25th January 2005, 19:46
> Is there a simple way to ensure that a file is overwritten
You can set "SetOverwrite on" - and it will be always overwritten. If file is blocked (by system, or currently is running) - installer will notify you.
25th January 2005, 21:51
I realize that, but I only want to override if the file is newer. I would like the definition of 'newer' to be 1) first version 2) then date if necessary. If this does capability not exist, it seems like a nice feature that shouldn't be too dificult to implement. I am hoping, though, that I missed a simple mode/setting to accomplish my goal
27th January 2005, 13:34
You can use GetDLLVersion and GetDLLVersionLocal to do the version comparsion. You can use the Library (http://nsis.sourceforge.net/Docs/AppendixB.html#B) or the older UpgradeDLL macro to do this comparison for you.
27th January 2005, 15:35
Yes, I have used those functions/macros primarily for updating system DLLs. I was just hoping that I missed some capability in the File command that would allow more control over overwriting files. It seems that I did not miss anything and will need to use something other than the File command to update my files.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.