jben Posted April 19, 2008 Share Posted April 19, 2008 (edited) Hey. Can someone assist me in getting this code to work. Basically what I'm trying to do is stop my notification bar from displaying, unless the .gif or .png (or both) have copied to the directory. At the moment it seems like the notificaiton bar is displayed even if the files are not copied to the directory. Anyone got any ideas?...thanks I have commented out the additional code, as i'm not sure its correct. #include <MyExtras\NotificationBar.au3>;this is a notification bar that is compiled during into setup once built ;if fileexists ("C:\OUTPUT\MASTER\*.gif") and ("C:\OUTPUT\MASTER\*.png") Then filemove("C:\OUTPUT\MASTER\*.gif","C:\OUTPUT\29944M_10386\",9) filemove("C:\OUTPUT\MASTER\*.png","C:\OUTPUT\29944M_10386\",9) DirRemove("C:\OUTPUT\MASTER");deletes the original folder _UserNotification_Display("files extracted", "Extracted on "& @MDAY & "-" & @MON & "-" & @YEAR & " @ " & @HOUR & ":" & @MIN);notification information if extraction passes ;endif Edited April 19, 2008 by jben Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 The if condition is badly formatted, this is how it should look: if fileexists ("C:\OUTPUT\MASTER\*.gif") and fileexists ("C:\OUTPUT\MASTER\*.png") Then Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
jben Posted April 19, 2008 Author Share Posted April 19, 2008 Thanks.. The only problem I have now is that its not essential for both files to be available. As long as either the .png or .gif file is available then the code should proceed to my notifcation popup. If both files are available then thats also fine, but if only the .png file is available then the notification will still be displayed.. I tried: if fileexists ("C:\OUTPUT\MASTER\*.gif") or fileexists ("C:\OUTPUT\MASTER\*.png") Then doesn't seem to work Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 Thanks.. The only problem I have now is that its not essential for both files to be available. As long as either the .png or .gif file is available then the code should proceed to my notifcation popup. If both files are available then thats also fine, but if only the .png file is available then the notification will still be displayed.. I tried: if fileexists ("C:\OUTPUT\MASTER\*.gif") or fileexists ("C:\OUTPUT\MASTER\*.png") Then doesn't seem to workI don't follow your logic first you say that if either of them is present it's okay to proceed, but then you say it's not okay if the png exists? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
jben Posted April 19, 2008 Author Share Posted April 19, 2008 Yep. If either of the files is available then its fine to proceed.. Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 Yep. If either of the files is available then its fine to proceed..Then this will do fine: if fileexists ("C:\OUTPUT\MASTER\*.gif") or fileexists ("C:\OUTPUT\MASTER\*.png") Then Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
jben Posted April 19, 2008 Author Share Posted April 19, 2008 Thats what I thought but it doesnt work... :-( Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 The problem must lie in the fact that you're using wildcards. Do some debugging with filenames you know. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
jben Posted April 19, 2008 Author Share Posted April 19, 2008 (edited) I think I can see why its not working filemove("C:\OUTPUT\MASTER\*.gif","C:\OUTPUT\29944M_10386\",9);moves the .ncp file to the folder (creates folder if doesn't exist) filemove("C:\OUTPUT\MASTER\*.ping","C:\OUTPUT\29944M_10386\",9);moves the .lcn file to the folder (creates folder if doesn't exist) if the .gif file is not available then it seems like its getting stuck If I take out the checking and put the files in the folder then it copys them fine...Its just the issue that I don't want the notification to display unless either (or both) files have copied Edited April 19, 2008 by jben Link to comment Share on other sites More sharing options...
jben Posted April 19, 2008 Author Share Posted April 19, 2008 (edited) I'm thinking maybe something like this: Any ideas of how I could implement this??....thanks if FileExists("C:\OUTPUT\MASTER\*.gif") then filemove("C:\OUTPUT\MASTER\*.ncp","C:\OUTPUT\29944M_10386\",9) endif if FileExists ("C:\OUTPUT\MASTER\*.png") then filemove("C:\OUTPUT\MASTER\*.lcn","C:\OUTPUT\29944M_10386\",9) endif DirRemove("C:\OUTPUT\MASTER");deletes the original folder Edited April 19, 2008 by jben Link to comment Share on other sites More sharing options...
monoceres Posted April 19, 2008 Share Posted April 19, 2008 (edited) Is this what you want? $bool=False if FileExists("C:\OUTPUT\MASTER\*.gif") then filemove("C:\OUTPUT\MASTER\*.ncp","C:\OUTPUT\29944M_10386\",9) $bool=True endif if FileExists ("C:\OUTPUT\MASTER\*.png") then filemove("C:\OUTPUT\MASTER\*.lcn","C:\OUTPUT\29944M_10386\",9) $bool=True endif If $bool Then DirRemove("C:\OUTPUT\MASTER");deletes the original folder EndIf I still doesn't have full understanding of what it is you want to do though... Edited April 19, 2008 by monoceres Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now