Archive: handling of hard and soft links


handling of hard and soft links
i use mingw32 to compile a large project (~150meg) and nsis to make an installer all under Linux so that i dont actually need Windows. in this regard, nsis has been a godsend. cheers to all the developers who have made this a reality. but i digress ...

the project employs a large number of symlinks which, under Linux, work just peachy to conserve space. however, as one would imagine, those symlinks get duplicated as actual files when installed in Windows and considering many of these files are megabytes in range, this is undesirable.

is there a method for using real links under Windows ? newer versions (like Vista) support real softlinks while older versions (like XP/2000) support hardlinks. i dont personally care about older versions of Windows, but the logic would be:
- softlinks supported ? use em, else ...
- hardlinks supported ? use em, else ...
- make duplicate files (like today)

ive searched around (google/nsis docs/nsis forums) but cant find anyone who is doing this


for hardlinks, you should be able to do something like:

system::call 'kernel32::CreateHardLink(t "file2",t "file1")i.r0'

(win2000 and later, both files must be on the same volume IIRC(and FS must be NTFS))

and vista softlinks: system::call 'kernel32::CreateSymbolicLink(t "file2",t "file1",i0)i.r0'

(did not actually test this code)