DirExists bug

90 views
Skip to first unread message

Sam Oxigen

unread,
Oct 14, 2021, 7:16:41 PM10/14/21
to innosetup
Say user enters an existing path: 'C:\Temp\Test'

DirExists('C:\Temp\Test') returns true: ok.

Then...
DirExists('C:\Temp\\Test') returns true: its not ok but return true.
DirExists('C:\Temp\\\Test') returns true:  its not ok but return true.
DirExists('C:\Temp\\\\Test') returns true:  its not ok but return true.
DirExists('C:\Temp\\\\\Test') returns true:  its not ok but return true.
...
etc.
If the result is true and I send this path to somewhere to process then it will fail....

Bill Stewart

unread,
Oct 18, 2021, 5:50:36 PM10/18/21
to innosetup
On Thursday, October 14, 2021 at 5:16:41 PM UTC-6 ssaa...@gmail.com wrote:

If the result is true and I send this path to somewhere to process then it will fail....

Are you sure about that? Can you provide an example that we can reproduce?

Sam Oxigen

unread,
Oct 20, 2021, 2:20:50 AM10/20/21
to inno...@googlegroups.com
I've already posted some examples. Here I'm reposting them:
DirExists('C:\Temp\\Test') returns true
DirExists('C:\Temp\\\Test') returns true
DirExists('C:\Temp\\\\Test') returns true
DirExists('C:\Temp\\\\\Test') returns true
etc.
Multiple backslashes are ignored. That's the problem. Try on your own.

Thanks,
Sam

--
You received this message because you are subscribed to a topic in the Google Groups "innosetup" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/innosetup/Tg9bWId8lZI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/32c12cd6-52e3-43e3-b73d-8cc476f4ecc8n%40googlegroups.com.

Bill Stewart

unread,
Oct 20, 2021, 2:33:00 PM10/20/21
to innosetup
On Wednesday, October 20, 2021 at 12:20:50 AM UTC-6 ssaa...@gmail.com wrote:

I've already posted some examples. Here I'm reposting them:
DirExists('C:\Temp\\Test') returns true
DirExists('C:\Temp\\\Test') returns true
DirExists('C:\Temp\\\\Test') returns true
DirExists('C:\Temp\\\\\Test') returns true
 
What I was trying to hint at (badly, evidently) is that this doesn't break anything. Try it yourself in cmd.exe:

C:\>if exist C:\Windows\System32\\\\\kernel32.dll @echo It exists!
it exists!

So what I am saying is, what bug are you pointing out here?

Bill

Sam Oxigen

unread,
Nov 5, 2021, 12:46:14 PM11/5/21
to inno...@googlegroups.com
That socks. This is about reading/writhing a json file and I'm not sure if other programs that will read this file-- will not fail. So, I decided to make a  while statement to replace \\ to \ when dealing file paths.



--
You received this message because you are subscribed to the Google Groups "innosetup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to innosetup+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/innosetup/1636b29e-1d54-4ced-afcd-0f6f67242220n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages