![]() |
Change Directory if it exists
I'm having problems with a !cd that needs to happen "IF" a certain file exists (and thus the directory exists also). Here's my code:
------------------------------------------------- IfFileExists "$INSTDIR\folder\file" +1 skip1 !cd "$INSTDIR\folder" skip1: ;stuff... ------------------------------------------------- I'm getting a compiler error because the directory doesn't exist. Is there a way to do this? Thanks, Eric |
try IfFileExists with a folder... I think they use the same API for files and folders:
code: |
IfFileExists "$INSTDIR\folder\file" +1 skip1
!cd "$INSTDIR\folder" you mixed some things up ... "!cd" is a compiletime command "$INSTDIR" is a runtime variable "IfFileExists" is a runtime command |
I don't get it Comm@nder21, you put the same code as me there. It won't compile "because" !cd is a compiletime command. Is there a way to do what I'm trying to do (i.e. a way to change directories at runtime)?
Thanks, Eric |
SetOutPath...
-Stu |
i just copied your code and explained it to you.
i never posted a fix :) now, here is one, if you DO WANT it to perform at RUNTIME: code: |
Thanks Comm@nder21 and Afrow UK! I've seen that command but knew not what it was doing. Live long and prosper!
|
| All times are GMT. The time now is 05:18. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.