NOWARN option for FileDelete
#1
Posted 10 March 2010 - 10:24 AM
FileDelete,FileToDelete,NOWARN produces a syntax error, my guess is that NOWARN is not yet an acceptable parameter for FileDelete. My suggestion is to add it as an optional parameter so that warning can be suppressed when desired. When supported, wand should give 'FileDelete,FileToDelete[,NOWARN]'.
Thanks,
Galapo.
#2
Posted 10 March 2010 - 10:33 AM
#3
Posted 10 March 2010 - 07:51 PM
IMO the warning only appears when you checked "Debug Log". Here intentionally warning comes up on every delete.I've discovered that there is no way to have FileDelete operations from not appearing as a warning in the log other than ShellExecute,Hide,cmd.exe,"/C del ...": http://www.boot-land...showtopic=10674.
FileDelete,FileToDelete,NOWARN produces a syntax error, my guess is that NOWARN is not yet an acceptable parameter for FileDelete. My suggestion is to add it as an optional parameter so that warning can be suppressed when desired. When supported, wand should give 'FileDelete,FileToDelete[,NOWARN]'.
Thanks,
Galapo.
Without the "Debug Log option" there should be no warning.
Maybe you have a special situation where a bug is active.
Then please post your script, and a log.
Peter
#4
Posted 10 March 2010 - 07:56 PM
Yes, this is in relation to the debug log. Currently there is not a way to suppress FileDelete operations from it other than using a workaround like the one posted above. Some FileDelete operations are totally unnecessary appearing there and I'd like the option of being able to have them not appear. Hence the suggestion here.
Regards,
Galapo.
#5
Posted 10 March 2010 - 08:06 PM
Hi Peter,
Yes, this is in relation to the debug log. Currently there is not a way to suppress FileDelete operations from it other than using a workaround like the one posted above. Some FileDelete operations are totally unnecessary appearing there and I'd like the option of being able to have them not appear. Hence the suggestion here.
Regards,
Galapo.
The intention is that "Debug Log" inactivates all "NOWARN".
Only in this way all "Overwrites", "Delete" "FileCreateBlank on existing files" etc. can be seen. And all of these informations are necessary to find a bug in a project. (When it does not run any more after including a certain script).
"Debug log" should be unchecked in default delivery. So for standard users nothing exciting happens.
Peter
#6
Posted 10 March 2010 - 08:41 PM
OK, can we then have an optional parameter NEVERWARN instead? Using NEVERWARN would mean that it wouldn't appear in the debug log.
I think a .script developer should be in control of what sometimes is redundant appearing in the debug log. Some FileDelete operations just don't need to appear there and it would be good to supress them.
Anyway, I've made my suggestion. pecd.net seconded. Up to you to decide whether you want to implement or not. We have workarounds such as that listed, but I always prefer internal functions if possible.
Thanks,
Galapo.
#7
Posted 06 April 2010 - 12:56 AM
Thanks,
Galapo.
#8
Posted 06 April 2010 - 08:02 AM
A possible solution, cannot say if actually doable, is to add a "level" to the debugging log settings.
I.e. now there is an ON/OFF switch:
- Normal Log
- Debug Log
- Normal Log
- Debug Log
- Verbose Debug Log
Wonko
#9
Posted 06 April 2010 - 08:10 AM
Any news on this? Suggestion accepted or rejected?
Thanks,
Galapo.
begin // FileDelete if ForceWarning and not (flgNoWarn in CommandFlags) then icon := msgIcon_Warning else icon := msgIcon_Success;Peter
#10
Posted 06 April 2010 - 09:06 AM
Thanks, Wonko!
- Normal Log
- Debug Log
- Vaerbose Debug Log
I added this.
But currently the only difference between standard and verbose debug log is the warning in FileDelete.
@All: Are there other commands where it makes sence to distinguish between standard and verbose?
Peter
#11
Posted 06 April 2010 - 09:30 AM
Hi Wonko,For whatever it may be useful, me thinks that the NEVERWARN opens the possibility to insert malicious code in a .script, besides making, if needed, debugging a problem, if anything happens that cannot be logged.
My suggestion wasn't about removing logging, only that a way be made so that the command doesn't appear as a warning in the log when this is unnecessary. In other words, the FileDelete operation will still appear in the log, just not flagged as a warning when a particular flag is set.
Thanks Peter!begin // FileDelete if ForceWarning and not (flgNoWarn in CommandFlags) then icon := msgIcon_Warning else icon := msgIcon_Success;Peter
Regards,
Galapo.
#12
Posted 06 April 2010 - 09:39 AM
Hi Wonko,
My suggestion wasn't about removing logging, only that a way be made so that the command doesn't appear as a warning in the log when this is unnecessary. In other words, the FileDelete operation will still appear in the log, just not flagged as a warning when a particular flag is set.
Sure , and my suggestion was different, in my perverted mind , if a line is "normally" not useful, it should not be "normally" printed at all, but it should be printed when a "more detailed" view is asked.
Ideally, and again in my perverted mind , a log is useful the moment it shows what is needed (and not more or less) I personally like something that is "telescopic" or if you prefer has selectable "levels", the higher the level the less info is output, the lower the level more details are given.
Wonko
#13
Posted 06 April 2010 - 12:16 PM
Wouldn't it make more sense to have a switch in Winbuilder for tests, to allow / disallow overwrite of files / registry keys, then tidying up the log?
#14
Posted 06 April 2010 - 09:05 PM
I'm not sure.To hijack this thread a bit.
Wouldn't it make more sense to have a switch in Winbuilder for tests, to allow / disallow overwrite of files / registry keys, then tidying up the log?
IMHO it is sufficient to have a standard log (w/o all the warnings etc) for the standard user who wants to have some hints why his project does not work.
And for developers there is the "Debug log" telling EVERYTHING including DeleteFile etc.
But I'm trying to fullfill all wishes and already coded
- Galapo's "Do not show FileDelete"
- Wonko's "Distinguish between 'standard' and 'verbose'"
Peter
#15
Posted 06 April 2010 - 09:43 PM
Wonkos standard - verbose is nonsense imo, since it is the same as standard log - debug log.But I'm trying to fullfill all wishes and already coded
I'm in doubt: Where is the sence?
- Galapo's "Do not show FileDelete"
- Wonko's "Distinguish between 'standard' and 'verbose'"
Or were you talking about something else?
#16
Posted 06 April 2010 - 11:00 PM
This thread was about FileDelete and it is a contradiction in terms to provide a flag to disallow the deletion.Wouldn't it make more sense to have a switch in Winbuilder for tests, to allow / disallow overwrite of files / registry keys, then tidying up the log?
For other operations like CopyOrExpand we already have the PRESERVE parameter that does what you suggest by disallowing the overwriting of files. For CAPI command require_file, files are already not overwritten by default and if this needs to be done then it needs to be specified with the OVERWRITE parameter.
To avoid registry overwrites, we already can use 'If,EXISTREGKEY' etc.
Regards,
Galapo.
#17
Posted 07 April 2010 - 11:28 AM
Peter
#18
Posted 07 April 2010 - 11:51 AM
You've misunderstood my intentions.This thread was about FileDelete and it is a contradiction in terms to provide a flag to disallow the deletion.
To avoid registry overwrites, we already can use 'If,EXISTREGKEY' etc.
I didn't meant a parameter to change the overwrite behaviour. I really meant a WB checkbox to change WB behaviour. This way one could easily run a quick test.
Changing the parameters for every command in all scripts takes way to long, to do it just for a test.
#19
Posted 07 April 2010 - 03:49 PM
Wonkos standard - verbose is nonsense imo, since it is the same as standard log - debug log.
Wonko actually proposed a three level solution instead of the current two level one:
A possible solution, cannot say if actually doable, is to add a "level" to the debugging log settings.
I.e. now there is an ON/OFF switch:maybe it would be possible to have a Debug Log (Verbose) that would allow to have EVERYTHING logged, whilst "simple" Debug Log could skip a number of warnings, including those with the NOWARN tag:
- Normal Log
- Debug Log
- Normal Log
- Debug Log
- Verbose Debug Log
The more the levels you can choose in a (sometimes very looong) log (or text document) the easier it is to find the relevant info.
Obviously it's up to the Developers to choose how to "populate" the various levels.
Another idea - again cannot say if doable - could be to always create a RAW log with ALL the info psc finds useful for debug, and use a post-processor, with settings selectable by the .script developer and/or the user to parse just the relevant information and display it with a given "stylesheet".
Something like the stupid .XML format (stupid in the sense that is hardly human-readable without it's specific XML Schema or XSL stylesheet) and the even more stupid XSLT transformations (the ones you never find a good one when you need them and you only have RAW XML data ).
Wonko
#20
Posted 12 November 2010 - 03:58 PM
#21
Posted 12 November 2010 - 07:49 PM
The mechanism is a part of the 'cooperative scripts' I introduced long time ago.sorry to drag up this old discussion but I have started seeing a lot of scripts using cmd.exe workarounds instead of the built in FileDelete command because of this issue, and I myself am having a hard time understanding why you would ever want a successful action to appear as a warning instead of a success in the log? shouldn't the warning be reserved for actions that don't complete successfully? otherwise what is the point? My understanding of the warning icon is to help make the log easier to read and find problems by pointing out failed attempts. by having successful operation displayed as warnings these failed attempts are lost in a sea of warnings for successful intended events and the log would be just as good off not having warnings at all! can anybody give me an example of why you would want a successful filedelete to show up as a warning icon and not a [success] icon?
Shortly said:
- When you get this warning as .script developer during the test phase in a new script, you have to adjust some things.
- When you see this message as end user, the .script developer has done something wrong, and you should not use this script.
Q&D explanation:
-Script A needs file X and installs it.
-Script B deletes the file.
- >> Forum support question: "script A works fine, but when I install script B, script A does not work any more"
When you as .script developer are sure, that deletion of file X does not harm the final PE, use "FileDelete",...., NOWARN
Peter
#22
Posted 12 November 2010 - 09:07 PM
The mechanism is a part of the 'cooperative scripts' I introduced long time ago.
Shortly said:
- When you get this warning as .script developer during the test phase in a new script, you have to adjust some things.
- When you see this message as end user, the .script developer has done something wrong, and you should not use this script.
Q&D explanation:
-Script A needs file X and installs it.
-Script B deletes the file.
- >> Forum support question: "script A works fine, but when I install script B, script A does not work any more"
When you as .script developer are sure, that deletion of file X does not harm the final PE, use "FileDelete",...., NOWARN
Peter
thank you for the reply. I understand your reasoning's.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users