Skip to content
⌘ NSIS Forum Archive

!ifexists compile-time macro

2 posts

qdot#

!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
Afrow UK#
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.

You need to write a define to the file and then check if it has been defined to determine if the file exists.

Stu