summaryrefslogtreecommitdiffstats
path: root/contrib/mingw/instance-check.nsi
blob: d8f0c5530087f8ab5815f23a7791b3ac1551d1c4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
; RTEMS Tools Installer.
;
; Copyright Chris Johns (chrisj@rtems.org)
;

Function CheckInstance
  Push $R0
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "RTEMSTools") i .r1 ?e'
  Pop $R0
!ifdef COMMON_FILES
  StrCmp $R0 0 +3
   MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
   Abort
!else
  StrCmp $R0 0 0 +3
   MessageBox MB_OK|MB_ICONEXCLAMATION "This installer should not be run directly. Please run the rtems${PRODUCT_VERSION}-tools-${RTEMS_BUILD_VERSION}.exe installer."
   Abort
!endif
  Pop $R0
FunctionEnd