Archive: File /a option doesn't work as expected


File /a option doesn't work as expected
I need to preserve the original file attributes
which are actually set to READ-ONLY and nothing else.
All my script and source files are stored on network drive.
When I compile and run the installer which contains the
section below then I never get the file on target system
with READ-ONLY attribute set, it has only ARCHIVE bit set
although this bit is cleared on source file.

!define revX rev64 ;latest revision of firmware
Section "sy-MIG" SubPREC_SYMIG_FW
SetOutPath "$INSTDIR\Firmware\sy-MIG\${revX}"
File /a "SYNERGY\Firmware\sy-MIG\${revX}\ps240_64.bin" ;sy-MIG
SectionEnd

Is this a bug or not?
I'm using NSIS 2.0b4 CVS from Sep-06-2003

Thanks anybody for any reply :)


Works fine for me. Try the latest CVS version.


still not working
Well, today I have re-tested it with
dev.snapshot from Wed, 10 Sep 2003, 01:44:17 GMT.
Unfortunately, it still doesn't work for me :(
Please try to test my attached script and let me know
the results. Thanks a lot

P.S. I'm using Win98SE


Always worked for me on both XP and 98. Though it sometimes took its time with it. Are you sure explorer didn't just take time to update? If you are, I can send you a debug version which will help pin-point the problem.


I'm absolutely sure that it's not the Explorer's issue.
btw I'm not using it at all (my favorite file manager is Servant
Salamander - http://www.altap.cz)
Please send me that debug version, maybe it will help ;)


OK. Download DebugView, run it, download makensis-attrib-debug.zip, use it to compile your script, run your installer and attach DebugView's log here.


OK -> I did want you wanted me to do and after scanning
that log files I realized where my problem really is:
as I understand from that log files the /a option works so
that it prevents the attributes of the file which ALREADY
EXISTS ON TARGET SYSTEM therefore new installation always fails
please see "new.log" & "new_salamand.log"
whereas the second installation always succeeds
please see "second.log" & "second_salamand.log"
(_salamand means that I ran my installer from the Servant Salamander
which is also in beta stage now -> so it also outputs some debug
information)

Anyway, what I wanted and meant that /a option does is this:
I have a file which is to be included in my installer during
NSIS script -> installer EXE compilation process. This file has its file attributes set to whatever I want and EXACTLY the same attributes
should have set the file which will be extracted during installation process on target PC, no matter whether it already exists there or not.

thanks for your help kichik,
I hope that you understand now what was my point for this topic :)


Nope, /a is supposed to do what you thought it should do. Looking at your log files I realized where the problem is (though the language made it a bit hard ;)). SetOutPath sets the current directory, but does so before creating the directory. I didn't see it in my logs because I already had the directory created.

This only bothered File /a since a few days ago because earlier NSIS automatically prefixed the path with $OUTDIR, but this caused /a to fail if used with /oname.

Uploaded a fixed version to latest CVS, thanks.


Great! your help is truly appreciated
and I'm glad you succeeded in this little bug hunt :)

Kypec