Archive: !ifexists compile-time macro


!ifexists compile-time macro
Hi!

I'm looking for functionality that allows NSIS compiler to check if files are present, and take actions accordingly.

Specifically, I'm using DirectX in my application, and different developers in my organization have different versions of the SDK installed.

We are using NSIS installers for internal builds.

I would like to check for all of the DX SDK versions in inverse order.

something along the lines


!ifndef DXSDK
!ifexists "$%ProgramFiles%\Microsoft DirectX SDK (November 2008)"
!define DXSDK "$%ProgramFiles%\Microsoft DirectX SDK (November 2008)"
!endif
!endif

!ifndef DXSDK
!ifexists "$%ProgramFiles%\Microsoft DirectX SDK (August 2008)"
!define DXSDK "$%ProgramFiles%\Microsoft DirectX SDK (August 2008)"
!endif
!endif

http://forums.winamp.com/showthread.php?threadid=211262
You need to write a define to the file and then check if it has been defined to determine if the file exists.

Stu