blob: c4137b38484245db5de58a23f5b72abc92b5fee3 [file] [log] [blame]
DRC3dc1bc22010-05-10 22:18:10 +00001!include x64.nsh
DRC0a1f68e2010-02-24 07:24:26 +00002Name "libjpeg-turbo SDK for ${PLATFORM}"
3OutFile ${WBLDDIR}\${APPNAME}.exe
4InstallDir c:\${APPNAME}
DRC45ff6e22010-02-15 17:10:36 +00005
6SetCompressor bzip2
7
8Page directory
9Page instfiles
10
11UninstPage uninstConfirm
12UninstPage instfiles
13
DRC0a1f68e2010-02-24 07:24:26 +000014Section "libjpeg-turbo SDK for ${PLATFORM} (required)"
DRCef663e32010-05-10 23:39:22 +000015!ifdef WIN64
DRC3dc1bc22010-05-10 22:18:10 +000016 ${If} ${RunningX64}
17 ${DisableX64FSRedirection}
18 ${Endif}
DRCef663e32010-05-10 23:39:22 +000019!endif
DRC45ff6e22010-02-15 17:10:36 +000020 SectionIn RO
DRC7e0b4992010-02-25 05:52:44 +000021!ifdef GCC
22 IfFileExists $SYSDIR/libturbojpeg.dll exists 0
23!else
24 IfFileExists $SYSDIR/turbojpeg.dll exists 0
25!endif
26 goto notexists
27 exists:
28!ifdef GCC
29 MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} is already installed. Please uninstall it first."
30!else
31 MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} or the TurboJPEG SDK is already installed. Please uninstall it first."
32!endif
33 quit
34
35 notexists:
DRC45ff6e22010-02-15 17:10:36 +000036 SetOutPath $SYSDIR
DRC0a1f68e2010-02-24 07:24:26 +000037!ifdef GCC
38 File "${WLIBDIR}\libturbojpeg.dll"
DRC0a1f68e2010-02-24 07:24:26 +000039!else
40 File "${WLIBDIR}\turbojpeg.dll"
DRC7e0b4992010-02-25 05:52:44 +000041!endif
42 SetOutPath $INSTDIR\bin
43!ifdef GCC
DRCbe09b202010-05-10 22:20:14 +000044 File "/oname=libjpeg-62.dll" "${WLIBDIR}\libjpeg-*.dll"
DRC7e0b4992010-02-25 05:52:44 +000045!else
DRC0a1f68e2010-02-24 07:24:26 +000046 File "${WLIBDIR}\jpeg62.dll"
47!endif
DRC45ff6e22010-02-15 17:10:36 +000048 SetOutPath $INSTDIR\lib
DRC0a1f68e2010-02-24 07:24:26 +000049!ifdef GCC
50 File "${WLIBDIR}\libturbojpeg.dll.a"
51 File "${WLIBDIR}\libturbojpeg.a"
52 File "${WLIBDIR}\libjpeg.dll.a"
53 File "${WLIBDIR}\libjpeg.a"
54!else
55 File "${WLIBDIR}\turbojpeg.lib"
56 File "${WLIBDIR}\turbojpeg-static.lib"
57 File "${WLIBDIR}\jpeg.lib"
58 File "${WLIBDIR}\jpeg-static.lib"
59!endif
DRC45ff6e22010-02-15 17:10:36 +000060 SetOutPath $INSTDIR\include
DRC0a1f68e2010-02-24 07:24:26 +000061 File "${WHDRDIR}\jconfig.h"
62 File "${WSRCDIR}\jerror.h"
63 File "${WSRCDIR}\jmorecfg.h"
64 File "${WSRCDIR}\jpeglib.h"
65 File "${WSRCDIR}\turbojpeg.h"
DRC45ff6e22010-02-15 17:10:36 +000066 SetOutPath $INSTDIR
DRC0a1f68e2010-02-24 07:24:26 +000067 File "${WSRCDIR}\README"
68 File "${WSRCDIR}\README-turbo.txt"
DRC39ea5622010-10-12 01:55:31 +000069 File "${WSRCDIR}\libjpeg.txt"
DRC0a1f68e2010-02-24 07:24:26 +000070 File "${WSRCDIR}\LGPL.txt"
71 File "${WSRCDIR}\LICENSE.txt"
DRC45ff6e22010-02-15 17:10:36 +000072
DRC0a1f68e2010-02-24 07:24:26 +000073 WriteRegStr HKLM "SOFTWARE\${APPNAME} ${VERSION}" "Install_Dir" "$INSTDIR"
DRC45ff6e22010-02-15 17:10:36 +000074
DRC0a1f68e2010-02-24 07:24:26 +000075 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "DisplayName" "libjpeg-turbo SDK v${VERSION} for ${PLATFORM}"
76 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "UninstallString" '"$INSTDIR\uninstall_${VERSION}.exe"'
77 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoModify" 1
78 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoRepair" 1
DRC45ff6e22010-02-15 17:10:36 +000079 WriteUninstaller "uninstall_${VERSION}.exe"
80SectionEnd
81
82Section "Uninstall"
DRCef663e32010-05-10 23:39:22 +000083!ifdef WIN64
DRC3dc1bc22010-05-10 22:18:10 +000084 ${If} ${RunningX64}
85 ${DisableX64FSRedirection}
86 ${Endif}
DRCef663e32010-05-10 23:39:22 +000087!endif
DRC45ff6e22010-02-15 17:10:36 +000088
89 SetShellVarContext all
90
DRC0a1f68e2010-02-24 07:24:26 +000091 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}"
92 DeleteRegKey HKLM "SOFTWARE\${APPNAME} ${VERSION}"
DRC45ff6e22010-02-15 17:10:36 +000093
DRC0a1f68e2010-02-24 07:24:26 +000094!ifdef GCC
DRC7e0b4992010-02-25 05:52:44 +000095 Delete $INSTDIR\bin\libjpeg-62.dll
DRC0a1f68e2010-02-24 07:24:26 +000096 Delete $SYSDIR\libturbojpeg.dll
97 Delete $INSTDIR\lib\libturbojpeg.dll.a"
98 Delete $INSTDIR\lib\libturbojpeg.a"
99 Delete $INSTDIR\lib\libjpeg.dll.a"
100 Delete $INSTDIR\lib\libjpeg.a"
101!else
DRC7e0b4992010-02-25 05:52:44 +0000102 Delete $INSTDIR\bin\jpeg62.dll
DRC45ff6e22010-02-15 17:10:36 +0000103 Delete $SYSDIR\turbojpeg.dll
104 Delete $INSTDIR\lib\jpeg.lib
105 Delete $INSTDIR\lib\jpeg-static.lib
106 Delete $INSTDIR\lib\turbojpeg.lib
107 Delete $INSTDIR\lib\turbojpeg-static.lib
DRC0a1f68e2010-02-24 07:24:26 +0000108!endif
DRC45ff6e22010-02-15 17:10:36 +0000109 Delete $INSTDIR\include\jconfig.h"
110 Delete $INSTDIR\include\jerror.h"
111 Delete $INSTDIR\include\jmorecfg.h"
112 Delete $INSTDIR\include\jpeglib.h"
113 Delete $INSTDIR\include\turbojpeg.h"
114 Delete $INSTDIR\uninstall_${VERSION}.exe
DRC23071bc2010-02-16 05:54:00 +0000115 Delete $INSTDIR\README
116 Delete $INSTDIR\README-turbo.txt
DRC39ea5622010-10-12 01:55:31 +0000117 Delete $INSTDIR\libjpeg.txt
DRC45ff6e22010-02-15 17:10:36 +0000118 Delete $INSTDIR\LGPL.txt
119 Delete $INSTDIR\LICENSE.txt
120
121 RMDir "$INSTDIR\include"
122 RMDir "$INSTDIR\lib"
DRC7e0b4992010-02-25 05:52:44 +0000123 RMDir "$INSTDIR\bin"
DRC45ff6e22010-02-15 17:10:36 +0000124 RMDir "$INSTDIR"
125
126SectionEnd