DRC | 3dc1bc2 | 2010-05-10 22:18:10 +0000 | [diff] [blame] | 1 | !include x64.nsh |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 2 | Name "libjpeg-turbo SDK for ${PLATFORM}" |
| 3 | OutFile ${WBLDDIR}\${APPNAME}.exe |
| 4 | InstallDir c:\${APPNAME} |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 5 | |
| 6 | SetCompressor bzip2 |
| 7 | |
| 8 | Page directory |
| 9 | Page instfiles |
| 10 | |
| 11 | UninstPage uninstConfirm |
| 12 | UninstPage instfiles |
| 13 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 14 | Section "libjpeg-turbo SDK for ${PLATFORM} (required)" |
DRC | ef663e3 | 2010-05-10 23:39:22 +0000 | [diff] [blame] | 15 | !ifdef WIN64 |
DRC | 3dc1bc2 | 2010-05-10 22:18:10 +0000 | [diff] [blame] | 16 | ${If} ${RunningX64} |
| 17 | ${DisableX64FSRedirection} |
| 18 | ${Endif} |
DRC | ef663e3 | 2010-05-10 23:39:22 +0000 | [diff] [blame] | 19 | !endif |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 20 | SectionIn RO |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 21 | !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: |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 36 | SetOutPath $SYSDIR |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 37 | !ifdef GCC |
| 38 | File "${WLIBDIR}\libturbojpeg.dll" |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 39 | !else |
| 40 | File "${WLIBDIR}\turbojpeg.dll" |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 41 | !endif |
| 42 | SetOutPath $INSTDIR\bin |
| 43 | !ifdef GCC |
DRC | be09b20 | 2010-05-10 22:20:14 +0000 | [diff] [blame] | 44 | File "/oname=libjpeg-62.dll" "${WLIBDIR}\libjpeg-*.dll" |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 45 | !else |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 46 | File "${WLIBDIR}\jpeg62.dll" |
| 47 | !endif |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 48 | SetOutPath $INSTDIR\lib |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 49 | !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 |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 60 | SetOutPath $INSTDIR\include |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 61 | File "${WHDRDIR}\jconfig.h" |
| 62 | File "${WSRCDIR}\jerror.h" |
| 63 | File "${WSRCDIR}\jmorecfg.h" |
| 64 | File "${WSRCDIR}\jpeglib.h" |
| 65 | File "${WSRCDIR}\turbojpeg.h" |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 66 | SetOutPath $INSTDIR |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 67 | File "${WSRCDIR}\README" |
| 68 | File "${WSRCDIR}\README-turbo.txt" |
DRC | 39ea562 | 2010-10-12 01:55:31 +0000 | [diff] [blame^] | 69 | File "${WSRCDIR}\libjpeg.txt" |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 70 | File "${WSRCDIR}\LGPL.txt" |
| 71 | File "${WSRCDIR}\LICENSE.txt" |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 72 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 73 | WriteRegStr HKLM "SOFTWARE\${APPNAME} ${VERSION}" "Install_Dir" "$INSTDIR" |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 74 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 75 | 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 |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 79 | WriteUninstaller "uninstall_${VERSION}.exe" |
| 80 | SectionEnd |
| 81 | |
| 82 | Section "Uninstall" |
DRC | ef663e3 | 2010-05-10 23:39:22 +0000 | [diff] [blame] | 83 | !ifdef WIN64 |
DRC | 3dc1bc2 | 2010-05-10 22:18:10 +0000 | [diff] [blame] | 84 | ${If} ${RunningX64} |
| 85 | ${DisableX64FSRedirection} |
| 86 | ${Endif} |
DRC | ef663e3 | 2010-05-10 23:39:22 +0000 | [diff] [blame] | 87 | !endif |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 88 | |
| 89 | SetShellVarContext all |
| 90 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 91 | DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" |
| 92 | DeleteRegKey HKLM "SOFTWARE\${APPNAME} ${VERSION}" |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 93 | |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 94 | !ifdef GCC |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 95 | Delete $INSTDIR\bin\libjpeg-62.dll |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 96 | 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 |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 102 | Delete $INSTDIR\bin\jpeg62.dll |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 103 | 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 |
DRC | 0a1f68e | 2010-02-24 07:24:26 +0000 | [diff] [blame] | 108 | !endif |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 109 | 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 |
DRC | 23071bc | 2010-02-16 05:54:00 +0000 | [diff] [blame] | 115 | Delete $INSTDIR\README |
| 116 | Delete $INSTDIR\README-turbo.txt |
DRC | 39ea562 | 2010-10-12 01:55:31 +0000 | [diff] [blame^] | 117 | Delete $INSTDIR\libjpeg.txt |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 118 | Delete $INSTDIR\LGPL.txt |
| 119 | Delete $INSTDIR\LICENSE.txt |
| 120 | |
| 121 | RMDir "$INSTDIR\include" |
| 122 | RMDir "$INSTDIR\lib" |
DRC | 7e0b499 | 2010-02-25 05:52:44 +0000 | [diff] [blame] | 123 | RMDir "$INSTDIR\bin" |
DRC | 45ff6e2 | 2010-02-15 17:10:36 +0000 | [diff] [blame] | 124 | RMDir "$INSTDIR" |
| 125 | |
| 126 | SectionEnd |